@@ -10,7 +10,7 @@ use std::collections::{HashMap, HashSet};
10
10
use proc_macro2:: { Ident , Span , TokenStream } ;
11
11
use quote:: quote;
12
12
13
- use crate :: util:: { ident, KvParser , ListParser } ;
13
+ use crate :: util:: { bail , ident, KvParser , ListParser } ;
14
14
use crate :: ParseResult ;
15
15
16
16
pub struct FieldExport {
@@ -72,7 +72,6 @@ pub enum ExportType {
72
72
or_less : bool ,
73
73
exp : bool ,
74
74
radians_as_degrees : bool ,
75
- radians : bool ,
76
75
degrees : bool ,
77
76
hide_slider : bool ,
78
77
suffix : Option < TokenStream > ,
@@ -331,11 +330,19 @@ impl ExportType {
331
330
let key_maybe_value =
332
331
parser. next_allowed_key_optional_value ( & FLAG_OPTIONS , & KV_OPTIONS ) ?;
333
332
match key_maybe_value {
334
- Some ( ( option, None ) ) => {
335
- flags. insert ( option. to_string ( ) ) ;
333
+ Some ( ( ident, None ) ) => {
334
+ if ident == "radians" {
335
+ return bail ! (
336
+ & ident,
337
+ "#[export(range = (...))]: `radians` is broken in Godot and superseded by `radians_as_degrees`.\n \
338
+ See https://github.com/godotengine/godot/pull/82195 for details."
339
+ ) ;
340
+ }
341
+
342
+ flags. insert ( ident. to_string ( ) ) ;
336
343
}
337
- Some ( ( option , Some ( value) ) ) => {
338
- kvs. insert ( option . to_string ( ) , value. expr ( ) ?) ;
344
+ Some ( ( ident , Some ( value) ) ) => {
345
+ kvs. insert ( ident . to_string ( ) , value. expr ( ) ?) ;
339
346
}
340
347
None => break ,
341
348
}
@@ -351,7 +358,6 @@ impl ExportType {
351
358
or_less : flags. contains ( "or_less" ) ,
352
359
exp : flags. contains ( "exp" ) ,
353
360
radians_as_degrees : flags. contains ( "radians_as_degrees" ) ,
354
- radians : flags. contains ( "radians" ) ,
355
361
degrees : flags. contains ( "degrees" ) ,
356
362
hide_slider : flags. contains ( "hide_slider" ) ,
357
363
suffix : kvs. get ( "suffix" ) . cloned ( ) ,
@@ -441,7 +447,6 @@ impl ExportType {
441
447
or_less,
442
448
exp,
443
449
radians_as_degrees,
444
- radians,
445
450
degrees,
446
451
hide_slider,
447
452
suffix,
@@ -452,22 +457,9 @@ impl ExportType {
452
457
quote ! { None }
453
458
} ;
454
459
let export_func = quote_export_func ! {
455
- export_range( #min, #max, #step, #or_greater, #or_less, #exp, #radians_as_degrees || #radians , #degrees, #hide_slider, #suffix)
460
+ export_range( #min, #max, #step, #or_greater, #or_less, #exp, #radians_as_degrees, #degrees, #hide_slider, #suffix)
456
461
} ?;
457
- let deprecation_warning = if * radians {
458
- // For some reason, rustfmt formatting like this. Probably a bug.
459
- // See https://github.com/godot-rust/gdext/pull/783#discussion_r1669105958 and
460
- // https://github.com/rust-lang/rustfmt/issues/6233
461
- quote ! {
462
- #export_func;
463
- :: godot:: __deprecated:: emit_deprecated_warning!( export_range_radians) ;
464
- }
465
- } else {
466
- quote ! { #export_func }
467
- } ;
468
- Some ( quote ! {
469
- #deprecation_warning
470
- } )
462
+ Some ( export_func)
471
463
}
472
464
473
465
Self :: Enum { variants } => {
0 commit comments