@@ -177,9 +177,7 @@ enum ImplTraitContext {
177
177
/// Treat `impl Trait` as shorthand for a new universal generic parameter.
178
178
/// Example: `fn foo(x: impl Debug)`, where `impl Debug` is conceptually
179
179
/// equivalent to a fresh universal parameter like `fn foo<T: Debug>(x: T)`.
180
- ///
181
- /// We store a DefId here so we can look up necessary information later
182
- Universal ( DefId ) ,
180
+ Universal ,
183
181
184
182
/// Treat `impl Trait` as shorthand for a new universal existential parameter.
185
183
/// Example: `fn foo() -> impl Debug`, where `impl Debug` is conceptually
@@ -803,7 +801,7 @@ impl<'a> LoweringContext<'a> {
803
801
let ( in_band_defs, ( mut lowered_generics, res) ) = self . with_in_scope_lifetime_defs (
804
802
& generics. params ,
805
803
|this| {
806
- let itctx = ImplTraitContext :: Universal ( parent_id ) ;
804
+ let itctx = ImplTraitContext :: Universal ;
807
805
this. collect_in_band_defs ( parent_id, anonymous_lifetime_mode, |this| {
808
806
( this. lower_generics ( generics, itctx) , f ( this) )
809
807
} )
@@ -1169,7 +1167,7 @@ impl<'a> LoweringContext<'a> {
1169
1167
|this| this. lower_param_bounds ( bounds, itctx) ,
1170
1168
)
1171
1169
}
1172
- ImplTraitContext :: Universal ( _def_id ) => {
1170
+ ImplTraitContext :: Universal => {
1173
1171
self . lower_node_id ( def_node_id) ;
1174
1172
// Add a definition for the in-band TyParam
1175
1173
let def_index = self
@@ -1875,8 +1873,8 @@ impl<'a> LoweringContext<'a> {
1875
1873
let inputs = decl. inputs
1876
1874
. iter ( )
1877
1875
. map ( |arg| {
1878
- if let Some ( def_id ) = fn_def_id {
1879
- self . lower_ty_direct ( & arg. ty , ImplTraitContext :: Universal ( def_id ) )
1876
+ if fn_def_id . is_some ( ) {
1877
+ self . lower_ty_direct ( & arg. ty , ImplTraitContext :: Universal )
1880
1878
} else {
1881
1879
self . lower_ty_direct ( & arg. ty , ImplTraitContext :: Disallowed )
1882
1880
}
@@ -2527,9 +2525,9 @@ impl<'a> LoweringContext<'a> {
2527
2525
body : & Block ,
2528
2526
) -> hir:: BodyId {
2529
2527
self . lower_body ( Some ( decl) , |this| {
2530
- if let IsAsync :: Async ( async_node_id ) = asyncness {
2528
+ if let IsAsync :: Async { closure_id , .. } = asyncness {
2531
2529
let async_expr = this. make_async_expr (
2532
- CaptureBy :: Value , async_node_id , None ,
2530
+ CaptureBy :: Value , closure_id , None ,
2533
2531
|this| {
2534
2532
let body = this. lower_block ( body, false ) ;
2535
2533
this. expr_block ( body, ThinVec :: new ( ) )
0 commit comments