@@ -2,14 +2,9 @@ use rustc_data_structures::fx::FxHashMap;
2
2
use rustc_hir:: def_id:: { DefId , DefIndex } ;
3
3
use rustc_index:: vec:: { Idx , IndexVec } ;
4
4
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;
10
6
11
7
pub trait ParameterizedOverTcx : ' static {
12
- #[ allow( unused_lifetimes) ]
13
8
type Value < ' tcx > ;
14
9
}
15
10
@@ -100,29 +95,28 @@ trivially_parameterized_over_tcx! {
100
95
rustc_type_ir:: Variance ,
101
96
}
102
97
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.
106
100
#[ macro_export]
107
101
macro_rules! parameterized_over_tcx {
108
- ( $( $ident : ident) ,+ $( , ) ?) => {
102
+ ( $( $( $fake_path : ident) ::+ ) ,+ $( , ) ?) => {
109
103
$(
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>;
112
106
}
113
107
) *
114
108
}
115
109
}
116
110
117
111
parameterized_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 ,
128
122
}
0 commit comments