Skip to content

Commit 9dce83c

Browse files
committed
Tests
1 parent ac09535 commit 9dce83c

7 files changed

+217
-0
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::*;
17+
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::*;
17+
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::Baz;
17+
use bar::*; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::*;
17+
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::Baz;
17+
use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use qux::*;
17+
use foo::*; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
// Test that import shadowing using globs causes errors
12+
13+
#![no_implicit_prelude]
14+
#![feature(globs)]
15+
16+
use foo::*;
17+
use qux::*; //~ERROR a type named `Baz` has already been imported in this module
18+
19+
mod foo {
20+
pub type Baz = int;
21+
}
22+
23+
mod bar {
24+
pub type Baz = int;
25+
}
26+
27+
mod qux {
28+
pub use bar::Baz;
29+
}
30+
31+
fn main() {}

0 commit comments

Comments
 (0)