fc928a18ba
This implements RFC 2480: * https://github.com/rust-lang/rfcs/pull/2480 * https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md Closes https://github.com/rust-lang/rust/issues/27783
72 lines
1.3 KiB
Rust
72 lines
1.3 KiB
Rust
// edition:2018
|
|
|
|
#![deny(unused_extern_crates)]
|
|
#![feature(test, rustc_private, crate_visibility_modifier)]
|
|
|
|
extern crate libc;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
extern crate libc as x;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
|
|
extern crate proc_macro;
|
|
|
|
#[macro_use]
|
|
extern crate test;
|
|
|
|
pub extern crate test as y;
|
|
|
|
pub extern crate alloc;
|
|
|
|
pub(crate) extern crate alloc as a;
|
|
|
|
crate extern crate alloc as b;
|
|
|
|
mod foo {
|
|
pub(in crate::foo) extern crate alloc as c;
|
|
|
|
pub(super) extern crate alloc as d;
|
|
|
|
extern crate libc;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
|
|
extern crate libc as x;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
|
|
pub extern crate test;
|
|
|
|
pub extern crate test as y;
|
|
|
|
mod bar {
|
|
extern crate libc;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
|
|
extern crate libc as x;
|
|
//~^ ERROR unused extern crate
|
|
//~| HELP remove
|
|
|
|
pub(in crate::foo::bar) extern crate alloc as e;
|
|
|
|
fn dummy() {
|
|
e::string::String::new();
|
|
}
|
|
}
|
|
|
|
fn dummy() {
|
|
c::string::String::new();
|
|
d::string::String::new();
|
|
}
|
|
}
|
|
|
|
|
|
fn main() {
|
|
a::string::String::new();
|
|
b::string::String::new();
|
|
|
|
proc_macro::TokenStream::new();
|
|
}
|