Skip to content

Commit 557b9e7

Browse files
committed
auto merge of #14879 : Ryman/rust/resolve_super_hint_cut, r=alexcrichton
2 parents 4416b32 + 3791a85 commit 557b9e7

18 files changed

+250
-195
lines changed

src/librustc/middle/resolve.rs

+177-135
Large diffs are not rendered by default.

src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ extern crate macro_crate_test;
1919

2020
fn main() {
2121
macro_crate_test::foo();
22-
//~^ ERROR unresolved name
23-
//~^^ ERROR use of undeclared module `macro_crate_test`
24-
//~^^^ ERROR unresolved name `macro_crate_test::foo`.
22+
//~^ ERROR failed to resolve. Use of undeclared module `macro_crate_test`
23+
//~^^ ERROR unresolved name `macro_crate_test::foo`.
2524
}

src/test/compile-fail/import-from-missing.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:failed to resolve import
1211
use spam::{ham, eggs};
12+
//~^ ERROR unresolved import `spam::eggs`. There is no `eggs` in `spam`
1313

1414
mod spam {
1515
pub fn ham() { }

src/test/compile-fail/import.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:failed to resolve import
1211
use zed::bar;
1312
use zed::baz;
13+
//~^ ERROR unresolved import `zed::baz`. There is no `baz` in `zed`
1414

1515

1616
mod zed {

src/test/compile-fail/import2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use baz::zed::bar; //~ ERROR unresolved import
12-
//~^ ERROR failed to resolve import
11+
use baz::zed::bar;
12+
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`.
1313

1414

1515
mod baz {}

src/test/compile-fail/issue-12612.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use foo::bar;
1616

1717
mod test {
1818
use bar::foo;
19-
//~^ ERROR: unresolved import
20-
//~^^ ERROR: failed to resolve import
19+
//~^ ERROR unresolved import `bar::foo`. Maybe a missing `extern crate bar`?
2120
}
2221

2322
fn main() {}

src/test/compile-fail/issue-13404.rs

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

1111
use a::f;
1212
use b::f;
13-
//~^ ERROR: unresolved import
14-
//~^^ ERROR: failed to resolve import
13+
//~^ ERROR: unresolved import `b::f`. There is no `f` in `b`
1514

1615
mod a { pub fn f() {} }
1716
mod b { }

src/test/compile-fail/issue-1697.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -12,8 +12,6 @@
1212

1313
#![feature(globs)]
1414

15-
use unresolved::*; //~ ERROR unresolved import. maybe a missing
16-
//~^ ERROR failed to resolve import
15+
use unresolved::*; //~ ERROR unresolved import `unresolved::*`. Maybe a missing `extern crate unres
1716

18-
fn main() {
19-
}
17+
fn main() {}

src/test/compile-fail/issue-2123.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,11 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use x = m::f; //~ ERROR failed to resolve import
12-
//~^ unresolved import: there is no `f` in `m`
11+
use x = m::f; //~ ERROR unresolved import `m::f`. There is no `f` in `m`
1312

14-
mod m {
15-
}
13+
mod m {}
1614

17-
fn main() {
18-
}
15+
fn main() {}

src/test/compile-fail/issue-2937.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,11 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use x = m::f; //~ ERROR failed to resolve import
12-
//~^ ERROR unresolved import: there is no `f` in `m`
11+
use x = m::f; //~ ERROR unresolved import `m::f`. There is no `f` in `m`
1312

14-
mod m {
15-
}
13+
mod m {}
1614

17-
fn main() {
18-
}
15+
fn main() {}

src/test/compile-fail/macro-inner-attributes.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ test!(b,
2525
#[qux]
2626
fn main() {
2727
a::bar();
28-
//~^ ERROR use of undeclared module `a`
29-
//~^^ ERROR unresolved name
30-
//~^^^ ERROR unresolved name `a::bar`
28+
//~^ ERROR failed to resolve. Use of undeclared module `a`
29+
//~^^ ERROR unresolved name `a::bar`
3130
b::bar();
3231
}
3332

src/test/compile-fail/privacy2.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -24,14 +24,13 @@ mod bar {
2424
pub fn foo() {}
2525

2626
fn test1() {
27-
use bar::foo; //~ ERROR: unresolved import
28-
//~^ ERROR: failed to resolve
27+
use bar::foo;
28+
//~^ ERROR unresolved import `bar::foo`. There is no `foo` in `bar`
2929
}
3030

3131
fn test2() {
3232
use bar::glob::foo;
33-
//~^ ERROR: there is no
34-
//~^^ ERROR: failed to resolve
33+
//~^ ERROR unresolved import `bar::glob::foo`. There is no `foo` in `bar::glob`
3534
}
3635

3736
#[start] fn main(_: int, _: **u8) -> int { 3 }

src/test/compile-fail/privacy3.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -25,8 +25,8 @@ mod bar {
2525
pub fn foo() {}
2626

2727
fn test1() {
28-
use bar::gpriv; //~ ERROR: unresolved import
29-
//~^ ERROR: failed to resolve
28+
use bar::gpriv;
29+
//~^ ERROR unresolved import `bar::gpriv`. There is no `gpriv` in `bar`
3030
gpriv();
3131
}
3232

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod a {
12+
extern crate collections;
13+
use collections::HashMap;
14+
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `self::collections`?
15+
mod b {
16+
use collections::HashMap;
17+
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
18+
mod c {
19+
use collections::HashMap;
20+
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
21+
mod d {
22+
use collections::HashMap;
23+
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
24+
}
25+
}
26+
}
27+
}

src/test/compile-fail/super-at-top-level.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use super::f; //~ ERROR failed to resolve import
11+
use super::f; //~ ERROR unresolved import `super::f`
1212

1313
fn main() {
1414
}

src/test/compile-fail/unresolved-import.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,10 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use foo::bar; //~ ERROR unresolved import. maybe a missing `extern crate foo`?
12-
//~^ ERROR failed to resolve import `foo::bar`
13-
use x = bar::baz; //~ ERROR unresolved import: there is no `baz` in `bar`
14-
//~^ ERROR failed to resolve import `bar::baz`
11+
use foo::bar; //~ ERROR unresolved import `foo::bar`. Maybe a missing `extern crate foo`?
12+
13+
use x = bar::baz; //~ ERROR unresolved import `bar::baz`. There is no `baz` in `bar`
1514

1615
mod bar {
1716
struct bar;

src/test/compile-fail/use-from-trait-xc.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
extern crate use_from_trait_xc;
1414

15-
use use_from_trait_xc::Trait::foo; //~ ERROR cannot import from a trait or type implementation
16-
//~^ ERROR failed to resolve import
17-
use use_from_trait_xc::Foo::new; //~ ERROR cannot import from a trait or type implementation
18-
//~^ ERROR failed to resolve import
15+
use use_from_trait_xc::Trait::foo;
16+
//~^ ERROR unresolved import `use_from_trait_xc::Trait::foo`. Cannot import from a trait or type imp
1917

20-
fn main() {
21-
}
18+
use use_from_trait_xc::Foo::new;
19+
//~^ ERROR unresolved import `use_from_trait_xc::Foo::new`. Cannot import from a trait or type imple
20+
21+
fn main() {}

src/test/compile-fail/use-from-trait.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use Trait::foo; //~ ERROR cannot import from a trait or type implementation
12-
//~^ ERROR failed to resolve import
13-
use Foo::new; //~ ERROR cannot import from a trait or type implementation
14-
//~^ ERROR failed to resolve import
11+
use Trait::foo;
12+
//~^ ERROR unresolved import `Trait::foo`. Cannot import from a trait or type implementation
13+
use Foo::new;
14+
//~^ ERROR unresolved import `Foo::new`. Cannot import from a trait or type implementation
1515

1616
pub trait Trait {
1717
fn foo();

0 commit comments

Comments
 (0)