From 49f2a566663b125334245563f4dbe51778296feb Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 6 Apr 2015 09:35:12 -0400 Subject: [PATCH] Fix tests --- src/test/compile-fail/shadowed-lifetime.rs | 11 ++--------- src/test/run-pass/overloaded-index-assoc-list.rs | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/test/compile-fail/shadowed-lifetime.rs b/src/test/compile-fail/shadowed-lifetime.rs index 725f83d495751..110b1a0d90c22 100644 --- a/src/test/compile-fail/shadowed-lifetime.rs +++ b/src/test/compile-fail/shadowed-lifetime.rs @@ -15,16 +15,14 @@ struct Foo<'a>(&'a isize); impl<'a> Foo<'a> { //~^ NOTE shadowed lifetime `'a` declared here fn shadow_in_method<'a>(&'a self) -> &'a isize { - //~^ WARNING lifetime name `'a` shadows another lifetime name that is already in scope - //~| NOTE deprecated + //~^ ERROR lifetime name `'a` shadows another lifetime name that is already in scope self.0 } fn shadow_in_type<'b>(&'b self) -> &'b isize { //~^ NOTE shadowed lifetime `'b` declared here let x: for<'b> fn(&'b isize) = panic!(); - //~^ WARNING lifetime name `'b` shadows another lifetime name that is already in scope - //~| NOTE deprecated + //~^ ERROR lifetime name `'b` shadows another lifetime name that is already in scope self.0 } @@ -35,9 +33,4 @@ impl<'a> Foo<'a> { } fn main() { - // intentional error that occurs after `resolve_lifetime` runs, - // just to ensure that this test fails to compile; when shadowed - // lifetimes become either an error or a proper lint, this will - // not be needed. - let x: isize = 3_usize; //~ ERROR mismatched types } diff --git a/src/test/run-pass/overloaded-index-assoc-list.rs b/src/test/run-pass/overloaded-index-assoc-list.rs index 131098d7c94e2..d98b1d9deae62 100644 --- a/src/test/run-pass/overloaded-index-assoc-list.rs +++ b/src/test/run-pass/overloaded-index-assoc-list.rs @@ -35,7 +35,7 @@ impl AssociationList { impl<'a, K: PartialEq + std::fmt::Debug, V:Clone> Index<&'a K> for AssociationList { type Output = V; - fn index<'a>(&'a self, index: &K) -> &'a V { + fn index(&self, index: &K) -> &V { for pair in &self.pairs { if pair.key == *index { return &pair.value