Reexport -> re-export in error messages
This commit is contained in:
parent
c698496f84
commit
90fcd4476c
18 changed files with 44 additions and 41 deletions
|
|
@ -16,6 +16,6 @@
|
|||
#![crate_type = "dylib"]
|
||||
|
||||
#[macro_reexport(reexported)]
|
||||
//~^ ERROR macros reexports are experimental and possibly buggy
|
||||
//~^ ERROR macros re-exports are experimental and possibly buggy
|
||||
#[macro_use] #[no_link]
|
||||
extern crate macro_reexport_1;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ mod foo {
|
|||
}
|
||||
|
||||
pub use foo as foo2;
|
||||
//~^ ERROR `foo` is private, and cannot be reexported [E0365]
|
||||
//~^ ERROR `foo` is private, and cannot be re-exported [E0365]
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ mod a {
|
|||
mod foo {}
|
||||
|
||||
mod a {
|
||||
pub use super::foo; //~ ERROR cannot be reexported
|
||||
pub use super::foo; //~ ERROR cannot be re-exported
|
||||
pub use super::*; //~ ERROR must import something with the glob's visibility
|
||||
}
|
||||
}
|
||||
|
|
@ -24,17 +24,17 @@ mod b {
|
|||
|
||||
pub mod a {
|
||||
pub use super::foo; // This is OK since the value `foo` is visible enough.
|
||||
fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` reexported).
|
||||
fn f(_: foo::S) {} // `foo` is imported in the type namespace (but not `pub` re-exported).
|
||||
}
|
||||
|
||||
pub mod b {
|
||||
pub use super::*; // This is also OK since the value `foo` is visible enough.
|
||||
fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` reexported).
|
||||
fn f(_: foo::S) {} // Again, the module `foo` is imported (but not `pub` re-exported).
|
||||
}
|
||||
}
|
||||
|
||||
mod c {
|
||||
// Test that `foo` is not reexported.
|
||||
// Test that `foo` is not re-exported.
|
||||
use b::a::foo::S; //~ ERROR `foo`
|
||||
use b::b::foo::S as T; //~ ERROR `foo`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
mod rank {
|
||||
pub use self::Professor::*;
|
||||
//~^ ERROR enum is private and its variants cannot be reexported
|
||||
//~^ ERROR enum is private and its variants cannot be re-exported
|
||||
pub use self::Lieutenant::{JuniorGrade, Full};
|
||||
//~^ ERROR variant `JuniorGrade` is private and cannot be reexported
|
||||
//~| ERROR variant `Full` is private and cannot be reexported
|
||||
//~^ ERROR variant `JuniorGrade` is private and cannot be re-exported
|
||||
//~| ERROR variant `Full` is private and cannot be re-exported
|
||||
pub use self::PettyOfficer::*;
|
||||
//~^ ERROR enum is private and its variants cannot be reexported
|
||||
//~^ ERROR enum is private and its variants cannot be re-exported
|
||||
pub use self::Crewman::*;
|
||||
//~^ ERROR enum is private and its variants cannot be reexported
|
||||
//~^ ERROR enum is private and its variants cannot be re-exported
|
||||
|
||||
enum Professor {
|
||||
Adjunct,
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
#![feature(macro_reexport)]
|
||||
|
||||
#[allow(unused_extern_crates)]
|
||||
#[macro_reexport] //~ ERROR bad macro reexport
|
||||
#[macro_reexport] //~ ERROR bad macro re-export
|
||||
extern crate std;
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
#![feature(macro_reexport)]
|
||||
|
||||
#[allow(unused_extern_crates)]
|
||||
#[macro_reexport="foo"] //~ ERROR bad macro reexport
|
||||
#[macro_reexport="foo"] //~ ERROR bad macro re-export
|
||||
extern crate std;
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
#![feature(macro_reexport)]
|
||||
|
||||
#[allow(unused_extern_crates)]
|
||||
#[macro_reexport(foo="bar")] //~ ERROR bad macro reexport
|
||||
#[macro_reexport(foo="bar")] //~ ERROR bad macro re-export
|
||||
extern crate std;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#![feature(macro_reexport)]
|
||||
|
||||
#[macro_use(macro_two)]
|
||||
#[macro_reexport(no_way)] //~ ERROR reexported macro not found
|
||||
#[macro_reexport(no_way)] //~ ERROR re-exported macro not found
|
||||
extern crate two_macros;
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![allow(unused)]
|
||||
|
||||
use m::S;
|
||||
|
|
@ -19,7 +21,7 @@ mod m {
|
|||
use S;
|
||||
fn f() {
|
||||
S(10);
|
||||
//~^ ERROR private struct constructors are not usable through reexports in outer modules
|
||||
//~^ ERROR private struct constructors are not usable through re-exports in outer modules
|
||||
//~| WARN this was previously accepted
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ mod foo {
|
|||
fn f() {
|
||||
use foo::bar::S;
|
||||
pub(self) use foo::bar::f; // ok
|
||||
pub(super) use foo::bar::f as g; //~ ERROR cannot be reexported
|
||||
pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported
|
||||
S::default().x; // ok
|
||||
S::default().f(); // ok
|
||||
S::g(); // ok
|
||||
|
|
|
|||
|
|
@ -9,19 +9,19 @@
|
|||
// except according to those terms.
|
||||
|
||||
mod m1 {
|
||||
pub use ::E::V; //~ ERROR variant `V` is private and cannot be reexported
|
||||
pub use ::E::V; //~ ERROR variant `V` is private and cannot be re-exported
|
||||
}
|
||||
|
||||
mod m2 {
|
||||
pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be reexported
|
||||
pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be re-exported
|
||||
}
|
||||
|
||||
mod m3 {
|
||||
pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be reexported
|
||||
pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be re-exported
|
||||
}
|
||||
|
||||
mod m4 {
|
||||
pub use ::E::*; //~ ERROR enum is private and its variants cannot be reexported
|
||||
pub use ::E::*; //~ ERROR enum is private and its variants cannot be re-exported
|
||||
}
|
||||
|
||||
enum E { V }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#![allow(unused)]
|
||||
|
||||
extern crate core;
|
||||
pub use core as reexported_core; //~ ERROR `core` is private, and cannot be reexported
|
||||
pub use core as reexported_core; //~ ERROR `core` is private, and cannot be re-exported
|
||||
//~^ WARN this was previously accepted
|
||||
|
||||
mod foo1 {
|
||||
|
|
@ -19,7 +19,7 @@ mod foo1 {
|
|||
}
|
||||
|
||||
mod foo2 {
|
||||
use foo1::core; //~ ERROR `core` is private, and cannot be reexported
|
||||
use foo1::core; //~ ERROR `core` is private, and cannot be re-exported
|
||||
//~^ WARN this was previously accepted
|
||||
pub mod bar {
|
||||
extern crate core;
|
||||
|
|
@ -27,7 +27,7 @@ mod foo2 {
|
|||
}
|
||||
|
||||
mod baz {
|
||||
pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be reexported
|
||||
pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be re-exported
|
||||
//~^ WARN this was previously accepted
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue