Skip to content

Commit 153419b

Browse files
committed
Small cleanup in parameterized
1 parent 984eab5 commit 153419b

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

compiler/rustc_middle/src/ty/parameterized.rs

+16-22
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@ use rustc_data_structures::fx::FxHashMap;
22
use rustc_hir::def_id::{DefId, DefIndex};
33
use 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

117
pub 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]
107101
macro_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

117111
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,
128122
}

0 commit comments

Comments
 (0)