diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-10-11 14:05:10 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-10-11 14:05:10 -0400 |
| commit | 68da108d56577657135af0186826ddef93104d22 (patch) | |
| tree | 4b827bd429198ce065c31a842fbc3f46cb030a68 | |
| parent | a534216fa6d518088ae4468f1cdc519cd79e6247 (diff) | |
| download | rust-68da108d56577657135af0186826ddef93104d22.tar.gz rust-68da108d56577657135af0186826ddef93104d22.zip | |
make it an error to use `'_` in outlives bounds
| -rw-r--r-- | src/librustc/hir/lowering.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 73093580910..16e8b8709a8 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -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)), + ) } } } |
