@@ -60,6 +60,7 @@ macro_rules! methods {
60
60
( $( ( $name: ident $( ( $other: tt) ) * , $variant: ident( $( $contents: tt) * ) ) , ) * ) => {
61
61
$( methods!( @method $name, $variant( $( $contents) * ) ) ; ) *
62
62
63
+ #[ cfg( feature = "strict-macro" ) ]
63
64
fn check_used( self ) -> Result <( ) , Diagnostic > {
64
65
// Account for the fact this method was called
65
66
ATTRS . with( |state| state. checks. set( state. checks. get( ) + 1 ) ) ;
@@ -69,16 +70,32 @@ macro_rules! methods {
69
70
if used. get( ) {
70
71
continue
71
72
}
72
- if !cfg!( feature = "strict-macro" ) {
73
+ // The check below causes rustc to crash on powerpc64 platforms
74
+ // with an LLVM error. To avoid this, we instead use #[cfg()]
75
+ // and duplicate the function below. See #58516 for details.
76
+ /*if !cfg!(feature = "strict-macro") {
73
77
continue
74
- }
78
+ }*/
75
79
let span = match attr {
76
80
$( BindgenAttr :: $variant( span, ..) => span, ) *
77
81
} ;
78
82
errors. push( Diagnostic :: span_error( * span, "unused #[wasm_bindgen] attribute" ) ) ;
79
83
}
80
84
Diagnostic :: from_vec( errors)
81
85
}
86
+
87
+ #[ cfg( not( feature = "strict-macro" ) ) ]
88
+ fn check_used( self ) -> Result <( ) , Diagnostic > {
89
+ // Account for the fact this method was called
90
+ ATTRS . with( |state| state. checks. set( state. checks. get( ) + 1 ) ) ;
91
+ let mut errors = Vec :: new( ) ;
92
+ for ( used, attr) in self . attrs. iter( ) {
93
+ if used. get( ) {
94
+ continue
95
+ }
96
+ }
97
+ Diagnostic :: from_vec( errors)
98
+ }
82
99
} ;
83
100
84
101
( @method $name: ident, $variant: ident( Span , String , Span ) ) => {
0 commit comments