Feature gate extern prelude additions from extern crate items

Fix rustdoc and fulldeps tests
This commit is contained in:
Vadim Petrochenkov 2018-10-20 20:26:24 +03:00
parent 0f625ac48d
commit faefc83a7a
13 changed files with 143 additions and 9 deletions

View file

@ -0,0 +1,39 @@
// edition:2018
#![feature(alloc)]
extern crate alloc;
mod in_scope {
fn check() {
let v = alloc::vec![0];
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
type A = alloc::boxed::Box<u8>;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
}
}
mod absolute {
fn check() {
let v = ::alloc::vec![0];
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
type A = ::alloc::boxed::Box<u8>;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
}
}
mod import_in_scope {
use alloc;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
use alloc::boxed;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
}
mod import_absolute {
use ::alloc;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
use ::alloc::boxed;
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
}
fn main() {}

View file

@ -0,0 +1,67 @@
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:26:9
|
LL | use alloc;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:28:9
|
LL | use alloc::boxed;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:33:11
|
LL | use ::alloc;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:35:11
|
LL | use ::alloc::boxed;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:9:17
|
LL | let v = alloc::vec![0];
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:11:18
|
LL | type A = alloc::boxed::Box<u8>;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:18:19
|
LL | let v = ::alloc::vec![0];
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:20:20
|
LL | type A = ::alloc::boxed::Box<u8>;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,6 +1,7 @@
// compile-pass
// compile-flags:--cfg my_feature
#![feature(extern_crate_item_prelude)]
#![no_std]
#[cfg(my_feature)]

View file

@ -1,6 +1,8 @@
// compile-pass
// aux-build:two_macros.rs
#![feature(extern_crate_item_prelude)]
extern crate two_macros;
mod m {

View file

@ -1,5 +1,7 @@
// aux-build:two_macros.rs
#![feature(extern_crate_item_prelude)]
macro_rules! define_vec {
() => {
extern crate std as Vec;

View file

@ -1,11 +1,11 @@
error[E0659]: `Vec` is ambiguous
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:13:9
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9
|
LL | Vec::panic!(); //~ ERROR `Vec` is ambiguous
| ^^^ ambiguous name
|
note: `Vec` could refer to the name defined here
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:5:9
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9
|
LL | extern crate std as Vec;
| ^^^^^^^^^^^^^^^^^^^^^^^^