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