Skip to content

Commit 68da108

Browse files
committed
make it an error to use '_ in outlives bounds
1 parent a534216 commit 68da108

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/hir/lowering.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,11 @@ impl<'a> LoweringContext<'a> {
22992299
self.lower_trait_bound_modifier(modifier),
23002300
),
23012301
GenericBound::Outlives(ref lifetime) => {
2302-
hir::GenericBound::Outlives(self.lower_lifetime(lifetime))
2302+
// We don't want to accept `'a: '_`:
2303+
self.with_anonymous_lifetime_mode(
2304+
AnonymousLifetimeMode::PassThrough,
2305+
|this| hir::GenericBound::Outlives(this.lower_lifetime(lifetime)),
2306+
)
23032307
}
23042308
}
23052309
}

0 commit comments

Comments
 (0)