]> git.lizzy.rs Git - rust.git/blob - src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
Rollup merge of #57229 - mikeyhew:fix-56806, r=varkor
[rust.git] / src / test / ui / tool-attributes / tool-attributes-misplaced-1.rs
1 #![feature(custom_attribute)]
2
3 type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
4 type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
5
6 #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
7 struct S;
8
9 #[rustfmt] // OK, interpreted as a custom attribute
10 fn check() {}
11
12 #[rustfmt::skip] // OK
13 fn main() {
14     rustfmt; //~ ERROR expected value, found tool module `rustfmt`
15     rustfmt!(); //~ ERROR cannot find macro `rustfmt!` in this scope
16
17     rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip`
18 }