1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![feature(stmt_expr_attributes)]
14 #![warn(unused_attributes)] //~ NOTE lint level defined here
16 fn foo<#[derive(Debug)] T>() { //~ WARN unused attribute
18 #[derive(Debug)] //~ WARN unused attribute
26 #[derive(Debug)] // should not warn
31 //~^ WARN `#[derive]` does nothing on macro invocations
32 //~| NOTE this may become a hard error in a future release
33 println!("Hello, world!");
36 #[derive(Debug)] //~ WARN unused attribute
40 #[derive(Debug)] //~ WARN unused attribute
41 let _ = "Hello, world!";
44 let _ = #[derive(Debug)] "Hello, world!";
45 //~^ WARN unused attribute
49 #[derive(Debug)] //~ WARN unused attribute