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