Skip to content

Commit 50a94df

Browse files
committed
v0.3.5 (with doc attributes)
1 parent ddc5b76 commit 50a94df

File tree

109 files changed

+454
-444
lines changed

Some content is hidden

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

109 files changed

+454
-444
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,25 +31,25 @@ 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;
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;
36-
#[cfg(feature = "api-4-1-1")]
36+
#[cfg(feature = "api-4-1-1")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-1")))]
3737
pub use gdextension_api::version_4_1_1 as prebuilt;
38-
#[cfg(feature = "api-4-1-2")]
38+
#[cfg(feature = "api-4-1-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-2")))]
3939
pub use gdextension_api::version_4_1_2 as prebuilt;
40-
#[cfg(feature = "api-4-1-3")]
40+
#[cfg(feature = "api-4-1-3")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-3")))]
4141
pub use gdextension_api::version_4_1_3 as prebuilt;
42-
#[cfg(feature = "api-4-1-4")]
42+
#[cfg(feature = "api-4-1-4")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-1-4")))]
4343
pub use gdextension_api::version_4_1_4 as prebuilt;
44-
#[cfg(feature = "api-4-2")]
44+
#[cfg(feature = "api-4-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2")))]
4545
pub use gdextension_api::version_4_2 as prebuilt;
46-
#[cfg(feature = "api-4-2-1")]
46+
#[cfg(feature = "api-4-2-1")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2-1")))]
4747
pub use gdextension_api::version_4_2_1 as prebuilt;
48-
#[cfg(feature = "api-4-2-2")]
48+
#[cfg(feature = "api-4-2-2")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-2-2")))]
4949
pub use gdextension_api::version_4_2_2 as prebuilt;
50-
#[cfg(feature = "api-4-3")]
50+
#[cfg(feature = "api-4-3")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-3")))]
5151
pub use gdextension_api::version_4_3 as prebuilt;
52-
#[cfg(feature = "api-4-4")]
52+
#[cfg(feature = "api-4-4")] #[cfg_attr(published_docs, doc(cfg(feature = "api-4-4")))]
5353
pub use gdextension_api::version_4_4 as prebuilt;
5454
// ]]
5555

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 std::borrow::Cow;
@@ -64,7 +65,7 @@ mod depend_on_custom {
6465
godot_exe::write_gdextension_headers(h_path, rs_path, false, watch);
6566
}
6667

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

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

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

83-
#[cfg(feature = "api-custom-json")]
84+
#[cfg(feature = "api-custom-json")] #[cfg_attr(published_docs, doc(cfg(feature = "api-custom-json")))]
8485
#[path = ""]
8586
mod depend_on_custom_json {
8687
use std::borrow::Cow;
@@ -106,13 +107,13 @@ mod depend_on_custom_json {
106107
}
107108
}
108109

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

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

115-
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))]
116+
#[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")))))]
116117
#[path = ""]
117118
mod depend_on_prebuilt {
118119
use super::*;
@@ -154,7 +155,7 @@ mod depend_on_prebuilt {
154155
}
155156
}
156157

157-
#[cfg(not(any(feature = "api-custom", feature = "api-custom-json")))]
158+
#[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")))))]
158159
pub use depend_on_prebuilt::*;
159160

160161
// ----------------------------------------------------------------------------------------------------------------------------------------------
@@ -218,7 +219,7 @@ pub fn emit_wasm_nothreads_cfg() {
218219

219220
// The environment variable for target family has a list of applicable families separated by commas.
220221
// For Emscripten in particular, this can be "unix,wasm". Therefore, to check for the Wasm target, we must check each item in the list.
221-
#[cfg(feature = "experimental-wasm-nothreads")]
222+
#[cfg(feature = "experimental-wasm-nothreads")] #[cfg_attr(published_docs, doc(cfg(feature = "experimental-wasm-nothreads")))]
222223
if std::env::var("CARGO_CFG_TARGET_FAMILY")
223224
.expect("target family environment variable")
224225
.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 proptest::arbitrary::Arbitrary;
304304
use proptest::collection::vec;
@@ -635,7 +635,7 @@ mod proptests {
635635
}
636636
}
637637

638-
#[cfg(test)]
638+
#[cfg(test)] #[cfg_attr(published_docs, doc(cfg(test)))]
639639
mod test {
640640
use super::*;
641641

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
@@ -20,11 +20,11 @@ pub fn make_sys_central_code(api: &ExtensionApi) -> TokenStream {
2020
let [opaque_32bit, opaque_64bit] = make_opaque_types(api);
2121

2222
quote! {
23-
#[cfg(target_pointer_width = "32")]
23+
#[cfg(target_pointer_width = "32")] #[cfg_attr(published_docs, doc(cfg(target_pointer_width = "32")))]
2424
pub mod types {
2525
#(#opaque_32bit)*
2626
}
27-
#[cfg(target_pointer_width = "64")]
27+
#[cfg(target_pointer_width = "64")] #[cfg_attr(published_docs, doc(cfg(target_pointer_width = "64")))]
2828
pub mod types {
2929
#(#opaque_64bit)*
3030
}

godot-codegen/src/generator/classes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn make_class(class: &Class, ctx: &mut Context, view: &ApiView) -> GeneratedClas
125125
let (cfg_attributes, cfg_inner_attributes);
126126
if class.is_experimental {
127127
cfg_attributes = quote! {
128-
// #[cfg(feature = "experimental-godot-api")]
128+
// #[cfg(feature = "experimental-godot-api")] #[cfg_attr(published_docs, doc(cfg(feature = "experimental-godot-api")))]
129129
#[cfg_attr(published_docs, doc(cfg(feature = "experimental-godot-api")))]
130130
};
131131
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
@@ -249,7 +249,7 @@ impl MethodInitGroup {
249249
}
250250
}
251251

252-
#[cfg(not(feature = "codegen-lazy-fptrs"))]
252+
#[cfg(not(feature = "codegen-lazy-fptrs"))] #[cfg_attr(published_docs, doc(cfg(not(feature = "codegen-lazy-fptrs"))))]
253253
fn function_name(&self) -> Ident {
254254
format_ident!("load_{}_methods", self.class_name)
255255
}
@@ -304,7 +304,7 @@ fn make_named_method_table(info: NamedMethodTable) -> TokenStream {
304304
}
305305
}
306306

307-
#[cfg(not(feature = "codegen-lazy-fptrs"))]
307+
#[cfg(not(feature = "codegen-lazy-fptrs"))] #[cfg_attr(published_docs, doc(cfg(not(feature = "codegen-lazy-fptrs"))))]
308308
fn make_method_table(info: IndexedMethodTable) -> TokenStream {
309309
let IndexedMethodTable {
310310
table_name,
@@ -417,7 +417,7 @@ fn make_method_table(info: IndexedMethodTable) -> TokenStream {
417417
}
418418
}
419419

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

godot-codegen/src/generator/notifications.rs

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

164164
let _ = &all_constants; // unused warning

0 commit comments

Comments
 (0)