diff --git a/src/doc/unstable-book/src/language-features/attr-literals.md b/src/doc/unstable-book/src/language-features/attr-literals.md deleted file mode 100644 index 6606f3c4e5c549c5789863165178cb13b5a1c9a0..0000000000000000000000000000000000000000 --- a/src/doc/unstable-book/src/language-features/attr-literals.md +++ /dev/null @@ -1,30 +0,0 @@ -# `attr_literals` - -The tracking issue for this feature is: [#34981] - -[#34981]: https://github.com/rust-lang/rust/issues/34981 - ------------------------- - -At present, literals are only accepted as the value of a key-value pair in -attributes. What's more, only _string_ literals are accepted. This means that -literals can only appear in forms of `#[attr(name = "value")]` or -`#[attr = "value"]`. - -The `attr_literals` unstable feature allows other types of literals to be used -in attributes. Here are some examples of attributes that can now be used with -this feature enabled: - -```rust,ignore -#[attr] -#[attr(true)] -#[attr(ident)] -#[attr(ident, 100, true, "true", ident = 100, ident = "hello", ident(100))] -#[attr(100)] -#[attr(enabled = true)] -#[enabled(true)] -#[attr("hello")] -#[repr(C, align = 4)] -#[repr(C, align(4))] -``` - diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index c12c7a81f79c8905a3ee3b77f7eb2662919ea488..3a84f9e7e47ba03675da89abf666196db22bcc52 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -10,7 +10,6 @@ #![feature(allocator_api)] #![feature(alloc_system)] -#![feature(attr_literals)] #![feature(box_syntax)] #![feature(const_fn)] #![feature(drain_filter)] diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index e85bf1dfcad23c99116b2cd20497752a2f9991e2..b2ffc9d77d771bcb32f8254fb093e66022105b75 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -77,7 +77,6 @@ #![feature(arbitrary_self_types)] #![feature(asm)] #![feature(associated_type_defaults)] -#![feature(attr_literals)] #![feature(cfg_target_has_atomic)] #![feature(concat_idents)] #![feature(const_fn)] diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index c01102272aeb4e7bc269ac970b14f7666cb9d1d4..cae7b4a2862d6615692809f74fd7e5825abec148 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -4630,7 +4630,7 @@ struct LengthWithUnit { Erroneous code example: ```compile_fail,E0691 -#![feature(repr_align, attr_literals)] +#![feature(repr_align)] #[repr(align(32))] struct ForceAlign32; @@ -4657,7 +4657,7 @@ struct LengthWithUnit { if you need to keep the field for some reason: ``` -#![feature(repr_align, attr_literals)] +#![feature(repr_align)] use std::marker::PhantomData; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index ade297219d221e73867a081517beff74175fafd6..8b4247167461056f0b1a66a4554dafb63482c77d 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -244,7 +244,6 @@ #![feature(arbitrary_self_types)] #![feature(array_error_internals)] #![feature(asm)] -#![feature(attr_literals)] #![feature(box_syntax)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 89af57a085807c74ccfd1702ca7c1a1322783299..23ce7fc6a65681bb10a90238a94410bae474839b 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -213,19 +213,18 @@ struct MyStruct { "##, E0565: r##" -A literal was used in an attribute that doesn't support literals. +A literal was used in a built-in attribute that doesn't support literals. Erroneous code example: ```ignore (compile_fail not working here; see Issue #43707) -#![feature(attr_literals)] - #[inline("always")] // error: unsupported literal pub fn something() {} ``` -Literals in attributes are new and largely unsupported. Work to support literals -where appropriate is ongoing. Try using an unquoted name instead: +Literals in attributes are new and largely unsupported in built-in attributes. +Work to support literals where appropriate is ongoing. Try using an unquoted +name instead: ``` #[inline(always)] diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 1ffb6e55f06e3f249c36d9c187ac60a324be9487..4ed96d269061b7e25ab82cc749034081d16b403e 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -289,9 +289,6 @@ pub fn walk_feature_fields(&self, mut f: F) // Allows exhaustive pattern matching on types that contain uninhabited types (active, exhaustive_patterns, "1.13.0", Some(51085), None), - // Allows all literals in attribute lists and values of key-value pairs - (active, attr_literals, "1.13.0", Some(34981), None), - // Allows untagged unions `union U { ... }` (active, untagged_unions, "1.13.0", Some(32836), None), @@ -654,6 +651,8 @@ pub fn walk_feature_fields(&self, mut f: F) (accepted, tool_attributes, "1.30.0", Some(44690), None), // Allows multi-segment paths in attributes and derives (accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None), + // Allows all literals in attribute lists and values of key-value pairs. + (accepted, attr_literals, "1.30.0", Some(34981), None), ); // If you change this, please modify src/doc/unstable-book as well. You must @@ -1451,22 +1450,6 @@ fn check_abi(&self, abi: Abi, span: Span) { } } -fn contains_novel_literal(item: &ast::MetaItem) -> bool { - use ast::MetaItemKind::*; - use ast::NestedMetaItemKind::*; - - match item.node { - Word => false, - NameValue(ref lit) => !lit.node.is_str(), - List(ref list) => list.iter().any(|li| { - match li.node { - MetaItem(ref mi) => contains_novel_literal(mi), - Literal(_) => true, - } - }), - } -} - impl<'a> PostExpansionVisitor<'a> { fn whole_crate_feature_gates(&mut self, _krate: &ast::Crate) { for &(ident, span) in &*self.context.parse_sess.non_modrs_mods.borrow() { @@ -1526,28 +1509,11 @@ fn visit_attribute(&mut self, attr: &ast::Attribute) { } if !self.context.features.unrestricted_attribute_tokens { - // Unfortunately, `parse_meta` cannot be called speculatively because it can report - // errors by itself, so we have to call it only if the feature is disabled. - match attr.parse_meta(self.context.parse_sess) { - Ok(meta) => { - // allow attr_literals in #[repr(align(x))] and #[repr(packed(n))] - let mut allow_attr_literal = false; - if attr.path == "repr" { - if let Some(content) = meta.meta_item_list() { - allow_attr_literal = content.iter().any( - |c| c.check_name("align") || c.check_name("packed")); - } - } - - if !allow_attr_literal && contains_novel_literal(&meta) { - gate_feature_post!(&self, attr_literals, attr.span, - "non-string literals in attributes, or string \ - literals in top-level positions, are experimental"); - } - } - Err(mut err) => { - err.help("try enabling `#![feature(unrestricted_attribute_tokens)]`").emit() - } + // Unfortunately, `parse_meta` cannot be called speculatively + // because it can report errors by itself, so we have to call it + // only if the feature is disabled. + if let Err(mut err) = attr.parse_meta(self.context.parse_sess) { + err.help("try enabling `#![feature(unrestricted_attribute_tokens)]`").emit() } } } diff --git a/src/test/pretty/attr-literals.rs b/src/test/pretty/attr-literals.rs index ce157e3632c70a5f67f07331e0f9ad23e43fc3a3..73aa31699630c8f1ea8a669db52c4af8557046cf 100644 --- a/src/test/pretty/attr-literals.rs +++ b/src/test/pretty/attr-literals.rs @@ -11,7 +11,7 @@ // pp-exact // Tests literals in attributes. -#![feature(custom_attribute, attr_literals)] +#![feature(custom_attribute)] fn main() { #![hello("hi", 1, 2, 1.012, pi = 3.14, bye, name("John"))] diff --git a/src/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.rs b/src/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.rs index ce552d3ab7dd67ff8ff04d1cef1db678c121a57d..86d7cd54d973949b9f466e213ac09caca29c90f4 100644 --- a/src/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.rs +++ b/src/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.rs @@ -11,7 +11,7 @@ // aux-build:macro_crate_test.rs // ignore-stage1 -#![feature(plugin, rustc_attrs, attr_literals)] +#![feature(plugin, rustc_attrs)] #![plugin(macro_crate_test)] #[macro_use] diff --git a/src/test/run-pass/align-with-extern-c-fn.rs b/src/test/run-pass/align-with-extern-c-fn.rs index 15e3b4b03eb27b0a68e01e4708ed67b81cf76d41..6f89c5d377f54511501a1d12fce65cbee058094e 100644 --- a/src/test/run-pass/align-with-extern-c-fn.rs +++ b/src/test/run-pass/align-with-extern-c-fn.rs @@ -11,7 +11,6 @@ // #45662 #![feature(repr_align)] -#![feature(attr_literals)] #[repr(align(16))] pub struct A(i64); diff --git a/src/test/ui/attr-usage-repr.rs b/src/test/ui/attr-usage-repr.rs index db5cd47fe0efab84bcaab41a373eafeb49516728..437907008777ad2fca85f7b5d998e2586606f320 100644 --- a/src/test/ui/attr-usage-repr.rs +++ b/src/test/ui/attr-usage-repr.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals)] #![feature(repr_simd)] #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union diff --git a/src/test/ui/attr-usage-repr.stderr b/src/test/ui/attr-usage-repr.stderr index 1f3b358545bd6f9dbb275e27407104d36e061498..8d5e49a81f01cfc463e711d357f3a88eac909ba1 100644 --- a/src/test/ui/attr-usage-repr.stderr +++ b/src/test/ui/attr-usage-repr.stderr @@ -1,5 +1,5 @@ error[E0517]: attribute should be applied to struct, enum or union - --> $DIR/attr-usage-repr.rs:14:8 + --> $DIR/attr-usage-repr.rs:13:8 | LL | #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union | ^ @@ -7,7 +7,7 @@ LL | fn f() {} | --------- not a struct, enum or union error[E0517]: attribute should be applied to enum - --> $DIR/attr-usage-repr.rs:26:8 + --> $DIR/attr-usage-repr.rs:25:8 | LL | #[repr(i8)] //~ ERROR: attribute should be applied to enum | ^^ @@ -15,7 +15,7 @@ LL | struct SInt(f64, f64); | ---------------------- not an enum error[E0517]: attribute should be applied to struct or union - --> $DIR/attr-usage-repr.rs:32:8 + --> $DIR/attr-usage-repr.rs:31:8 | LL | #[repr(align(8))] //~ ERROR: attribute should be applied to struct | ^^^^^^^^ @@ -23,7 +23,7 @@ LL | enum EAlign { A, B } | -------------------- not a struct or union error[E0517]: attribute should be applied to struct or union - --> $DIR/attr-usage-repr.rs:35:8 + --> $DIR/attr-usage-repr.rs:34:8 | LL | #[repr(packed)] //~ ERROR: attribute should be applied to struct | ^^^^^^ @@ -31,7 +31,7 @@ LL | enum EPacked { A, B } | --------------------- not a struct or union error[E0517]: attribute should be applied to struct - --> $DIR/attr-usage-repr.rs:38:8 + --> $DIR/attr-usage-repr.rs:37:8 | LL | #[repr(simd)] //~ ERROR: attribute should be applied to struct | ^^^^ diff --git a/src/test/ui/error-codes/E0565-1.rs b/src/test/ui/error-codes/E0565-1.rs index d3e68c7c0daf8613f3c8cd95f184106d4f743654..d7cbb823013244696520876a6ed56379e354066a 100644 --- a/src/test/ui/error-codes/E0565-1.rs +++ b/src/test/ui/error-codes/E0565-1.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals)] - // deprecated doesn't currently support literals #[deprecated("since")] //~ ERROR E0565 fn f() { } diff --git a/src/test/ui/error-codes/E0565-1.stderr b/src/test/ui/error-codes/E0565-1.stderr index 745e79ba2ec04200f74c7165dd4e5b3184e7127c..2a9bf92e9dd48fd7fec8beaaca4e5f7d7539a61a 100644 --- a/src/test/ui/error-codes/E0565-1.stderr +++ b/src/test/ui/error-codes/E0565-1.stderr @@ -1,5 +1,5 @@ error[E0565]: unsupported literal - --> $DIR/E0565-1.rs:14:14 + --> $DIR/E0565-1.rs:12:14 | LL | #[deprecated("since")] //~ ERROR E0565 | ^^^^^^^ diff --git a/src/test/ui/error-codes/E0565.rs b/src/test/ui/error-codes/E0565.rs index b2d369223e7dac02cc76e6871dc5a9d2a999f2a7..af8b10edab8a58fb84abfa3faba8cdb28697e2dc 100644 --- a/src/test/ui/error-codes/E0565.rs +++ b/src/test/ui/error-codes/E0565.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals)] - // repr currently doesn't support literals #[repr("C")] //~ ERROR E0565 struct A { } diff --git a/src/test/ui/error-codes/E0565.stderr b/src/test/ui/error-codes/E0565.stderr index 1d0f34be39bebb88af0f91f5ccbe8013eca41998..abea4290f0a6861999ce0b3b231ff18c68b283d4 100644 --- a/src/test/ui/error-codes/E0565.stderr +++ b/src/test/ui/error-codes/E0565.stderr @@ -1,5 +1,5 @@ error[E0565]: unsupported literal - --> $DIR/E0565.rs:14:8 + --> $DIR/E0565.rs:12:8 | LL | #[repr("C")] //~ ERROR E0565 | ^^^ diff --git a/src/test/ui/feature-gates/feature-gate-custom_attribute.rs b/src/test/ui/feature-gates/feature-gate-custom_attribute.rs index b54288035175d33c9a477d8279841fe374ad1c62..ed8392ad7a3d1841a632fcfb1e8881d6db113807 100644 --- a/src/test/ui/feature-gates/feature-gate-custom_attribute.rs +++ b/src/test/ui/feature-gates/feature-gate-custom_attribute.rs @@ -10,7 +10,7 @@ // Check that literals in attributes parse just fine. -#![feature(rustc_attrs, attr_literals)] +#![feature(rustc_attrs)] #![allow(dead_code)] #![allow(unused_variables)] diff --git a/src/test/ui/gated-attr-literals.rs b/src/test/ui/gated-attr-literals.rs deleted file mode 100644 index 8d36745116b65b3b7e229833e9bd2a8cdcb123d0..0000000000000000000000000000000000000000 --- a/src/test/ui/gated-attr-literals.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Check that literals in attributes don't parse without the feature gate. - -// gate-test-attr_literals - -#![feature(custom_attribute)] - -#[fake_attr] // OK -#[fake_attr(100)] - //~^ ERROR non-string literals in attributes -#[fake_attr(1, 2, 3)] - //~^ ERROR non-string literals in attributes -#[fake_attr("hello")] - //~^ ERROR string literals in top-level positions, are experimental -#[fake_attr(name = "hello")] // OK -#[fake_attr(1, "hi", key = 12, true, false)] - //~^ ERROR non-string literals in attributes, or string literals in top-level positions -#[fake_attr(key = "hello", val = 10)] - //~^ ERROR non-string literals in attributes -#[fake_attr(key("hello"), val(10))] - //~^ ERROR non-string literals in attributes, or string literals in top-level positions -#[fake_attr(enabled = true, disabled = false)] - //~^ ERROR non-string literals in attributes -#[fake_attr(true)] - //~^ ERROR non-string literals in attributes -#[fake_attr(pi = 3.14159)] - //~^ ERROR non-string literals in attributes -#[fake_attr(b"hi")] - //~^ ERROR string literals in top-level positions, are experimental -#[fake_doc(r"doc")] - //~^ ERROR string literals in top-level positions, are experimental -struct Q { } - -fn main() { } diff --git a/src/test/ui/gated-attr-literals.stderr b/src/test/ui/gated-attr-literals.stderr deleted file mode 100644 index e69b6488599f9167c82e31c2f212a2627dc2c7ba..0000000000000000000000000000000000000000 --- a/src/test/ui/gated-attr-literals.stderr +++ /dev/null @@ -1,91 +0,0 @@ -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:18:1 - | -LL | #[fake_attr(100)] - | ^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:20:1 - | -LL | #[fake_attr(1, 2, 3)] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:22:1 - | -LL | #[fake_attr("hello")] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:25:1 - | -LL | #[fake_attr(1, "hi", key = 12, true, false)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:27:1 - | -LL | #[fake_attr(key = "hello", val = 10)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:29:1 - | -LL | #[fake_attr(key("hello"), val(10))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:31:1 - | -LL | #[fake_attr(enabled = true, disabled = false)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:33:1 - | -LL | #[fake_attr(true)] - | ^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:35:1 - | -LL | #[fake_attr(pi = 3.14159)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:37:1 - | -LL | #[fake_attr(b"hi")] - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) - --> $DIR/gated-attr-literals.rs:39:1 - | -LL | #[fake_doc(r"doc")] - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(attr_literals)] to the crate attributes to enable - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issues/issue-43925.rs b/src/test/ui/issues/issue-43925.rs index 8ad576472903b0354614f4b4576c9c2fbd04e5e2..7875c16c0e496a3c03856fd8eb113959e48c603a 100644 --- a/src/test/ui/issues/issue-43925.rs +++ b/src/test/ui/issues/issue-43925.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals)] - #[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)` extern {} diff --git a/src/test/ui/issues/issue-43925.stderr b/src/test/ui/issues/issue-43925.stderr index 995289aec01734fb7ce535e638d094cd8e804ed3..e93ea9c7bc7a52f2f0969db2ae0bcb7d21fc148a 100644 --- a/src/test/ui/issues/issue-43925.stderr +++ b/src/test/ui/issues/issue-43925.stderr @@ -1,5 +1,5 @@ error: invalid argument for `cfg(..)` - --> $DIR/issue-43925.rs:13:24 + --> $DIR/issue-43925.rs:11:24 | LL | #[link(name="foo", cfg("rlib"))] //~ ERROR invalid argument for `cfg(..)` | ^^^^^^ diff --git a/src/test/ui/parser/expected-comma-found-token.rs b/src/test/ui/parser/expected-comma-found-token.rs index 3c53c3acf55c14fea8ed8356cfbaf26fcfb7e43b..f7a632dfaa1a012f744c9b2b3224a2571ded2c4d 100644 --- a/src/test/ui/parser/expected-comma-found-token.rs +++ b/src/test/ui/parser/expected-comma-found-token.rs @@ -20,3 +20,5 @@ )] trait T {} //~^^^ ERROR expected one of `)` or `,`, found `label` + +fn main() { } diff --git a/src/test/ui/repr/repr-transparent-other-reprs.rs b/src/test/ui/repr/repr-transparent-other-reprs.rs index a391c0ae1f82ef5c29deaf083ca82c0a00a517a1..fa5f1a2f7fb80f1614f7d84c86d24265a058aa5c 100644 --- a/src/test/ui/repr/repr-transparent-other-reprs.rs +++ b/src/test/ui/repr/repr-transparent-other-reprs.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(repr_align, attr_literals)] +#![feature(repr_align)] // See also repr-transparent.rs diff --git a/src/test/ui/repr/repr-transparent.rs b/src/test/ui/repr/repr-transparent.rs index 4d8ec4cdb407c6ff1b17ce82901f47624563b2f1..230573247316edeee5186d10bdf80ea8923b5874 100644 --- a/src/test/ui/repr/repr-transparent.rs +++ b/src/test/ui/repr/repr-transparent.rs @@ -13,7 +13,7 @@ // - repr-transparent-other-reprs.rs // - repr-transparent-other-items.rs -#![feature(repr_align, attr_literals)] +#![feature(repr_align)] use std::marker::PhantomData; diff --git a/src/test/ui/rustc-args-required-const.rs b/src/test/ui/rustc-args-required-const.rs index aac9299eaafb9d91b256f4cd33363daf8173510d..35b43b4c460a428165b4613d94001a227185eb8f 100644 --- a/src/test/ui/rustc-args-required-const.rs +++ b/src/test/ui/rustc-args-required-const.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals, rustc_attrs, const_fn)] +#![feature(rustc_attrs, const_fn)] #[rustc_args_required_const(0)] fn foo(_a: i32) { diff --git a/src/test/ui/rustc-args-required-const2.rs b/src/test/ui/rustc-args-required-const2.rs index aa63019307b5b0ff920d1e22bd53cd6eeb57106b..c4ca5a0ca5c5d68afecb3f66c2f75cedcfb7c915 100644 --- a/src/test/ui/rustc-args-required-const2.rs +++ b/src/test/ui/rustc-args-required-const2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals, rustc_attrs, const_fn)] +#![feature(rustc_attrs, const_fn)] #[rustc_args_required_const(0)] fn foo(_a: i32) { diff --git a/src/test/ui/suffixed-literal-meta.rs b/src/test/ui/suffixed-literal-meta.rs index bf55b7bdcb1def55da516ae84240abe19d0b3876..2e6c3994159cf82864ccd95925d35ecdf13777f4 100644 --- a/src/test/ui/suffixed-literal-meta.rs +++ b/src/test/ui/suffixed-literal-meta.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(attr_literals)] - #[path = 1usize] //~ ERROR: suffixed literals are not allowed in attributes #[path = 1u8] //~ ERROR: suffixed literals are not allowed in attributes #[path = 1u16] //~ ERROR: suffixed literals are not allowed in attributes diff --git a/src/test/ui/suffixed-literal-meta.stderr b/src/test/ui/suffixed-literal-meta.stderr index 6d88ab1df16b47de6c0d8825ae46a57550eb3430..53ff60b0705e16ccefff7dd2d3f6809cb9f3722a 100644 --- a/src/test/ui/suffixed-literal-meta.stderr +++ b/src/test/ui/suffixed-literal-meta.stderr @@ -1,5 +1,5 @@ error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:13:10 + --> $DIR/suffixed-literal-meta.rs:11:10 | LL | #[path = 1usize] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^^^ @@ -7,7 +7,7 @@ LL | #[path = 1usize] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:14:10 + --> $DIR/suffixed-literal-meta.rs:12:10 | LL | #[path = 1u8] //~ ERROR: suffixed literals are not allowed in attributes | ^^^ @@ -15,7 +15,7 @@ LL | #[path = 1u8] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:15:10 + --> $DIR/suffixed-literal-meta.rs:13:10 | LL | #[path = 1u16] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -23,7 +23,7 @@ LL | #[path = 1u16] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:16:10 + --> $DIR/suffixed-literal-meta.rs:14:10 | LL | #[path = 1u32] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -31,7 +31,7 @@ LL | #[path = 1u32] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:17:10 + --> $DIR/suffixed-literal-meta.rs:15:10 | LL | #[path = 1u64] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -39,7 +39,7 @@ LL | #[path = 1u64] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:18:10 + --> $DIR/suffixed-literal-meta.rs:16:10 | LL | #[path = 1isize] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^^^ @@ -47,7 +47,7 @@ LL | #[path = 1isize] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:19:10 + --> $DIR/suffixed-literal-meta.rs:17:10 | LL | #[path = 1i8] //~ ERROR: suffixed literals are not allowed in attributes | ^^^ @@ -55,7 +55,7 @@ LL | #[path = 1i8] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:20:10 + --> $DIR/suffixed-literal-meta.rs:18:10 | LL | #[path = 1i16] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -63,7 +63,7 @@ LL | #[path = 1i16] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:21:10 + --> $DIR/suffixed-literal-meta.rs:19:10 | LL | #[path = 1i32] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -71,7 +71,7 @@ LL | #[path = 1i32] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:22:10 + --> $DIR/suffixed-literal-meta.rs:20:10 | LL | #[path = 1i64] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^ @@ -79,7 +79,7 @@ LL | #[path = 1i64] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:23:10 + --> $DIR/suffixed-literal-meta.rs:21:10 | LL | #[path = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^^^ @@ -87,7 +87,7 @@ LL | #[path = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:24:10 + --> $DIR/suffixed-literal-meta.rs:22:10 | LL | #[path = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes | ^^^^^^