Convert lifetime shadowing into a hard error, as promised.

This commit is contained in:
Niko Matsakis 2015-04-04 05:54:28 -04:00
parent bcae782aa8
commit 48a023c2e9

View file

@ -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;
}