1 // Copyright 2015 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.
11 // Check that literals in attributes don't parse without the feature gate.
13 // gate-test-attr_literals
15 #![feature(custom_attribute)]
19 //~^ ERROR non-string literals in attributes
21 //~^ ERROR non-string literals in attributes
23 //~^ ERROR string literals in top-level positions, are experimental
24 #[fake_attr(name = "hello")] // OK
25 #[fake_attr(1, "hi", key = 12, true, false)]
26 //~^ ERROR non-string literals in attributes, or string literals in top-level positions
27 #[fake_attr(key = "hello", val = 10)]
28 //~^ ERROR non-string literals in attributes
29 #[fake_attr(key("hello"), val(10))]
30 //~^ ERROR non-string literals in attributes, or string literals in top-level positions
31 #[fake_attr(enabled = true, disabled = false)]
32 //~^ ERROR non-string literals in attributes
34 //~^ ERROR non-string literals in attributes
35 #[fake_attr(pi = 3.14159)]
36 //~^ ERROR non-string literals in attributes
38 //~^ ERROR string literals in top-level positions, are experimental
40 //~^ ERROR string literals in top-level positions, are experimental