@@ -2,14 +2,9 @@ use rustc_data_structures::fx::FxHashMap;
22use rustc_hir:: def_id:: { DefId , DefIndex } ;
33use rustc_index:: vec:: { Idx , IndexVec } ;
44
5- use crate :: middle:: exported_symbols:: ExportedSymbol ;
6- use crate :: mir:: Body ;
7- use crate :: ty:: {
8- self , Clause , Const , FnSig , GeneratorDiagnosticData , GenericPredicates , Predicate , TraitRef , Ty ,
9- } ;
5+ use crate :: ty;
106
117pub trait ParameterizedOverTcx : ' static {
12- #[ allow( unused_lifetimes) ]
138 type Value < ' tcx > ;
149}
1510
@@ -100,29 +95,28 @@ trivially_parameterized_over_tcx! {
10095 rustc_type_ir:: Variance ,
10196}
10297
103- // HACK(compiler-errors): This macro rule can only take an ident,
104- // not a path, due to parsing ambiguity reasons. That means we gotta
105- // import all of these types above.
98+ // HACK(compiler-errors): This macro rule can only take a fake path,
99+ // not a real, due to parsing ambiguity reasons.
106100#[ macro_export]
107101macro_rules! parameterized_over_tcx {
108- ( $( $ident : ident) ,+ $( , ) ?) => {
102+ ( $( $( $fake_path : ident) ::+ ) ,+ $( , ) ?) => {
109103 $(
110- impl $crate:: ty:: ParameterizedOverTcx for $ident <' static > {
111- type Value <' tcx> = $ident <' tcx>;
104+ impl $crate:: ty:: ParameterizedOverTcx for $( $fake_path ) ::+ <' static > {
105+ type Value <' tcx> = $( $fake_path ) ::+ <' tcx>;
112106 }
113107 ) *
114108 }
115109}
116110
117111parameterized_over_tcx ! {
118- Ty ,
119- FnSig ,
120- GenericPredicates ,
121- TraitRef ,
122- Const ,
123- Predicate ,
124- Clause ,
125- GeneratorDiagnosticData ,
126- Body ,
127- ExportedSymbol ,
112+ crate :: middle :: exported_symbols :: ExportedSymbol ,
113+ crate :: mir :: Body ,
114+ ty :: Ty ,
115+ ty :: FnSig ,
116+ ty :: GenericPredicates ,
117+ ty :: TraitRef ,
118+ ty :: Const ,
119+ ty :: Predicate ,
120+ ty :: Clause ,
121+ ty :: GeneratorDiagnosticData ,
128122}
0 commit comments