diff --git a/src/test/compile-fail/auxiliary/issue_12612_1.rs b/src/test/compile-fail/auxiliary/issue_12612_1.rs deleted file mode 100644 index a0234c1185a9..000000000000 --- a/src/test/compile-fail/auxiliary/issue_12612_1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub mod bar { - pub fn foo() {} -} diff --git a/src/test/compile-fail/auxiliary/namespace-mix-old.rs b/src/test/compile-fail/auxiliary/namespace-mix-old.rs deleted file mode 100644 index 29b139d771b0..000000000000 --- a/src/test/compile-fail/auxiliary/namespace-mix-old.rs +++ /dev/null @@ -1,83 +0,0 @@ -// 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// FIXME: Remove when `item_like_imports` is stabilized. - -pub mod c { - pub struct S {} - pub struct TS(); - pub struct US; - pub enum E { - V {}, - TV(), - UV, - } - - pub struct Item; -} - -pub mod proxy { - pub use c::*; - pub use c::E::*; -} - -pub mod xm1 { - pub use ::proxy::*; - pub type S = ::c::Item; -} -pub mod xm2 { - pub use ::proxy::*; - pub const S: ::c::Item = ::c::Item; -} - -pub mod xm3 { - pub use ::proxy::*; - pub type TS = ::c::Item; -} -pub mod xm4 { - pub use ::proxy::*; - pub const TS: ::c::Item = ::c::Item; -} - -pub mod xm5 { - pub use ::proxy::*; - pub type US = ::c::Item; -} -pub mod xm6 { - pub use ::proxy::*; - pub const US: ::c::Item = ::c::Item; -} - -pub mod xm7 { - pub use ::proxy::*; - pub type V = ::c::Item; -} -pub mod xm8 { - pub use ::proxy::*; - pub const V: ::c::Item = ::c::Item; -} - -pub mod xm9 { - pub use ::proxy::*; - pub type TV = ::c::Item; -} -pub mod xmA { - pub use ::proxy::*; - pub const TV: ::c::Item = ::c::Item; -} - -pub mod xmB { - pub use ::proxy::*; - pub type UV = ::c::Item; -} -pub mod xmC { - pub use ::proxy::*; - pub const UV: ::c::Item = ::c::Item; -} diff --git a/src/test/compile-fail/auxiliary/namespace-mix-new.rs b/src/test/compile-fail/auxiliary/namespace-mix.rs similarity index 97% rename from src/test/compile-fail/auxiliary/namespace-mix-new.rs rename to src/test/compile-fail/auxiliary/namespace-mix.rs index d42c0ee1a4da..d82e9bb70228 100644 --- a/src/test/compile-fail/auxiliary/namespace-mix-new.rs +++ b/src/test/compile-fail/auxiliary/namespace-mix.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(item_like_imports)] - pub mod c { pub struct S {} pub struct TS(); diff --git a/src/test/compile-fail/glob-cycles.rs b/src/test/compile-fail/glob-cycles.rs index 077ae19b4cbd..8f1b8ec91db3 100644 --- a/src/test/compile-fail/glob-cycles.rs +++ b/src/test/compile-fail/glob-cycles.rs @@ -8,9 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(rustc_attrs)] + mod foo { pub use bar::*; - pub use main as f; //~ ERROR has already been imported + pub use main as f; } mod bar { @@ -18,9 +20,10 @@ mod bar { } pub use foo::*; -pub use baz::*; //~ ERROR has already been imported +pub use baz::*; mod baz { pub use super::*; } -pub fn main() {} +#[rustc_error] +pub fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/import-shadow-1.rs b/src/test/compile-fail/import-shadow-1.rs deleted file mode 100644 index 503fa4eca527..000000000000 --- a/src/test/compile-fail/import-shadow-1.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::*; -use bar::*; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-2.rs b/src/test/compile-fail/import-shadow-2.rs deleted file mode 100644 index 0c107cf27f59..000000000000 --- a/src/test/compile-fail/import-shadow-2.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::*; -use foo::*; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-3.rs b/src/test/compile-fail/import-shadow-3.rs deleted file mode 100644 index bf90973c2857..000000000000 --- a/src/test/compile-fail/import-shadow-3.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::Baz; -use bar::*; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-4.rs b/src/test/compile-fail/import-shadow-4.rs deleted file mode 100644 index f21fdaae47ba..000000000000 --- a/src/test/compile-fail/import-shadow-4.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::*; -use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-5.rs b/src/test/compile-fail/import-shadow-5.rs deleted file mode 100644 index dc300bc7baa7..000000000000 --- a/src/test/compile-fail/import-shadow-5.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::Baz; -use bar::Baz; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-6.rs b/src/test/compile-fail/import-shadow-6.rs deleted file mode 100644 index fa3b75c70f0b..000000000000 --- a/src/test/compile-fail/import-shadow-6.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use qux::*; -use foo::*; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import-shadow-7.rs b/src/test/compile-fail/import-shadow-7.rs deleted file mode 100644 index 34aba15b3922..000000000000 --- a/src/test/compile-fail/import-shadow-7.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that import shadowing using globs causes errors - -#![no_implicit_prelude] - -use foo::*; -use qux::*; //~ERROR a type named `Baz` has already been imported in this module - -mod foo { - pub type Baz = isize; -} - -mod bar { - pub type Baz = isize; -} - -mod qux { - pub use bar::Baz; -} - -fn main() {} diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index 1ca1c060410a..81a5334ed7ab 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -20,6 +20,6 @@ mod zed { } fn main() { - zed::foo(); //~ ERROR unresolved name + zed::foo(); //~ ERROR `foo` is private bar(); } diff --git a/src/test/compile-fail/imports/duplicate.rs b/src/test/compile-fail/imports/duplicate.rs index faf85a523e8f..8dd69d8c24c8 100644 --- a/src/test/compile-fail/imports/duplicate.rs +++ b/src/test/compile-fail/imports/duplicate.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(item_like_imports)] - mod a { pub fn foo() {} } diff --git a/src/test/compile-fail/imports/reexports.rs b/src/test/compile-fail/imports/reexports.rs index fc46b23351ad..65e6e8d01b05 100644 --- a/src/test/compile-fail/imports/reexports.rs +++ b/src/test/compile-fail/imports/reexports.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(item_like_imports)] - mod a { fn foo() {} mod foo {} diff --git a/src/test/compile-fail/imports/unused.rs b/src/test/compile-fail/imports/unused.rs index 4ec9987df420..05ecc781af30 100644 --- a/src/test/compile-fail/imports/unused.rs +++ b/src/test/compile-fail/imports/unused.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(pub_restricted, item_like_imports)] +#![feature(pub_restricted)] #![deny(unused)] mod foo { diff --git a/src/test/compile-fail/issue-12612.rs b/src/test/compile-fail/issue-12612.rs deleted file mode 100644 index c6f76ca78874..000000000000 --- a/src/test/compile-fail/issue-12612.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:issue_12612_1.rs - -extern crate issue_12612_1 as foo; - -use foo::bar; - -mod test { - use bar::foo; //~ ERROR unresolved import `bar::foo` [E0432] - //~^ Maybe a missing `extern crate bar;`? -} - -fn main() {} diff --git a/src/test/compile-fail/issue-32797.rs b/src/test/compile-fail/issue-32797.rs index af75783a710b..2c54ed3e857e 100644 --- a/src/test/compile-fail/issue-32797.rs +++ b/src/test/compile-fail/issue-32797.rs @@ -8,14 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(rustc_attrs)] + pub use bar::*; mod bar { pub use super::*; } -pub use baz::*; //~ ERROR already been imported +pub use baz::*; mod baz { pub use main as f; } -pub fn main() {} +#[rustc_error] +pub fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/issue-32833.rs b/src/test/compile-fail/issue-32833.rs index d610e8b48379..41383e93603d 100644 --- a/src/test/compile-fail/issue-32833.rs +++ b/src/test/compile-fail/issue-32833.rs @@ -11,8 +11,7 @@ use bar::Foo; //~ ERROR unresolved import `bar::Foo` [E0432] //~^ no `Foo` in `bar` mod bar { - use Foo; //~ ERROR unresolved import `Foo` [E0432] - //~^ no `Foo` in the root + use Foo; } fn main() {} diff --git a/src/test/compile-fail/namespace-mix-old.rs b/src/test/compile-fail/namespace-mix-old.rs deleted file mode 100644 index 8cd82050814a..000000000000 --- a/src/test/compile-fail/namespace-mix-old.rs +++ /dev/null @@ -1,172 +0,0 @@ -// 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// FIXME: Remove when `item_like_imports` is stabilized. - -// aux-build:namespace-mix-old.rs - -extern crate namespace_mix_old; -use namespace_mix_old::{xm1, xm2, xm3, xm4, xm5, xm6, xm7, xm8, xm9, xmA, xmB, xmC}; - -mod c { - pub struct S {} - pub struct TS(); - pub struct US; - pub enum E { - V {}, - TV(), - UV, - } - - pub struct Item; -} - -mod proxy { - pub use c::*; - pub use c::E::*; -} - -// Use something emitting the type argument name, e.g. unsatisfied bound. -trait Impossible {} -fn check(_: T) {} - -mod m1 { - pub use ::proxy::*; - pub type S = ::c::Item; -} -mod m2 { - pub use ::proxy::*; - pub const S: ::c::Item = ::c::Item; -} - -fn f12() { - check(m1::S{}); //~ ERROR c::Item - check(m1::S); //~ ERROR unresolved name - check(m2::S{}); //~ ERROR c::S - check(m2::S); //~ ERROR c::Item -} -fn xf12() { - check(xm1::S{}); //~ ERROR c::Item - check(xm1::S); //~ ERROR unresolved name - check(xm2::S{}); //~ ERROR c::S - check(xm2::S); //~ ERROR c::Item -} - -mod m3 { - pub use ::proxy::*; - pub type TS = ::c::Item; -} -mod m4 { - pub use ::proxy::*; - pub const TS: ::c::Item = ::c::Item; -} - -fn f34() { - check(m3::TS{}); //~ ERROR c::Item - check(m3::TS); //~ ERROR c::TS - check(m4::TS{}); //~ ERROR c::TS - check(m4::TS); //~ ERROR c::Item -} -fn xf34() { - check(xm3::TS{}); //~ ERROR c::Item - check(xm3::TS); //~ ERROR c::TS - check(xm4::TS{}); //~ ERROR c::TS - check(xm4::TS); //~ ERROR c::Item -} - -mod m5 { - pub use ::proxy::*; - pub type US = ::c::Item; -} -mod m6 { - pub use ::proxy::*; - pub const US: ::c::Item = ::c::Item; -} - -fn f56() { - check(m5::US{}); //~ ERROR c::Item - check(m5::US); //~ ERROR c::US - check(m6::US{}); //~ ERROR c::US - check(m6::US); //~ ERROR c::Item -} -fn xf56() { - check(xm5::US{}); //~ ERROR c::Item - check(xm5::US); //~ ERROR c::US - check(xm6::US{}); //~ ERROR c::US - check(xm6::US); //~ ERROR c::Item -} - -mod m7 { - pub use ::proxy::*; - pub type V = ::c::Item; -} -mod m8 { - pub use ::proxy::*; - pub const V: ::c::Item = ::c::Item; -} - -fn f78() { - check(m7::V{}); //~ ERROR c::Item - check(m7::V); //~ ERROR name of a struct or struct variant - check(m8::V{}); //~ ERROR c::E - check(m8::V); //~ ERROR c::Item -} -fn xf78() { - check(xm7::V{}); //~ ERROR c::Item - check(xm7::V); //~ ERROR name of a struct or struct variant - check(xm8::V{}); //~ ERROR c::E - check(xm8::V); //~ ERROR c::Item -} - -mod m9 { - pub use ::proxy::*; - pub type TV = ::c::Item; -} -mod mA { - pub use ::proxy::*; - pub const TV: ::c::Item = ::c::Item; -} - -fn f9A() { - check(m9::TV{}); //~ ERROR c::Item - check(m9::TV); //~ ERROR c::E - check(mA::TV{}); //~ ERROR c::E - check(mA::TV); //~ ERROR c::Item -} -fn xf9A() { - check(xm9::TV{}); //~ ERROR c::Item - check(xm9::TV); //~ ERROR c::E - check(xmA::TV{}); //~ ERROR c::E - check(xmA::TV); //~ ERROR c::Item -} - -mod mB { - pub use ::proxy::*; - pub type UV = ::c::Item; -} -mod mC { - pub use ::proxy::*; - pub const UV: ::c::Item = ::c::Item; -} - -fn fBC() { - check(mB::UV{}); //~ ERROR c::Item - check(mB::UV); //~ ERROR c::E - check(mC::UV{}); //~ ERROR c::E - check(mC::UV); //~ ERROR c::Item -} -fn xfBC() { - check(xmB::UV{}); //~ ERROR c::Item - check(xmB::UV); //~ ERROR c::E - check(xmC::UV{}); //~ ERROR c::E - check(xmC::UV); //~ ERROR c::Item -} - -fn main() {} diff --git a/src/test/compile-fail/namespace-mix-new.rs b/src/test/compile-fail/namespace-mix.rs similarity index 96% rename from src/test/compile-fail/namespace-mix-new.rs rename to src/test/compile-fail/namespace-mix.rs index 59592e3d737d..cb7894b726f4 100644 --- a/src/test/compile-fail/namespace-mix-new.rs +++ b/src/test/compile-fail/namespace-mix.rs @@ -8,12 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// aux-build:namespace-mix-new.rs +// aux-build:namespace-mix.rs -#![feature(item_like_imports)] - -extern crate namespace_mix_new; -use namespace_mix_new::*; +extern crate namespace_mix; +use namespace_mix::*; mod c { pub struct S {} diff --git a/src/test/compile-fail/privacy2.rs b/src/test/compile-fail/privacy2.rs index 376e95312b8f..113dd2879406 100644 --- a/src/test/compile-fail/privacy2.rs +++ b/src/test/compile-fail/privacy2.rs @@ -31,8 +31,7 @@ fn test1() { fn test2() { use bar::glob::foo; - //~^ ERROR unresolved import `bar::glob::foo` [E0432] - //~| no `foo` in `bar::glob` + //~^ ERROR `foo` is private } #[start] fn main(_: isize, _: *const *const u8) -> isize { 3 } diff --git a/src/test/compile-fail/shadowed-use-visibility.rs b/src/test/compile-fail/shadowed-use-visibility.rs index 1bf7f3933849..e7e57a73de02 100644 --- a/src/test/compile-fail/shadowed-use-visibility.rs +++ b/src/test/compile-fail/shadowed-use-visibility.rs @@ -16,11 +16,11 @@ mod foo { } mod bar { - use foo::bar::f as g; //~ ERROR unresolved import + use foo::bar::f as g; //~ ERROR module `bar` is private use foo as f; pub use foo::*; } -use bar::f::f; //~ ERROR unresolved import +use bar::f::f; //~ ERROR module `f` is private fn main() {} diff --git a/src/test/compile-fail/variant-namespacing.rs b/src/test/compile-fail/variant-namespacing.rs index 3d8e2daaa15b..44e9260770e0 100644 --- a/src/test/compile-fail/variant-namespacing.rs +++ b/src/test/compile-fail/variant-namespacing.rs @@ -31,11 +31,11 @@ const XTuple: u8 = 0; const XUnit: u8 = 0; extern crate variant_namespacing; -pub use variant_namespacing::XE::*; +pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; //~^ ERROR `XStruct` has already been defined //~| ERROR `XTuple` has already been defined //~| ERROR `XUnit` has already been defined -pub use E::*; +pub use E::{Struct, Tuple, Unit}; //~^ ERROR `Struct` has already been defined //~| ERROR `Tuple` has already been defined //~| ERROR `Unit` has already been defined diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs index e750d1fb1e3e..4e402721a7b3 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs @@ -10,7 +10,7 @@ // force-host -#![feature(plugin_registrar, rustc_private, item_like_imports)] +#![feature(plugin_registrar, rustc_private)] extern crate syntax; extern crate syntax_ext; diff --git a/src/test/run-pass/imports.rs b/src/test/run-pass/imports.rs index 195b99c9788e..f845a2ee5716 100644 --- a/src/test/run-pass/imports.rs +++ b/src/test/run-pass/imports.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(item_like_imports)] #![allow(unused)] // Like other items, private imports can be imported and used non-lexically in paths.