@@ -57,8 +57,8 @@ crate enum RegionNameSource {
57
57
AnonRegionFromOutput ( Span , String , String ) ,
58
58
/// The region from a type yielded by a generator.
59
59
AnonRegionFromYieldTy ( Span , String ) ,
60
- /// An anonymous region from a trait object in an async fn.
61
- AnonRegionFromTraitObjAsync ( Span ) ,
60
+ /// An anonymous region from an async fn.
61
+ AnonRegionFromAsyncFn ( Span ) ,
62
62
}
63
63
64
64
/// Records region names that have been assigned before so that we can use the same ones in later
@@ -117,7 +117,7 @@ impl RegionName {
117
117
RegionNameSource :: AnonRegionFromUpvar ( ..) |
118
118
RegionNameSource :: AnonRegionFromOutput ( ..) |
119
119
RegionNameSource :: AnonRegionFromYieldTy ( ..) |
120
- RegionNameSource :: AnonRegionFromTraitObjAsync ( ..) => false ,
120
+ RegionNameSource :: AnonRegionFromAsyncFn ( ..) => false ,
121
121
}
122
122
}
123
123
@@ -142,7 +142,7 @@ impl RegionName {
142
142
diag. span_label ( * span, format ! ( "has type `{}`" , type_name) ) ;
143
143
}
144
144
RegionNameSource :: MatchedHirTy ( span) |
145
- RegionNameSource :: AnonRegionFromTraitObjAsync ( span) => {
145
+ RegionNameSource :: AnonRegionFromAsyncFn ( span) => {
146
146
diag. span_label (
147
147
* span,
148
148
format ! ( "let's call the lifetime of this reference `{}`" , self ) ,
@@ -306,14 +306,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
306
306
} else {
307
307
// If we spuriously thought that the region is named, we should let the
308
308
// system generate a true name for error messages. Currently this can
309
- // happen if we have an elided name in a trait object used in an async fn
310
- // for example: the compiler will generate a region named `'_`, but
311
- // reporting such a name is not actually useful, so we synthesize a name
312
- // for it instead.
309
+ // happen if we have an elided name in an async fn for example: the
310
+ // compiler will generate a region named `'_`, but reporting such a name is
311
+ // not actually useful, so we synthesize a name for it instead.
313
312
let name = self . synthesize_region_name ( renctx) ;
314
313
Some ( RegionName {
315
314
name,
316
- source : RegionNameSource :: AnonRegionFromTraitObjAsync ( span) ,
315
+ source : RegionNameSource :: AnonRegionFromAsyncFn ( span) ,
317
316
} )
318
317
}
319
318
}
0 commit comments