Fix fallout in tests.

This commit is contained in:
Jeffrey Seyfried 2016-10-13 08:05:03 +00:00
parent bf41c85c24
commit 649bcd409a
25 changed files with 23 additions and 528 deletions

View File

@ -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 <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.
pub mod bar {
pub fn foo() {}
}

View File

@ -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 <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.
// 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;
}

View File

@ -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();

View File

@ -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

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -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 <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.
// 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() {}

View File

@ -20,6 +20,6 @@ mod zed {
}
fn main() {
zed::foo(); //~ ERROR unresolved name
zed::foo(); //~ ERROR `foo` is private
bar();
}

View File

@ -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() {}
}

View File

@ -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 {}

View File

@ -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 {

View File

@ -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 <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.
// 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() {}

View File

@ -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

View File

@ -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() {}

View File

@ -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 <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.
// 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: Impossible>(_: 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() {}

View File

@ -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 {}

View File

@ -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 }

View File

@ -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() {}

View File

@ -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

View File

@ -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;

View File

@ -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.