Skip to content

Commit 0026e3e

Browse files
committed
hack around '_ named regions
1 parent 19122ab commit 0026e3e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,15 @@ impl OutlivesSuggestionBuilder {
6767
RegionNameSource::NamedEarlyBoundRegion(..)
6868
| RegionNameSource::NamedFreeRegion(..)
6969
| RegionNameSource::Static => {
70-
debug!("Region {:?} is suggestable", name);
71-
true
70+
// FIXME: This is a bit hacky. We should ideally have a semantic way for checking
71+
// if the name is `'_`...
72+
if name.name().with(|name| name != "'_") {
73+
debug!("Region {:?} is suggestable", name);
74+
true
75+
} else {
76+
debug!("Region {:?} is NOT suggestable", name);
77+
false
78+
}
7279
}
7380

7481
// Don't give suggestions for upvars, closure return types, or other unnamable

0 commit comments

Comments
 (0)