diff options
| author | Sergio Benitez <sb@sergio.bz> | 2016-08-19 18:58:14 -0700 |
|---|---|---|
| committer | Sergio Benitez <sb@sergio.bz> | 2016-08-25 13:25:22 -0700 |
| commit | 8250a26b5bcea9190ac63e756c35d8a54bf9da0c (patch) | |
| tree | f95baa037c52c307de53d605ad752afd4880ffa4 /src/test/parse-fail | |
| parent | 528c6f3ed6a23a374dc5a40582d1bea2f2cfda65 (diff) | |
| download | rust-8250a26b5bcea9190ac63e756c35d8a54bf9da0c.tar.gz rust-8250a26b5bcea9190ac63e756c35d8a54bf9da0c.zip | |
Implement RFC#1559: allow all literals in attributes.
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/non-str-meta.rs | 17 | ||||
| -rw-r--r-- | src/test/parse-fail/suffixed-literal-meta.rs | 25 |
2 files changed, 25 insertions, 17 deletions
diff --git a/src/test/parse-fail/non-str-meta.rs b/src/test/parse-fail/non-str-meta.rs deleted file mode 100644 index 3e2e69d2814..00000000000 --- a/src/test/parse-fail/non-str-meta.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -// Issue #623 - non-string meta items are not serialized correctly; -// for now just forbid them - -#[foo = 1] //~ ERROR: non-string literals are not allowed in meta-items -fn main() { } diff --git a/src/test/parse-fail/suffixed-literal-meta.rs b/src/test/parse-fail/suffixed-literal-meta.rs new file mode 100644 index 00000000000..0e2840c69d3 --- /dev/null +++ b/src/test/parse-fail/suffixed-literal-meta.rs @@ -0,0 +1,25 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +#[foo = 1usize] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1u8] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1u16] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1u32] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1u64] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1isize] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1i8] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1i16] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1i32] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1i64] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes +#[foo = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes +fn main() { } |
