diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-20 03:28:35 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-09-01 22:30:26 +0000 |
| commit | f582fa327e210ea5bf91d6b8f174f35fc9006054 (patch) | |
| tree | f5ffd57f363aef3e3eda96ef8d815cd649434c0c /src/test | |
| parent | 245a0c5530f8d4d251bcef2d7b8de2fa19f442bf (diff) | |
| download | rust-f582fa327e210ea5bf91d6b8f174f35fc9006054.tar.gz rust-f582fa327e210ea5bf91d6b8f174f35fc9006054.zip | |
item_like_imports: Allow multiple glob imports of the same item.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/imports/duplicate.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/compile-fail/imports/duplicate.rs b/src/test/compile-fail/imports/duplicate.rs new file mode 100644 index 00000000000..0b5963dd893 --- /dev/null +++ b/src/test/compile-fail/imports/duplicate.rs @@ -0,0 +1,38 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(item_like_imports)] + +mod a { + pub fn foo() {} +} + +mod b { + pub fn foo() {} +} + +mod c { + pub use a::foo; +} + +mod d { + use a::foo; //~ NOTE previous import + use a::foo; //~ ERROR `foo` has already been imported + //~| NOTE already imported +} + +mod e { + pub use a::*; + pub use c::*; // ok +} + +fn main() { + e::foo(); +} |
