Convert lifetime shadowing into a hard error, as promised.
This commit is contained in:
parent
bcae782aa8
commit
48a023c2e9
1 changed files with 1 additions and 5 deletions
|
|
@ -507,7 +507,7 @@ impl<'a> LifetimeContext<'a> {
|
|||
EarlyScope(_, lifetimes, s) |
|
||||
LateScope(lifetimes, s) => {
|
||||
if let Some((_, lifetime_def)) = search_lifetimes(lifetimes, lifetime) {
|
||||
self.sess.span_warn(
|
||||
self.sess.span_err(
|
||||
lifetime.span,
|
||||
&format!("lifetime name `{}` shadows another \
|
||||
lifetime name that is already in scope",
|
||||
|
|
@ -516,10 +516,6 @@ impl<'a> LifetimeContext<'a> {
|
|||
lifetime_def.span,
|
||||
&format!("shadowed lifetime `{}` declared here",
|
||||
token::get_name(lifetime.name)));
|
||||
self.sess.span_note(
|
||||
lifetime.span,
|
||||
"shadowed lifetimes are deprecated \
|
||||
and will become a hard error before 1.0");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue