Skip to content

Commit f9f9f50

Browse files
committed
Fix resolve tests and add some more.
The precedent resolve modification changed the order in which imports are handled, so 2 tests needed to be updated.
1 parent 96041cc commit f9f9f50

File tree

5 files changed

+104
-7
lines changed

5 files changed

+104
-7
lines changed

src/test/compile-fail/import-shadow-6.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#![no_implicit_prelude]
1414

15-
use qux::*;
16-
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
15+
use qux::*; //~ERROR a type named `Baz` has already been imported in this module
16+
use foo::*;
1717

1818
mod foo {
1919
pub type Baz = isize;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
use foo::baz;
1212
use bar::baz; //~ ERROR a module named `baz` has already been imported
1313

14-
use foo::Quux;
1514
use bar::Quux; //~ ERROR a trait named `Quux` has already been imported
15+
use foo::Quux;
1616

17-
use foo::blah;
18-
use bar::blah; //~ ERROR a type named `blah` has already been imported
17+
use foo::blah; //~ ERROR a type named `blah` has already been imported
18+
use bar::blah;
1919

20-
use foo::WOMP;
21-
use bar::WOMP; //~ ERROR a value named `WOMP` has already been imported
20+
use foo::WOMP; //~ ERROR a value named `WOMP` has already been imported
21+
use bar::WOMP;
2222

2323
fn main() {}
2424

src/test/run-pass/import-glob-1.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2012-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+
#![allow(unused_imports, dead_code)]
12+
13+
mod bar {
14+
pub use self::middle::*;
15+
16+
mod middle {
17+
pub use self::baz::Baz;
18+
19+
mod baz {
20+
pub enum Baz {
21+
Baz1,
22+
Baz2
23+
}
24+
}
25+
}
26+
}
27+
28+
mod foo {
29+
use bar::Baz::{Baz1, Baz2};
30+
}
31+
32+
fn main() {}

src/test/run-pass/issue-18083.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2015 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+
use b::{B};
13+
pub use self::inner::A;
14+
15+
mod inner {
16+
pub struct A;
17+
}
18+
}
19+
20+
mod b {
21+
use a::{A};
22+
pub use self::inner::B;
23+
24+
mod inner {
25+
pub struct B;
26+
}
27+
}
28+
29+
fn main() {}

src/test/run-pass/issue-4865-1.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2015 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+
pub mod a {
12+
use b::fn_b;
13+
use c::*;
14+
15+
pub fn fn_a(){
16+
}
17+
}
18+
19+
pub mod b {
20+
use a::fn_a;
21+
use c::*;
22+
23+
pub fn fn_b(){
24+
}
25+
}
26+
27+
pub mod c{
28+
pub fn fn_c(){
29+
}
30+
}
31+
32+
use a::fn_a;
33+
use b::fn_b;
34+
35+
fn main() {
36+
}

0 commit comments

Comments
 (0)