Skip to content

Commit c97c03c

Browse files
committed
tests: changes in response to #5656
1 parent 0339647 commit c97c03c

12 files changed

+14
-125
lines changed

Diff for: src/test/compile-fail/issue-3311.rs

-31
This file was deleted.

Diff for: src/test/compile-fail/issue-3563.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
trait A {
1212
fn a(&self) {
13-
|| self.b() //~ ERROR type `&'self Self` does not implement any method in scope named `b`
13+
|| self.b() //~ ERROR type `&Self` does not implement any method in scope named `b`
1414
}
1515
}
1616
fn main() {}

Diff for: src/test/compile-fail/issue-3888.rs

-42
This file was deleted.

Diff for: src/test/compile-fail/issue-3969.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trait BikeMethods {
1818

1919
impl BikeMethods for Bike {
2020
fn woops() -> ~str { ~"foo" }
21-
//~^ ERROR method `woops` is declared as static in its impl, but not in its trait
21+
//~^ ERROR has a `&const self` declaration in the trait, but not in the impl
2222
}
2323

2424
pub fn main() {

Diff for: src/test/compile-fail/regions-infer-paramd-indirect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ struct c<'self> {
1818
f: @b<'self>
1919
}
2020

21-
trait set_f {
21+
trait set_f<'self> {
2222
fn set_f_ok(&self, b: @b<'self>);
2323
fn set_f_bad(&self, b: @b);
2424
}
2525

26-
impl<'self> set_f for c<'self> {
26+
impl<'self> set_f<'self> for c<'self> {
2727
fn set_f_ok(&self, b: @b<'self>) {
2828
self.f = b;
2929
}

Diff for: src/test/compile-fail/staticness-mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait foo {
1414
}
1515

1616
impl foo for int {
17-
fn bar(&self) {} //~ ERROR method `bar` is declared as static in its trait, but not in its impl
17+
fn bar(&self) {} //~ ERROR method `bar` has a `&self` declaration in the impl, but not in the trait
1818
}
1919

2020
fn main() {}

Diff for: src/test/run-pass/class-impl-very-parameterized-trait.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<T> Mutable for cat<T> {
5959
}
6060

6161
impl<T> Map<int, T> for cat<T> {
62-
fn each(&self, f: &fn(&int, &T) -> bool) {
62+
fn each<'a>(&'a self, f: &fn(&int, &'a T) -> bool) {
6363
let mut n = int::abs(self.meows);
6464
while n > 0 {
6565
if !f(&n, &self.name) { break; }
@@ -73,7 +73,7 @@ impl<T> Map<int, T> for cat<T> {
7373
for self.each |k, _| { if !f(k) { break; } loop;};
7474
}
7575

76-
fn each_value(&self, f: &fn(v: &T) -> bool) {
76+
fn each_value<'a>(&'a self, f: &fn(v: &'a T) -> bool) {
7777
for self.each |_, v| { if !f(v) { break; } loop;};
7878
}
7979

@@ -86,15 +86,15 @@ impl<T> Map<int, T> for cat<T> {
8686
true
8787
}
8888
89-
fn find(&self, k: &int) -> Option<&'self T> {
89+
fn find<'a>(&'a self, k: &int) -> Option<&'a T> {
9090
if *k <= self.meows {
9191
Some(&self.name)
9292
} else {
9393
None
9494
}
9595
}
9696
97-
fn find_mut(&mut self, _k: &int) -> Option<&'self mut T> { fail!() }
97+
fn find_mut<'a>(&'a mut self, _k: &int) -> Option<&'a mut T> { fail!() }
9898
9999
fn remove(&mut self, k: &int) -> bool {
100100
if self.find(k).is_some() {
@@ -106,7 +106,7 @@ impl<T> Map<int, T> for cat<T> {
106106
}
107107
108108
pub impl<T> cat<T> {
109-
fn get(&self, k: &int) -> &'self T {
109+
fn get<'a>(&'a self, k: &int) -> &'a T {
110110
match self.find(k) {
111111
Some(v) => { v }
112112
None => { fail!(~"epic fail"); }

Diff for: src/test/run-pass/explicit-self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub impl thing {
5858
fn foo(@self) -> int { *self.x.a }
5959
fn bar(~self) -> int { *self.x.a }
6060
fn quux(&self) -> int { *self.x.a }
61-
fn baz(&self) -> &'self A { &self.x }
61+
fn baz<'a>(&'a self) -> &'a A { &self.x }
6262
fn spam(self) -> int { *self.x.a }
6363
}
6464

Diff for: src/test/run-pass/issue-3860.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
struct Foo { x: int }
1212

1313
pub impl Foo {
14-
fn stuff(&mut self) -> &'self mut Foo {
14+
fn stuff<'a>(&'a mut self) -> &'a mut Foo {
1515
return self;
1616
}
1717
}

Diff for: src/test/run-pass/regions-parameterization-self-types-issue-5224.rs

-38
This file was deleted.

Diff for: src/test/run-pass/regions-self-impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait get_chowder<'self> {
1616
fn get_chowder(&self) -> &'self int;
1717
}
1818

19-
impl<'self> get_chowder for Clam<'self> {
19+
impl<'self> get_chowder<'self> for Clam<'self> {
2020
fn get_chowder(&self) -> &'self int { return self.chowder; }
2121
}
2222

Diff for: src/test/run-pass/regions-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait get_ctxt<'self> {
1616

1717
struct HasCtxt<'self> { c: &'self Ctxt }
1818

19-
impl<'self> get_ctxt for HasCtxt<'self> {
19+
impl<'self> get_ctxt<'self> for HasCtxt<'self> {
2020
fn get_ctxt(&self) -> &'self Ctxt {
2121
self.c
2222
}

0 commit comments

Comments
 (0)