Skip to content

Commit 59cc347

Browse files
committed
No longer advertise (most) deprecated symbols in API.
Some exceptions like StringName::from_latin1_with_nul() or String::chars_checked(), since those have deprecation conditional on Godot API level.
1 parent 3876fa9 commit 59cc347

File tree

9 files changed

+17
-0
lines changed

9 files changed

+17
-0
lines changed

godot-codegen/src/generator/enums.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ pub(crate) fn make_deprecated_enumerators(enum_: &Enum) -> TokenStream {
354354

355355
let decl = quote! {
356356
#[deprecated = #msg]
357+
#[doc(hidden)] // No longer advertise in API docs.
357358
pub const #pascal_name: #enum_name = Self::#name;
358359
};
359360

godot-core/src/builtin/collections/array.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ impl<T: ArrayElement> Array<T> {
190190
}
191191

192192
#[deprecated = "Renamed to `get`."]
193+
#[doc(hidden)] // No longer advertise in API docs.
193194
pub fn try_get(&self, index: usize) -> Option<T> {
194195
self.get(index)
195196
}
@@ -251,11 +252,13 @@ impl<T: ArrayElement> Array<T> {
251252
}
252253

253254
#[deprecated = "Renamed to `front`, in line with GDScript method and consistent with `push_front` and `pop_front`."]
255+
#[doc(hidden)] // No longer advertise in API docs.
254256
pub fn first(&self) -> Option<T> {
255257
self.front()
256258
}
257259

258260
#[deprecated = "Renamed to `back`, in line with GDScript method."]
261+
#[doc(hidden)] // No longer advertise in API docs.
259262
pub fn last(&self) -> Option<T> {
260263
self.back()
261264
}

godot-core/src/builtin/collections/packed_array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ macro_rules! impl_packed_array {
133133
///
134134
/// If `index` is out of bounds.
135135
#[deprecated = "Use [] operator (IndexMut) instead."]
136+
#[doc(hidden)] // No longer advertise in API docs.
136137
pub fn set(&mut self, index: usize, value: $Element) {
137138
let ptr_mut = self.ptr_mut(index);
138139

@@ -312,6 +313,7 @@ macro_rules! impl_packed_array {
312313
}
313314

314315
#[deprecated = "Renamed to bsearch like in Godot, to avoid confusion with Rust's slice::binary_search."]
316+
#[doc(hidden)] // No longer advertise in API docs.
315317
pub fn binary_search(&self, value: $Element) -> usize {
316318
self.bsearch(&value)
317319
}

godot-core/src/builtin/color.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ pub enum ColorChannelOrder {
376376
}
377377

378378
#[allow(non_upper_case_globals)]
379+
#[doc(hidden)] // No longer advertise in API docs.
379380
impl ColorChannelOrder {
380381
#[deprecated(note = "Renamed to `ColorChannelOrder::RGBA`.")]
381382
pub const Rgba: Self = Self::RGBA;

godot-core/src/builtin/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ pub(crate) fn to_isize(i: usize) -> isize {
138138

139139
/// Specialized types related to arrays.
140140
#[deprecated = "Merged into `godot::builtin::iter`."]
141+
#[doc(hidden)] // No longer advertise in API docs.
141142
pub mod array {
142143
pub type Iter<'a, T> = super::iter::ArrayIter<'a, T>;
143144
}
144145

145146
/// Specialized types related to dictionaries.
146147
#[deprecated = "Merged into `godot::builtin::iter`."]
148+
#[doc(hidden)] // No longer advertise in API docs.
147149
pub mod dictionary {
148150
pub type Iter<'a> = super::iter::DictIter<'a>;
149151
pub type Keys<'a> = super::iter::DictKeys<'a>;
@@ -152,6 +154,7 @@ pub mod dictionary {
152154
}
153155

154156
#[deprecated = "Moved to `godot::meta` and submodules."]
157+
#[doc(hidden)] // No longer advertise in API docs.
155158
pub mod meta {
156159
pub use crate::meta::error::*;
157160
pub use crate::meta::*;
@@ -161,9 +164,11 @@ pub mod meta {
161164
///
162165
/// _Godot equivalent: `@GlobalScope.Side`_
163166
#[deprecated = "Merged with `godot::builtin::Side`."]
167+
#[doc(hidden)] // No longer advertise in API docs.
164168
pub type RectSide = Side;
165169

166170
#[allow(non_upper_case_globals)]
171+
#[doc(hidden)] // No longer advertise in API docs.
167172
impl Side {
168173
#[deprecated(note = "Renamed to `Side::LEFT`.")]
169174
pub const Left: Side = Side::LEFT;

godot-core/src/builtin/projection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ pub enum ProjectionPlane {
552552
}
553553

554554
#[allow(non_upper_case_globals)]
555+
#[doc(hidden)] // No longer advertise in API docs.
555556
impl ProjectionPlane {
556557
#[deprecated(note = "Renamed to `ProjectionPlane::NEAR`")]
557558
pub const Near: Self = Self::NEAR;

godot-core/src/deprecated.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub use crate::emit_deprecated_warning;
3333
// Old names for VariantOperator constants
3434

3535
#[allow(non_upper_case_globals)]
36+
#[doc(hidden)] // No longer advertise in API docs.
3637
impl crate::builtin::VariantOperator {
3738
#[deprecated = "Renamed to `EQUAL`"]
3839
pub const Equal: Self = Self::EQUAL;

godot-core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ pub use godot_ffi::out;
6060
// Deprecated modules
6161

6262
#[deprecated = "Module has been split into `godot::classes`, `godot::global` and `godot::tools`."]
63+
#[doc(hidden)] // No longer advertise in API docs.
6364
pub mod engine;
6465

6566
#[deprecated = "Print macros have been moved to `godot::global`."]
67+
#[doc(hidden)] // No longer advertise in API docs.
6668
pub mod log {
6769
pub use crate::global::{
6870
godot_error, godot_print, godot_print_rich, godot_script_error, godot_warn,

godot-core/src/obj/gd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,4 +812,5 @@ impl<T: GodotClass> std::panic::UnwindSafe for Gd<T> {}
812812
impl<T: GodotClass> std::panic::RefUnwindSafe for Gd<T> {}
813813

814814
#[deprecated = "Removed; see `Gd::try_to_unique()`"]
815+
#[doc(hidden)] // No longer advertise in API docs.
815816
pub type NotUniqueError = ();

0 commit comments

Comments
 (0)