2018-08-16 02:36:11 -05:00
|
|
|
// edition:2018
|
2018-05-11 13:31:08 -05:00
|
|
|
|
2018-05-25 15:53:49 -05:00
|
|
|
#![deny(unused_extern_crates)]
|
2022-05-20 20:06:44 -05:00
|
|
|
#![feature(test, rustc_private)]
|
2018-05-04 13:25:31 -05:00
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
2018-05-04 13:25:31 -05:00
|
|
|
//~| HELP remove
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc as x;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
|
|
|
//~| HELP remove
|
2018-05-04 13:25:31 -05:00
|
|
|
|
2018-09-28 14:54:18 -05:00
|
|
|
extern crate proc_macro;
|
|
|
|
|
2018-05-04 13:25:31 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate test;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-05-04 13:25:31 -05:00
|
|
|
pub extern crate test as y;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
pub extern crate alloc;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
pub(crate) extern crate alloc as a;
|
2018-05-04 13:25:31 -05:00
|
|
|
|
2022-05-20 20:06:44 -05:00
|
|
|
pub(crate) extern crate alloc as b;
|
2018-05-04 13:25:31 -05:00
|
|
|
|
|
|
|
mod foo {
|
2018-11-26 08:28:42 -06:00
|
|
|
pub(in crate::foo) extern crate alloc as c;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
pub(super) extern crate alloc as d;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
|
|
|
//~| HELP remove
|
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc as x;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
|
|
|
//~| HELP remove
|
|
|
|
|
2018-05-04 13:25:31 -05:00
|
|
|
pub extern crate test;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-05-04 13:25:31 -05:00
|
|
|
pub extern crate test as y;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
2018-05-04 13:25:31 -05:00
|
|
|
mod bar {
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
|
|
|
//~| HELP remove
|
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
extern crate libc as x;
|
2018-05-25 15:53:49 -05:00
|
|
|
//~^ ERROR unused extern crate
|
|
|
|
//~| HELP remove
|
|
|
|
|
2018-11-26 08:28:42 -06:00
|
|
|
pub(in crate::foo::bar) extern crate alloc as e;
|
2018-05-25 15:53:49 -05:00
|
|
|
|
|
|
|
fn dummy() {
|
2018-11-26 08:28:42 -06:00
|
|
|
e::string::String::new();
|
2018-05-25 15:53:49 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn dummy() {
|
2018-11-26 08:28:42 -06:00
|
|
|
c::string::String::new();
|
|
|
|
d::string::String::new();
|
2018-05-04 13:25:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-25 15:53:49 -05:00
|
|
|
fn main() {
|
2018-11-26 08:28:42 -06:00
|
|
|
a::string::String::new();
|
|
|
|
b::string::String::new();
|
2018-09-28 14:54:18 -05:00
|
|
|
|
|
|
|
proc_macro::TokenStream::new();
|
2018-05-25 15:53:49 -05:00
|
|
|
}
|