resolve: Prohibit use of imported non-macro attributes

This commit is contained in:
Vadim Petrochenkov 2018-12-12 04:11:46 +03:00
parent e1d1487fc4
commit bf1e70cd1f
5 changed files with 42 additions and 6 deletions

View file

@ -0,0 +1,9 @@
// edition:2018
#![feature(uniform_paths)]
// Built-in attribute
use inline as imported_inline;
#[imported_inline] //~ ERROR cannot use a built-in attribute through an import
fn main() {}

View file

@ -0,0 +1,14 @@
error: cannot use a built-in attribute through an import
--> $DIR/prelude-fail-2.rs:8:3
|
LL | #[imported_inline] //~ ERROR cannot use a built-in attribute through an import
| ^^^^^^^^^^^^^^^
|
note: the built-in attribute imported here
--> $DIR/prelude-fail-2.rs:6:5
|
LL | use inline as imported_inline;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -6,9 +6,6 @@
// Macro imported with `#[macro_use] extern crate`
use vec as imported_vec;
// Built-in attribute
use inline as imported_inline;
// Tool module
use rustfmt as imported_rustfmt;
@ -20,7 +17,6 @@ use u8 as imported_u8;
type A = imported_u8;
#[imported_inline]
#[imported_rustfmt::skip]
fn main() {
imported_vec![0];