From 1402963749f511b162033a0b23f78f591268402b Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 10 Mar 2016 07:55:12 +0000 Subject: [PATCH] Fix fallout in tests. --- src/test/auxiliary/issue_12612_1.rs | 2 +- src/test/compile-fail/glob-cycles.rs | 26 ----------------- src/test/compile-fail/import-shadow-1.rs | 8 ++---- src/test/compile-fail/import-shadow-2.rs | 30 -------------------- src/test/compile-fail/import-shadow-3.rs | 30 -------------------- src/test/compile-fail/import-shadow-4.rs | 30 -------------------- src/test/compile-fail/import-shadow-5.rs | 30 -------------------- src/test/compile-fail/import-shadow-6.rs | 30 -------------------- src/test/compile-fail/import-shadow-7.rs | 30 -------------------- src/test/compile-fail/issue-12612.rs | 3 +- src/test/compile-fail/issue-1697.rs | 2 +- src/test/compile-fail/issue-32797.rs | 21 -------------- src/test/compile-fail/variant-namespacing.rs | 4 +-- 13 files changed, 8 insertions(+), 238 deletions(-) delete mode 100644 src/test/compile-fail/glob-cycles.rs delete mode 100644 src/test/compile-fail/import-shadow-2.rs delete mode 100644 src/test/compile-fail/import-shadow-3.rs delete mode 100644 src/test/compile-fail/import-shadow-4.rs delete mode 100644 src/test/compile-fail/import-shadow-5.rs delete mode 100644 src/test/compile-fail/import-shadow-6.rs delete mode 100644 src/test/compile-fail/import-shadow-7.rs delete mode 100644 src/test/compile-fail/issue-32797.rs diff --git a/src/test/auxiliary/issue_12612_1.rs b/src/test/auxiliary/issue_12612_1.rs index a0234c1185a97..b76df6fe283f7 100644 --- a/src/test/auxiliary/issue_12612_1.rs +++ b/src/test/auxiliary/issue_12612_1.rs @@ -9,5 +9,5 @@ // except according to those terms. pub mod bar { - pub fn foo() {} + fn foo() {} } diff --git a/src/test/compile-fail/glob-cycles.rs b/src/test/compile-fail/glob-cycles.rs deleted file mode 100644 index 077ae19b4cbd6..0000000000000 --- a/src/test/compile-fail/glob-cycles.rs +++ /dev/null @@ -1,26 +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. - -mod foo { - pub use bar::*; - pub use main as f; //~ ERROR has already been imported -} - -mod bar { - pub use foo::*; -} - -pub use foo::*; -pub use baz::*; //~ ERROR has already been imported -mod baz { - pub use super::*; -} - -pub fn main() {} diff --git a/src/test/compile-fail/import-shadow-1.rs b/src/test/compile-fail/import-shadow-1.rs index 503fa4eca527b..697232168123d 100644 --- a/src/test/compile-fail/import-shadow-1.rs +++ b/src/test/compile-fail/import-shadow-1.rs @@ -13,7 +13,7 @@ #![no_implicit_prelude] use foo::*; -use bar::*; //~ERROR a type named `Baz` has already been imported in this module +use bar::*; mod foo { pub type Baz = isize; @@ -23,8 +23,6 @@ mod bar { pub type Baz = isize; } -mod qux { - pub use bar::Baz; +fn main() { + Baz; //~ ERROR } - -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 0c107cf27f592..0000000000000 --- 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 bf90973c2857e..0000000000000 --- 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 f21fdaae47ba0..0000000000000 --- 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 dc300bc7baa77..0000000000000 --- 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 fa3b75c70f0b6..0000000000000 --- 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 34aba15b39228..0000000000000 --- 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/issue-12612.rs b/src/test/compile-fail/issue-12612.rs index f76d12d93fdf6..9214feb819a23 100644 --- a/src/test/compile-fail/issue-12612.rs +++ b/src/test/compile-fail/issue-12612.rs @@ -15,8 +15,7 @@ extern crate issue_12612_1 as foo; use foo::bar; mod test { - use bar::foo; - //~^ ERROR unresolved import `bar::foo`. Maybe a missing `extern crate bar`? + use bar::foo; //~ ERROR `foo` is private } fn main() {} diff --git a/src/test/compile-fail/issue-1697.rs b/src/test/compile-fail/issue-1697.rs index f2d858391cea2..c820cc6a9f0b9 100644 --- a/src/test/compile-fail/issue-1697.rs +++ b/src/test/compile-fail/issue-1697.rs @@ -10,6 +10,6 @@ // Testing that we don't fail abnormally after hitting the errors -use unresolved::*; //~ ERROR unresolved import `unresolved::*`. Maybe a missing `extern crate unres +use unresolved::*; //~ ERROR unresolved import fn main() {} diff --git a/src/test/compile-fail/issue-32797.rs b/src/test/compile-fail/issue-32797.rs deleted file mode 100644 index af75783a710b5..0000000000000 --- a/src/test/compile-fail/issue-32797.rs +++ /dev/null @@ -1,21 +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. - -pub use bar::*; -mod bar { - pub use super::*; -} - -pub use baz::*; //~ ERROR already been imported -mod baz { - pub use main as f; -} - -pub fn main() {} diff --git a/src/test/compile-fail/variant-namespacing.rs b/src/test/compile-fail/variant-namespacing.rs index a8bb94b78fcc0..d658d5292e831 100644 --- a/src/test/compile-fail/variant-namespacing.rs +++ b/src/test/compile-fail/variant-namespacing.rs @@ -31,14 +31,14 @@ 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 `XStruct` has already been defined //~| ERROR `XTuple` has already been defined //~| ERROR `XTuple` has already been defined //~| ERROR `XUnit` 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 `Struct` has already been defined //~| ERROR `Tuple` has already been defined