Skip to content

Commit 59a768c

Browse files
committed
rename to AnonRegionFromAsyncFn
1 parent 1f853d2 commit 59a768c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl OutlivesSuggestionBuilder<'a> {
8989
| RegionNameSource::AnonRegionFromUpvar(..)
9090
| RegionNameSource::AnonRegionFromOutput(..)
9191
| RegionNameSource::AnonRegionFromYieldTy(..)
92-
| RegionNameSource::AnonRegionFromTraitObjAsync(..) => {
92+
| RegionNameSource::AnonRegionFromAsyncFn(..) => {
9393
debug!("Region {:?} is NOT suggestable", name);
9494
false
9595
}

src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ crate enum RegionNameSource {
5757
AnonRegionFromOutput(Span, String, String),
5858
/// The region from a type yielded by a generator.
5959
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),
6262
}
6363

6464
/// Records region names that have been assigned before so that we can use the same ones in later
@@ -117,7 +117,7 @@ impl RegionName {
117117
RegionNameSource::AnonRegionFromUpvar(..) |
118118
RegionNameSource::AnonRegionFromOutput(..) |
119119
RegionNameSource::AnonRegionFromYieldTy(..) |
120-
RegionNameSource::AnonRegionFromTraitObjAsync(..) => false,
120+
RegionNameSource::AnonRegionFromAsyncFn(..) => false,
121121
}
122122
}
123123

@@ -142,7 +142,7 @@ impl RegionName {
142142
diag.span_label(*span, format!("has type `{}`", type_name));
143143
}
144144
RegionNameSource::MatchedHirTy(span) |
145-
RegionNameSource::AnonRegionFromTraitObjAsync(span) => {
145+
RegionNameSource::AnonRegionFromAsyncFn(span) => {
146146
diag.span_label(
147147
*span,
148148
format!("let's call the lifetime of this reference `{}`", self),
@@ -306,14 +306,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
306306
} else {
307307
// If we spuriously thought that the region is named, we should let the
308308
// 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.
313312
let name = self.synthesize_region_name(renctx);
314313
Some(RegionName {
315314
name,
316-
source: RegionNameSource::AnonRegionFromTraitObjAsync(span),
315+
source: RegionNameSource::AnonRegionFromAsyncFn(span),
317316
})
318317
}
319318
}

0 commit comments

Comments
 (0)