Skip to content

Commit

Permalink
Convert lifetime shadowing into a hard error, as promised.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Apr 4, 2015
1 parent bcae782 commit 48a023c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
}

Expand Down

0 comments on commit 48a023c

Please sign in to comment.