Skip to content

Commit a65091f

Browse files
committed
Rename generated lifetime.
1 parent 35cba9e commit a65091f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_macros/src/lift.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStre
77
s.add_bounds(synstructure::AddBounds::Generics);
88

99
let tcx: syn::Lifetime = parse_quote!('tcx);
10-
let newtcx: syn::GenericParam = parse_quote!('__newtcx);
10+
let newtcx: syn::GenericParam = parse_quote!('__lifted);
1111

1212
let lifted = {
1313
let ast = s.ast();
1414
let ident = &ast.ident;
1515

16-
// Replace `'tcx` lifetime by the `'__newtcx` lifetime
16+
// Replace `'tcx` lifetime by the `'__lifted` lifetime
1717
let (_, generics, _) = ast.generics.split_for_impl();
1818
let mut generics : syn::AngleBracketedGenericArguments = syn::parse_quote!{ #generics };
1919
for arg in generics.args.iter_mut() {
2020
match arg {
2121
syn::GenericArgument::Lifetime(l) if *l == tcx => {
22-
*arg = parse_quote!('__newtcx);
22+
*arg = parse_quote!('__lifted);
2323
},
2424
syn::GenericArgument::Type(t) => {
2525
*arg = syn::parse_quote!{ #t::Lifted };
@@ -40,10 +40,10 @@ pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStre
4040
});
4141

4242
s.add_impl_generic(newtcx);
43-
s.bound_impl(quote!(::rustc::ty::Lift<'__newtcx>), quote!{
43+
s.bound_impl(quote!(::rustc::ty::Lift<'__lifted>), quote!{
4444
type Lifted = #lifted;
4545

46-
fn lift_to_tcx(&self, __tcx: ::rustc::ty::TyCtxt<'__newtcx>) -> Option<#lifted> {
46+
fn lift_to_tcx(&self, __tcx: ::rustc::ty::TyCtxt<'__lifted>) -> Option<#lifted> {
4747
Some(match *self { #body })
4848
}
4949
})

0 commit comments

Comments
 (0)