Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Apr 6, 2015
1 parent 48a023c commit 49f2a56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/test/compile-fail/shadowed-lifetime.rs
Expand Up @@ -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
}

Expand All @@ -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
}
2 changes: 1 addition & 1 deletion src/test/run-pass/overloaded-index-assoc-list.rs
Expand Up @@ -35,7 +35,7 @@ impl<K,V> AssociationList<K,V> {
impl<'a, K: PartialEq + std::fmt::Debug, V:Clone> Index<&'a K> for AssociationList<K,V> {
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
Expand Down

0 comments on commit 49f2a56

Please sign in to comment.