@@ -9,7 +9,7 @@ use rustc_middle::ty::{
9
9
self , GenericPredicates , ImplTraitInTraitData , Ty , TyCtxt , TypeVisitable , TypeVisitor , Upcast ,
10
10
} ;
11
11
use rustc_middle:: { bug, span_bug} ;
12
- use rustc_span:: { DUMMY_SP , Ident , Span } ;
12
+ use rustc_span:: { DUMMY_SP , Ident , Span , sym } ;
13
13
use tracing:: { debug, instrument, trace} ;
14
14
15
15
use super :: item_bounds:: explicit_item_bounds_with_filter;
@@ -69,6 +69,7 @@ pub(super) fn predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredic
69
69
) ;
70
70
}
71
71
72
+
72
73
debug ! ( "predicates_of({:?}) = {:?}" , def_id, result) ;
73
74
result
74
75
}
@@ -318,6 +319,18 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
318
319
predicates. extend ( const_evaluatable_predicates_of ( tcx, def_id, & predicates) ) ;
319
320
}
320
321
322
+ for attr in tcx. get_attrs ( def_id, sym:: allow_unstable_feature) {
323
+ if let Some ( list) = attr. meta_item_list ( ) {
324
+ for item in list. iter ( ) {
325
+ // TODO: deal with error later
326
+ let feature_name = item. name ( ) . unwrap ( ) ;
327
+ predicates
328
+ . insert ( ( ty:: ClauseKind :: UnstableFeature ( feature_name) . upcast ( tcx) , tcx. def_span ( def_id) ) ) ;
329
+
330
+ }
331
+ }
332
+ }
333
+
321
334
let mut predicates: Vec < _ > = predicates. into_iter ( ) . collect ( ) ;
322
335
323
336
// Subtle: before we store the predicates into the tcx, we
0 commit comments