make it an error to use '_ in outlives bounds

This commit is contained in:
Niko Matsakis 2018-10-11 14:05:10 -04:00
parent a534216fa6
commit 68da108d56

View file

@ -2299,7 +2299,11 @@ impl<'a> LoweringContext<'a> {
self.lower_trait_bound_modifier(modifier),
),
GenericBound::Outlives(ref lifetime) => {
hir::GenericBound::Outlives(self.lower_lifetime(lifetime))
// We don't want to accept `'a: '_`:
self.with_anonymous_lifetime_mode(
AnonymousLifetimeMode::PassThrough,
|this| hir::GenericBound::Outlives(this.lower_lifetime(lifetime)),
)
}
}
}