Skip to content

Commit 65db6cb

Browse files
committed
v0.3.4 (with doc attributes)
1 parent ead0ecc commit 65db6cb

File tree

108 files changed

+442
-432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+442
-432
lines changed

godot-bindings/src/header_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub(crate) fn generate_rust_binding(in_h_path: &Path, out_rs_path: &Path) {
5757
});
5858
}
5959

60-
//#[cfg(target_os = "macos")]
60+
//#[cfg(target_os = "macos")] #[cfg_attr(published_docs, doc(cfg(target_os = "macos")))]
6161
fn configure_platform_specific(builder: bindgen::Builder) -> bindgen::Builder {
6262
// On macOS arm64 architecture, we currently get the following error. Tried using different LLVM versions.
6363
// Not clear if bindgen can be configured in a better way.

godot-bindings/src/import.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,34 @@ pub const ALL_VERSIONS: &[(u8, u8, u8)] = &[
3131

3232
// [version-sync] [[
3333
// [line] #[cfg(feature = "api-$kebabVersion")]\npub use gdextension_api::version_$snakeVersion as prebuilt;\n
34-
#[cfg(feature = "api-4-1")]
34+
#[cfg(feature = "api-4-1")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1")))]
3535
pub use gdextension_api::version_4_1 as prebuilt;
3636

37-
#[cfg(feature = "api-4-1-1")]
37+
#[cfg(feature = "api-4-1-1")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-1")))]
3838
pub use gdextension_api::version_4_1_1 as prebuilt;
3939

40-
#[cfg(feature = "api-4-1-2")]
40+
#[cfg(feature = "api-4-1-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-2")))]
4141
pub use gdextension_api::version_4_1_2 as prebuilt;
4242

43-
#[cfg(feature = "api-4-1-3")]
43+
#[cfg(feature = "api-4-1-3")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-3")))]
4444
pub use gdextension_api::version_4_1_3 as prebuilt;
4545

46-
#[cfg(feature = "api-4-1-4")]
46+
#[cfg(feature = "api-4-1-4")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-4")))]
4747
pub use gdextension_api::version_4_1_4 as prebuilt;
4848

49-
#[cfg(feature = "api-4-2")]
49+
#[cfg(feature = "api-4-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2")))]
5050
pub use gdextension_api::version_4_2 as prebuilt;
5151

52-
#[cfg(feature = "api-4-2-1")]
52+
#[cfg(feature = "api-4-2-1")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2-1")))]
5353
pub use gdextension_api::version_4_2_1 as prebuilt;
5454

55-
#[cfg(feature = "api-4-2-2")]
55+
#[cfg(feature = "api-4-2-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2-2")))]
5656
pub use gdextension_api::version_4_2_2 as prebuilt;
5757

58-
#[cfg(feature = "api-4-3")]
58+
#[cfg(feature = "api-4-3")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-3")))]
5959
pub use gdextension_api::version_4_3 as prebuilt;
6060

61-
#[cfg(feature = "api-4-4")]
61+
#[cfg(feature = "api-4-4")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-4")))]
6262
pub use gdextension_api::version_4_4 as prebuilt;
6363

6464
// ]]

godot-bindings/src/lib.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(published_docs, feature(doc_cfg))]
12
/*
23
* Copyright (c) godot-rust; Bromeon and contributors.
34
* This Source Code Form is subject to the terms of the Mozilla Public
@@ -42,10 +43,10 @@ pub struct GodotVersion {
4243
// Custom mode: Regenerate all files
4344

4445
// This file is explicitly included in unit tests. Needs regex dependency.
45-
#[cfg(test)]
46+
#[cfg(test)] #[cfg_attr(published_docs, doc(cfg(test)))]
4647
mod godot_version;
4748

48-
#[cfg(feature = "api-custom")]
49+
#[cfg(feature = "api-custom")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom")))]
4950
#[path = ""]
5051
mod depend_on_custom {
5152
use super::*;
@@ -63,7 +64,7 @@ mod depend_on_custom {
6364
godot_exe::write_gdextension_headers(h_path, rs_path, false, watch);
6465
}
6566

66-
#[cfg(feature = "api-custom-extheader")]
67+
#[cfg(feature = "api-custom-extheader")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom-extheader")))]
6768
pub fn write_gdextension_headers_from_c(h_path: &Path, rs_path: &Path, watch: &mut StopWatch) {
6869
godot_exe::write_gdextension_headers(h_path, rs_path, true, watch);
6970
}
@@ -73,13 +74,13 @@ mod depend_on_custom {
7374
}
7475
}
7576

76-
#[cfg(feature = "api-custom")]
77+
#[cfg(feature = "api-custom")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom")))]
7778
pub use depend_on_custom::*;
7879

7980
// ----------------------------------------------------------------------------------------------------------------------------------------------
8081
// Custom mode: Generate all files based on user provided JSON.
8182

82-
#[cfg(feature = "api-custom-json")]
83+
#[cfg(feature = "api-custom-json")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom-json")))]
8384
#[path = ""]
8485
mod depend_on_custom_json {
8586
use super::*;
@@ -105,13 +106,13 @@ mod depend_on_custom_json {
105106
}
106107
}
107108

108-
#[cfg(feature = "api-custom-json")]
109+
#[cfg(feature = "api-custom-json")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom-json")))]
109110
pub use depend_on_custom_json::*;
110111

111112
// ----------------------------------------------------------------------------------------------------------------------------------------------
112113
// Prebuilt mode: Reuse existing files
113114

114-
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))]
115+
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))] #[cfg_attr(published_docs, doc(cfg(not(any(feature = "api-custom", feature = "api-custom-json")))))]
115116
#[path = ""]
116117
mod depend_on_prebuilt {
117118
use super::*;
@@ -153,7 +154,7 @@ mod depend_on_prebuilt {
153154
}
154155
}
155156

156-
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))]
157+
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))] #[cfg_attr(published_docs, doc(cfg(not(any(feature = "api-custom", feature = "api-custom-json")))))]
157158
pub use depend_on_prebuilt::*;
158159

159160
// ----------------------------------------------------------------------------------------------------------------------------------------------
@@ -217,7 +218,7 @@ pub fn emit_wasm_nothreads_cfg() {
217218

218219
// The environment variable for target family has a list of applicable families separated by commas.
219220
// For Emscripten in particular, this can be "unix,wasm". Therefore, to check for the Wasm target, we must check each item in the list.
220-
#[cfg(feature = "experimental-wasm-nothreads")]
221+
#[cfg(feature = "experimental-wasm-nothreads")] #[cfg_attr(published_docs, doc(cfg(feature = "experimental-wasm-nothreads")))]
221222
if std::env::var("CARGO_CFG_TARGET_FAMILY")
222223
.expect("target family environment variable")
223224
.split(',')

godot-cell/src/borrow_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl From<String> for BorrowStateErr {
298298
}
299299
}
300300

301-
#[cfg(all(test, feature = "proptest"))]
301+
#[cfg(all(test, feature = "proptest"))] #[cfg_attr(published_docs, doc(cfg(all(test, feature = "proptest"))))]
302302
mod proptests {
303303
use super::*;
304304
use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*};
@@ -632,7 +632,7 @@ mod proptests {
632632
}
633633
}
634634

635-
#[cfg(test)]
635+
#[cfg(test)] #[cfg_attr(published_docs, doc(cfg(test)))]
636636
mod test {
637637
use super::*;
638638

godot-cell/src/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<T> CellState<T> {
241241
}
242242
}
243243

244-
#[cfg(test)]
244+
#[cfg(test)] #[cfg_attr(published_docs, doc(cfg(test)))]
245245
mod test {
246246
use super::*;
247247

godot-cell/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(published_docs, feature(doc_cfg))]
12
/*
23
* Copyright (c) godot-rust; Bromeon and contributors.
34
* This Source Code Form is subject to the terms of the Mozilla Public

godot-codegen/src/generator/central_files.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ pub fn make_sys_central_code(api: &ExtensionApi) -> TokenStream {
1919
let [opaque_32bit, opaque_64bit] = make_opaque_types(api);
2020

2121
quote! {
22-
#[cfg(target_pointer_width = "32")]
22+
#[cfg(target_pointer_width = "32")] #[cfg_attr(published_docs, doc(cfg(target_pointer_width = "32")))]
2323
pub mod types {
2424
#(#opaque_32bit)*
2525
}
26-
#[cfg(target_pointer_width = "64")]
26+
#[cfg(target_pointer_width = "64")] #[cfg_attr(published_docs, doc(cfg(target_pointer_width = "64")))]
2727
pub mod types {
2828
#(#opaque_64bit)*
2929
}

godot-codegen/src/generator/classes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn make_class(class: &Class, ctx: &mut Context, view: &ApiView) -> GeneratedClas
122122
let (cfg_attributes, cfg_inner_attributes);
123123
if class.is_experimental {
124124
cfg_attributes = quote! {
125-
// #[cfg(feature = "experimental-godot-api")]
125+
// #[cfg(feature = "experimental-godot-api")] #[cfg_attr(published_docs, doc(cfg(feature = "experimental-godot-api")))]
126126
#[cfg_attr(published_docs, doc(cfg(feature = "experimental-godot-api")))]
127127
};
128128
cfg_inner_attributes = quote! {

godot-codegen/src/generator/method_tables.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl MethodInitGroup {
247247
}
248248
}
249249

250-
#[cfg(not(feature = "codegen-lazy-fptrs"))]
250+
#[cfg(not(feature = "codegen-lazy-fptrs"))] #[cfg_attr(published_docs, doc(cfg(not(feature = "codegen-lazy-fptrs"))))]
251251
fn function_name(&self) -> Ident {
252252
format_ident!("load_{}_methods", self.class_name)
253253
}
@@ -302,7 +302,7 @@ fn make_named_method_table(info: NamedMethodTable) -> TokenStream {
302302
}
303303
}
304304

305-
#[cfg(not(feature = "codegen-lazy-fptrs"))]
305+
#[cfg(not(feature = "codegen-lazy-fptrs"))] #[cfg_attr(published_docs, doc(cfg(not(feature = "codegen-lazy-fptrs"))))]
306306
fn make_method_table(info: IndexedMethodTable) -> TokenStream {
307307
let IndexedMethodTable {
308308
table_name,
@@ -415,7 +415,7 @@ fn make_method_table(info: IndexedMethodTable) -> TokenStream {
415415
}
416416
}
417417

418-
#[cfg(feature = "codegen-lazy-fptrs")]
418+
#[cfg(feature = "codegen-lazy-fptrs")] #[cfg_attr(published_docs, doc(cfg(feature = "codegen-lazy-fptrs")))]
419419
fn make_method_table(info: IndexedMethodTable) -> TokenStream {
420420
let IndexedMethodTable {
421421
table_name,

godot-codegen/src/generator/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub fn try_to_notification(constant: &JsonClassConstant) -> Option<Ident> {
157157
/// This cannot be represented in a Rust enum, so we merge the two constants into a single enumerator.
158158
fn workaround_constant_collision(all_constants: &mut Vec<(Ident, i32)>) {
159159
// This constant has never been used by the engine.
160-
#[cfg(before_api = "4.2")]
160+
#[cfg(before_api = "4.2")] #[cfg_attr(published_docs, doc(cfg(before_api = "4.2")))]
161161
all_constants.retain(|(constant_name, _)| constant_name != "NODE_RECACHE_REQUESTED");
162162

163163
let _ = &all_constants; // unused warning

0 commit comments

Comments
 (0)