diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 3f1e4dca3a19..e75a73650b42 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -4842,7 +4842,8 @@ pub impl Resolver { if vec::len(values) > 0 && values[smallest] != uint::max_value && - values[smallest] < str::len(name) + 2 { + values[smallest] < str::len(name) + 2 && + maybes[smallest] != name.to_owned() { Some(vec::swap_remove(&mut maybes, smallest)) diff --git a/src/test/compile-fail/alt-join.rs b/src/test/compile-fail/alt-join.rs index a94709c57746..94488fbb5521 100644 --- a/src/test/compile-fail/alt-join.rs +++ b/src/test/compile-fail/alt-join.rs @@ -16,6 +16,6 @@ fn my_fail() -> ! { fail!(); } fn main() { match true { false => { my_fail(); } true => { } } - log(debug, x); //~ ERROR unresolved name: x + log(debug, x); //~ ERROR unresolved name: `x`. let x: int; } diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/compile-fail/bad-expr-path.rs index 576f9ef677ec..30014817308f 100644 --- a/src/test/compile-fail/bad-expr-path.rs +++ b/src/test/compile-fail/bad-expr-path.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: unresolved name: m1::a +// error-pattern: unresolved name: `m1::a`. Did you mean: `args`? mod m1 {} diff --git a/src/test/compile-fail/bad-expr-path2.rs b/src/test/compile-fail/bad-expr-path2.rs index 5545bbf68f04..88239a4cc3fe 100644 --- a/src/test/compile-fail/bad-expr-path2.rs +++ b/src/test/compile-fail/bad-expr-path2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: unresolved name: m1::a +// error-pattern: unresolved name: `m1::a`. Did you mean: `args`? mod m1 { pub mod a {} diff --git a/src/test/compile-fail/does-nothing.rs b/src/test/compile-fail/does-nothing.rs index c6115f408535..a360d6579574 100644 --- a/src/test/compile-fail/does-nothing.rs +++ b/src/test/compile-fail/does-nothing.rs @@ -1,3 +1,3 @@ -// error-pattern: unresolved name: this_does_nothing_what_the +// error-pattern: unresolved name: `this_does_nothing_what_the`. fn main() { debug!("doing"); this_does_nothing_what_the; debug!("boing"); } diff --git a/src/test/compile-fail/issue-1476.rs b/src/test/compile-fail/issue-1476.rs index 4f21e30cc168..7a45ecc83b0c 100644 --- a/src/test/compile-fail/issue-1476.rs +++ b/src/test/compile-fail/issue-1476.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - log(error, x); //~ ERROR unresolved name: x + log(error, x); //~ ERROR unresolved name: `x`. } diff --git a/src/test/compile-fail/issue-3021-b.rs b/src/test/compile-fail/issue-3021-b.rs index a782dd58ee67..1d4cd69c54ee 100644 --- a/src/test/compile-fail/issue-3021-b.rs +++ b/src/test/compile-fail/issue-3021-b.rs @@ -19,7 +19,7 @@ fn siphash(k0 : u64) { impl siphash { fn reset(&mut self) { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture - //~^ ERROR unresolved name: k0 + //~^ ERROR unresolved name: `k0`. } } } diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs index 38bd007f1891..7381d36a2239 100644 --- a/src/test/compile-fail/issue-3021-d.rs +++ b/src/test/compile-fail/issue-3021-d.rs @@ -31,9 +31,9 @@ fn siphash(k0 : u64, k1 : u64) -> siphash { impl siphash for sipstate { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture - //~^ ERROR unresolved name: k0 + //~^ ERROR unresolved name: `k0`. self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR attempted dynamic environment-capture - //~^ ERROR unresolved name: k1 + //~^ ERROR unresolved name: `k1`. } fn result() -> u64 { return mk_result(self); } } diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index fdfd25621750..e5a7a7990e52 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -23,7 +23,7 @@ fn siphash(k0 : u64) -> siphash { impl siphash for sipstate { fn reset() { self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture - //~^ ERROR unresolved name: k0 + //~^ ERROR unresolved name: `k0`. } } fail!();