diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 4bc52e82f9be1..287a45a21eadf 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -1180,27 +1180,6 @@ fn main() { ``` "##, -E0296: r##" -This error indicates that the given recursion limit could not be parsed. Ensure -that the value provided is a positive integer between quotes. - -Erroneous code example: - -```compile_fail,E0296 -#![recursion_limit] - -fn main() {} -``` - -And a working example: - -``` -#![recursion_limit="1000"] - -fn main() {} -``` -"##, - E0308: r##" This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -2093,20 +2072,6 @@ trait Foo { } ``` "##, -E0702: r##" -This error indicates that a `#[non_exhaustive]` attribute had a value. The -`#[non_exhaustive]` should be empty. - -Examples of erroneous code: - -```compile_fail,E0702 -# #![feature(non_exhaustive)] - -#[non_exhaustive(anything)] -struct Foo; -``` -"##, - E0718: r##" This error indicates that a `#[lang = ".."]` attribute was placed on the wrong type of item. @@ -2138,6 +2103,7 @@ register_diagnostics! { E0280, // requirement is not satisfied E0284, // cannot resolve type // E0285, // overflow evaluation builtin bounds +// E0296, // replaced with a generic attribute input check // E0300, // unexpanded macro // E0304, // expected signed integer constant // E0305, // expected constant @@ -2180,4 +2146,5 @@ register_diagnostics! { E0709, // multiple different lifetimes used in arguments of `async fn` E0710, // an unknown tool name found in scoped lint E0711, // a feature has been declared with conflicting stability attributes +// E0702, // replaced with a generic attribute input check } diff --git a/src/librustc/hir/check_attr.rs b/src/librustc/hir/check_attr.rs index 2e0e9672758fd..6792427fb1e2e 100644 --- a/src/librustc/hir/check_attr.rs +++ b/src/librustc/hir/check_attr.rs @@ -137,15 +137,6 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> { return; } } - - if attr.meta_item_list().is_some() || attr.value_str().is_some() { - struct_span_err!(self.tcx.sess, - attr.span, - E0702, - "attribute should be empty") - .span_label(item.span, "not empty") - .emit(); - } } /// Check if the `#[marker]` attribute on an `item` is valid. @@ -160,12 +151,6 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> { return; } } - - if !attr.is_word() { - self.tcx.sess - .struct_span_err(attr.span, "attribute should be empty") - .emit(); - } } /// Check if the `#[repr]` attributes on `item` are valid. diff --git a/src/librustc/lint/levels.rs b/src/librustc/lint/levels.rs index 1ae12fec50661..793f4e25960cf 100644 --- a/src/librustc/lint/levels.rs +++ b/src/librustc/lint/levels.rs @@ -204,8 +204,6 @@ impl<'a> LintLevelsBuilder<'a> { let mut metas = if let Some(metas) = meta.meta_item_list() { metas } else { - let mut err = bad_attr(meta.span); - err.emit(); continue; }; diff --git a/src/librustc/middle/recursion_limit.rs b/src/librustc/middle/recursion_limit.rs index ea83432a80184..1eabd7f59e689 100644 --- a/src/librustc/middle/recursion_limit.rs +++ b/src/librustc/middle/recursion_limit.rs @@ -11,14 +11,11 @@ use syntax::ast; use rustc_data_structures::sync::Once; pub fn update_limits(sess: &Session, krate: &ast::Crate) { - update_limit(sess, krate, &sess.recursion_limit, "recursion_limit", - "recursion limit", 64); - update_limit(sess, krate, &sess.type_length_limit, "type_length_limit", - "type length limit", 1048576); + update_limit(krate, &sess.recursion_limit, "recursion_limit", 64); + update_limit(krate, &sess.type_length_limit, "type_length_limit", 1048576); } -fn update_limit(sess: &Session, krate: &ast::Crate, limit: &Once, - name: &str, description: &str, default: usize) { +fn update_limit(krate: &ast::Crate, limit: &Once, name: &str, default: usize) { for attr in &krate.attrs { if !attr.check_name(name) { continue; @@ -30,10 +27,6 @@ fn update_limit(sess: &Session, krate: &ast::Crate, limit: &Once, return; } } - - span_err!(sess, attr.span, E0296, - "malformed {} attribute, expected #![{}=\"N\"]", - description, name); } limit.set(default); } diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs index 4b188d2517511..3ec901f50e4cc 100644 --- a/src/librustc/traits/on_unimplemented.rs +++ b/src/librustc/traits/on_unimplemented.rs @@ -157,10 +157,7 @@ impl<'a, 'gcx, 'tcx> OnUnimplementedDirective { note: None, })) } else { - return Err(parse_error(tcx, attr.span, - "`#[rustc_on_unimplemented]` requires a value", - "value required here", - Some(r#"eg `#[rustc_on_unimplemented(message="foo")]`"#))); + return Err(ErrorReported); }; debug!("of_item({:?}/{:?}) = {:?}", trait_def_id, impl_def_id, result); result diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index d40dd830e9fb9..8768d3c5034e8 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2801,7 +2801,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { self.impl_polarity(def_id1) == self.impl_polarity(def_id2) && trait1_is_empty && trait2_is_empty - } else if self.features().marker_trait_attr { + } else { let is_marker_impl = |def_id: DefId| -> bool { let trait_ref = self.impl_trait_ref(def_id); trait_ref.map_or(false, |tr| self.trait_def(tr.def_id).is_marker) @@ -2809,8 +2809,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { self.impl_polarity(def_id1) == self.impl_polarity(def_id2) && is_marker_impl(def_id1) && is_marker_impl(def_id2) - } else { - false } } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 9b232edc11d4a..1111b198f6326 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -1101,23 +1101,20 @@ where ast_validation::check_crate(sess, &krate) }); - time(sess, "name resolution", || -> CompileResult { + time(sess, "name resolution", || { resolver.resolve_crate(&krate); - Ok(()) - })?; + }); // Needs to go *after* expansion to be able to check the results of macro expansion. time(sess, "complete gated feature checking", || { - sess.track_errors(|| { - syntax::feature_gate::check_crate( - &krate, - &sess.parse_sess, - &sess.features_untracked(), - &attributes, - sess.opts.unstable_features, - ); - }) - })?; + syntax::feature_gate::check_crate( + &krate, + &sess.parse_sess, + &sess.features_untracked(), + &attributes, + sess.opts.unstable_features, + ); + }); // Lower ast -> hir. // First, we need to collect the dep_graph. @@ -1530,13 +1527,7 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec { - session - .struct_span_err(a.span, "`crate_type` requires a value") - .note("for example: `#![crate_type=\"lib\"]`") - .emit(); - None - } + None => None } } else { None diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 27b65b4ec48a4..471b4d0768fbe 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -35,7 +35,8 @@ use syntax::ast::Expr; use syntax::attr; use syntax::source_map::Spanned; use syntax::edition::Edition; -use syntax::feature_gate::{AttributeGate, AttributeType, Stability, deprecated_attributes}; +use syntax::feature_gate::{AttributeGate, AttributeMeta, AttributeType}; +use syntax::feature_gate::{Stability, deprecated_attributes}; use syntax_pos::{BytePos, Span, SyntaxContext}; use syntax::symbol::keywords; use syntax::errors::{Applicability, DiagnosticBuilder}; @@ -752,7 +753,7 @@ impl EarlyLintPass for BadRepr { pub struct DeprecatedAttr { // This is not free to compute, so we want to keep it around, rather than // compute it for every attribute. - depr_attrs: Vec<&'static (&'static str, AttributeType, AttributeGate)>, + depr_attrs: Vec<&'static (&'static str, AttributeType, AttributeMeta::Type, AttributeGate)>, } impl DeprecatedAttr { @@ -771,7 +772,7 @@ impl LintPass for DeprecatedAttr { impl EarlyLintPass for DeprecatedAttr { fn check_attribute(&mut self, cx: &EarlyContext, attr: &ast::Attribute) { - for &&(n, _, ref g) in &self.depr_attrs { + for &&(n, _, _, ref g) in &self.depr_attrs { if attr.name() == n { if let &AttributeGate::Gated(Stability::Deprecated(link, suggestion), ref name, diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 205f8941d1ee2..5d63942087c2c 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -232,7 +232,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes { fn check_attribute(&mut self, cx: &LateContext, attr: &ast::Attribute) { debug!("checking attribute: {:?}", attr); // Note that check_name() marks the attribute as used if it matches. - for &(ref name, ty, _) in BUILTIN_ATTRIBUTES { + for &(ref name, ty, ..) in BUILTIN_ATTRIBUTES { match ty { AttributeType::Whitelisted if attr.check_name(name) => { debug!("{:?} is Whitelisted", name); @@ -256,7 +256,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes { cx.span_lint(UNUSED_ATTRIBUTES, attr.span, "unused attribute"); // Is it a builtin attribute that must be used at the crate level? let known_crate = BUILTIN_ATTRIBUTES.iter() - .find(|&&(builtin, ty, _)| name == builtin && ty == AttributeType::CrateLevel) + .find(|&&(builtin, ty, ..)| name == builtin && ty == AttributeType::CrateLevel) .is_some(); // Has a plugin registered this attribute as one that must be used at diff --git a/src/librustc_plugin/load.rs b/src/librustc_plugin/load.rs index 9e7839ef0c4d1..39f580420cf03 100644 --- a/src/librustc_plugin/load.rs +++ b/src/librustc_plugin/load.rs @@ -50,10 +50,7 @@ pub fn load_plugins(sess: &Session, let plugins = match attr.meta_item_list() { Some(xs) => xs, - None => { - call_malformed_plugin_attribute(sess, attr.span); - continue; - } + None => continue, }; for plugin in plugins { diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 9fc2f11b19738..9c4279639bcae 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -2134,12 +2134,7 @@ fn from_target_feature( ) { let list = match attr.meta_item_list() { Some(list) => list, - None => { - let msg = "#[target_feature] attribute must be of the form \ - #[target_feature(..)]"; - tcx.sess.span_err(attr.span, &msg); - return; - } + None => return, }; let rust_features = tcx.features(); for item in list { @@ -2337,14 +2332,6 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen ).emit(); } codegen_fn_attrs.export_name = Some(s); - } else { - struct_span_err!( - tcx.sess, - attr.span, - E0558, - "`export_name` attribute has invalid format" - ).span_label(attr.span, "did you mean #[export_name=\"*\"]?") - .emit(); } } else if attr.check_name("target_feature") { if tcx.fn_sig(id).unsafety() == Unsafety::Normal { diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 5910a8b3110d0..696e6ed85c123 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -3785,29 +3785,6 @@ For more information about the inline attribute, https: read://doc.rust-lang.org/reference.html#inline-attributes "##, -E0558: r##" -The `export_name` attribute was malformed. - -Erroneous code example: - -```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail) -#[export_name] // error: `export_name` attribute has invalid format -pub fn something() {} - -fn main() {} -``` - -The `export_name` attribute expects a string in order to determine the name of -the exported symbol. Example: - -``` -#[export_name = "some_function"] // ok! -pub fn something() {} - -fn main() {} -``` -"##, - E0559: r##" An unknown field was specified into an enum's structure variant. @@ -4881,6 +4858,7 @@ register_diagnostics! { // E0372, // coherence not object safe E0377, // the trait `CoerceUnsized` may only be implemented for a coercion // between structures with the same definition +// E0558, // replaced with a generic attribute input check E0533, // `{}` does not name a unit variant, unit struct or a constant // E0563, // cannot determine a type for this `impl Trait`: {} // removed in 6383de15 E0564, // only named lifetimes are allowed in `impl Trait`, diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 98585dc1e6f50..15e480496f7a8 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -436,9 +436,6 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, } _ => unreachable!() } - } else { - span_err!(diagnostic, attr.span(), E0548, "incorrect stability attribute type"); - continue } } diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 9eebbedc0bc8c..65326a4ea4401 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -187,12 +187,9 @@ impl<'a> StripUnconfigured<'a> { true }; - let meta_item = if let Some(meta_item) = attr.meta() { - meta_item - } else { - // Not a well-formed meta-item. Why? We don't know. - return error(attr.span, "`cfg` is not a well-formed meta-item", - "#[cfg(/* predicate */)]"); + let meta_item = match attr.parse_meta(self.sess) { + Ok(meta_item) => meta_item, + Err(mut err) => { err.emit(); return true; } }; let nested_meta_items = if let Some(nested_meta_items) = meta_item.meta_item_list() { nested_meta_items diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 548bf8b7f8a80..2c367f1f40242 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -389,12 +389,12 @@ register_diagnostics! { E0545, // incorrect 'issue' E0546, // missing 'feature' E0547, // missing 'issue' - E0548, // incorrect stability attribute type +// E0548, // replaced with a generic attribute input check E0549, // rustc_deprecated attribute must be paired with either stable or unstable attribute E0550, // multiple deprecated attributes E0551, // incorrect meta item E0553, // multiple rustc_const_unstable attributes - E0555, // malformed feature attribute, expected #![feature(...)] +// E0555, // replaced with a generic attribute input check E0556, // malformed feature, expected just one word E0584, // file for module `..` found at both .. and .. E0629, // missing 'feature' (rustc_const_unstable) diff --git a/src/libsyntax/ext/derive.rs b/src/libsyntax/ext/derive.rs index d5a51bc170338..653d55ef0fc77 100644 --- a/src/libsyntax/ext/derive.rs +++ b/src/libsyntax/ext/derive.rs @@ -15,6 +15,10 @@ pub fn collect_derives(cx: &mut ExtCtxt, attrs: &mut Vec) -> Vec if attr.path != "derive" { return true; } + if !attr.is_meta_item_list() { + cx.span_err(attr.span, "attribute must be of the form `#[derive(...)]`"); + return false; + } match attr.parse_list(cx.parse_sess, |parser| parser.parse_path_allowing_meta(PathStyle::Mod)) { diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 3f2122e24a642..0ac6b27cedd23 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -24,8 +24,9 @@ use edition::{ALL_EDITIONS, Edition}; use syntax_pos::{Span, DUMMY_SP}; use errors::{DiagnosticBuilder, Handler}; use visit::{self, FnKind, Visitor}; -use parse::ParseSess; +use parse::{token, ParseSess}; use symbol::{keywords, Symbol}; +use tokenstream::TokenTree; use std::{env}; @@ -440,9 +441,6 @@ declare_features! ( // Added for testing E0705; perma-unstable. (active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)), - // support for arbitrary delimited token streams in non-macro attributes - (active, unrestricted_attribute_tokens, "1.30.0", Some(55208), None), - // Allows `use x::y;` to resolve through `self::x`, not just `::x`. (active, uniform_paths, "1.30.0", Some(53130), None), @@ -686,6 +684,8 @@ declare_features! ( (accepted, repr_packed, "1.33.0", Some(33158), None), // Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions. (accepted, min_const_unsafe_fn, "1.33.0", Some(55607), None), + // support for arbitrary delimited token streams in non-macro attributes + (accepted, unrestricted_attribute_tokens, "1.33.0", Some(55208), None), ); // If you change this, please modify `src/doc/unstable-book` as well. You must @@ -716,6 +716,18 @@ pub enum AttributeGate { Ungated, } +// Can't use `bitflags!`, its generated methods are not constant. +#[allow(bad_style)] +pub mod AttributeMeta { + pub type Type = u8; + pub const Word: Type = 1 << 0; + pub const List: Type = 1 << 1; + pub const NameValueStr: Type = 1 << 2; + // Some special attributes like `cfg` must be checked + // before the generic check, so we skip them here. + pub const Skip: Type = 1 << 3; +} + impl AttributeGate { fn is_deprecated(&self) -> bool { match *self { @@ -753,225 +765,227 @@ macro_rules! cfg_fn { }} } -pub fn deprecated_attributes() -> Vec<&'static (&'static str, AttributeType, AttributeGate)> { - BUILTIN_ATTRIBUTES.iter().filter(|a| a.2.is_deprecated()).collect() +pub fn deprecated_attributes() -> Vec<&'static (&'static str, AttributeType, + AttributeMeta::Type, AttributeGate)> { + BUILTIN_ATTRIBUTES.iter().filter(|(.., gate)| gate.is_deprecated()).collect() } pub fn is_builtin_attr_name(name: ast::Name) -> bool { - BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| name == builtin_name) + BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, ..)| name == builtin_name) } pub fn is_builtin_attr(attr: &ast::Attribute) -> bool { - BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.path == builtin_name) + BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, ..)| attr.path == builtin_name) } // Attributes that have a special meaning to rustc or rustdoc -pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ +pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeMeta::Type, AttributeGate)] = &[ // Normal attributes - ("warn", Normal, Ungated), - ("allow", Normal, Ungated), - ("forbid", Normal, Ungated), - ("deny", Normal, Ungated), - - ("macro_use", Normal, Ungated), - ("macro_export", Normal, Ungated), - ("plugin_registrar", Normal, Ungated), - - ("cfg", Normal, Ungated), - ("cfg_attr", Normal, Ungated), - ("main", Normal, Ungated), - ("start", Normal, Ungated), - ("repr", Normal, Ungated), - ("path", Normal, Ungated), - ("abi", Normal, Ungated), - ("automatically_derived", Normal, Ungated), - ("no_mangle", Normal, Ungated), - ("no_link", Normal, Ungated), - ("derive", Normal, Ungated), - ("should_panic", Normal, Ungated), - ("ignore", Normal, Ungated), - ("no_implicit_prelude", Normal, Ungated), - ("reexport_test_harness_main", Normal, Ungated), - ("link_args", Normal, Gated(Stability::Unstable, + ("warn", Normal, AttributeMeta::List, Ungated), + ("allow", Normal, AttributeMeta::List, Ungated), + ("forbid", Normal, AttributeMeta::List, Ungated), + ("deny", Normal, AttributeMeta::List, Ungated), + + ("macro_use", Normal, AttributeMeta::Word | AttributeMeta::List, Ungated), + ("macro_export", Normal, AttributeMeta::Word | AttributeMeta::List, Ungated), + ("plugin_registrar", Normal, AttributeMeta::Word, Ungated), + + ("cfg", Normal, AttributeMeta::List | AttributeMeta::Skip, Ungated), + ("cfg_attr", Normal, AttributeMeta::List, Ungated), + ("main", Normal, AttributeMeta::Word, Ungated), + ("start", Normal, AttributeMeta::Word, Ungated), + ("repr", Normal, AttributeMeta::List, Ungated), + ("path", Normal, AttributeMeta::NameValueStr, Ungated), + ("automatically_derived", Normal, AttributeMeta::Word, Ungated), + ("no_mangle", Normal, AttributeMeta::Word, Ungated), + ("no_link", Normal, AttributeMeta::Word, Ungated), + ("derive", Normal, AttributeMeta::List, Ungated), + ("should_panic", Normal, AttributeMeta::Word | AttributeMeta::List, Ungated), + ("ignore", Normal, AttributeMeta::Word, Ungated), + ("no_implicit_prelude", Normal, AttributeMeta::Word, Ungated), + ("reexport_test_harness_main", Normal, AttributeMeta::NameValueStr, Ungated), + ("link_args", Normal, AttributeMeta::NameValueStr, Gated(Stability::Unstable, "link_args", "the `link_args` attribute is experimental and not \ portable across platforms, it is recommended to \ use `#[link(name = \"foo\")] instead", cfg_fn!(link_args))), - ("macro_escape", Normal, Ungated), + ("macro_escape", Normal, AttributeMeta::Word, Ungated), // RFC #1445. - ("structural_match", Whitelisted, Gated(Stability::Unstable, + ("structural_match", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "structural_match", "the semantics of constant patterns is \ not yet settled", cfg_fn!(structural_match))), // RFC #2008 - ("non_exhaustive", Whitelisted, Gated(Stability::Unstable, + ("non_exhaustive", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "non_exhaustive", "non exhaustive is an experimental feature", cfg_fn!(non_exhaustive))), // RFC #1268 - ("marker", Normal, Gated(Stability::Unstable, + ("marker", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "marker_trait_attr", "marker traits is an experimental feature", cfg_fn!(marker_trait_attr))), - ("plugin", CrateLevel, Gated(Stability::Unstable, + ("plugin", CrateLevel, AttributeMeta::List, Gated(Stability::Unstable, "plugin", "compiler plugins are experimental \ and possibly buggy", cfg_fn!(plugin))), - ("no_std", CrateLevel, Ungated), - ("no_core", CrateLevel, Gated(Stability::Unstable, + ("no_std", CrateLevel, AttributeMeta::Word, Ungated), + ("no_core", CrateLevel, AttributeMeta::Word, Gated(Stability::Unstable, "no_core", "no_core is experimental", cfg_fn!(no_core))), - ("lang", Normal, Gated(Stability::Unstable, + ("lang", Normal, AttributeMeta::NameValueStr, Gated(Stability::Unstable, "lang_items", "language items are subject to change", cfg_fn!(lang_items))), - ("linkage", Whitelisted, Gated(Stability::Unstable, + ("linkage", Whitelisted, AttributeMeta::NameValueStr, Gated(Stability::Unstable, "linkage", "the `linkage` attribute is experimental \ and not portable across platforms", cfg_fn!(linkage))), - ("thread_local", Whitelisted, Gated(Stability::Unstable, + ("thread_local", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "thread_local", "`#[thread_local]` is an experimental feature, and does \ not currently handle destructors.", cfg_fn!(thread_local))), - ("rustc_on_unimplemented", Normal, Gated(Stability::Unstable, + ("rustc_on_unimplemented", Normal, AttributeMeta::List | AttributeMeta::NameValueStr, + Gated(Stability::Unstable, "on_unimplemented", "the `#[rustc_on_unimplemented]` attribute \ is an experimental feature", cfg_fn!(on_unimplemented))), - ("rustc_const_unstable", Normal, Gated(Stability::Unstable, + ("rustc_const_unstable", Normal, AttributeMeta::List, Gated(Stability::Unstable, "rustc_const_unstable", "the `#[rustc_const_unstable]` attribute \ is an internal feature", cfg_fn!(rustc_const_unstable))), - ("global_allocator", Normal, Ungated), - ("default_lib_allocator", Whitelisted, Gated(Stability::Unstable, + ("global_allocator", Normal, AttributeMeta::Word, Ungated), + ("default_lib_allocator", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "allocator_internals", "the `#[default_lib_allocator]` \ attribute is an experimental feature", cfg_fn!(allocator_internals))), - ("needs_allocator", Normal, Gated(Stability::Unstable, + ("needs_allocator", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "allocator_internals", "the `#[needs_allocator]` \ attribute is an experimental \ feature", cfg_fn!(allocator_internals))), - ("panic_runtime", Whitelisted, Gated(Stability::Unstable, + ("panic_runtime", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "panic_runtime", "the `#[panic_runtime]` attribute is \ an experimental feature", cfg_fn!(panic_runtime))), - ("needs_panic_runtime", Whitelisted, Gated(Stability::Unstable, + ("needs_panic_runtime", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "needs_panic_runtime", "the `#[needs_panic_runtime]` \ attribute is an experimental \ feature", cfg_fn!(needs_panic_runtime))), - ("rustc_outlives", Normal, Gated(Stability::Unstable, + ("rustc_outlives", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_outlives]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_variance", Normal, Gated(Stability::Unstable, + ("rustc_variance", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_variance]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_regions", Normal, Gated(Stability::Unstable, + ("rustc_regions", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_regions]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_error", Whitelisted, Gated(Stability::Unstable, + ("rustc_error", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_error]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_dump_user_substs", Whitelisted, Gated(Stability::Unstable, + ("rustc_dump_user_substs", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_if_this_changed", Whitelisted, Gated(Stability::Unstable, + ("rustc_if_this_changed", Whitelisted, AttributeMeta::Word | AttributeMeta::List, + Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_if_this_changed]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_then_this_would_need", Whitelisted, Gated(Stability::Unstable, + ("rustc_then_this_would_need", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_if_this_changed]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_dirty", Whitelisted, Gated(Stability::Unstable, + ("rustc_dirty", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_dirty]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_clean", Whitelisted, Gated(Stability::Unstable, + ("rustc_clean", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_clean]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_partition_reused", Whitelisted, Gated(Stability::Unstable, + ("rustc_partition_reused", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_partition_codegened", Whitelisted, Gated(Stability::Unstable, + ("rustc_partition_codegened", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_expected_cgu_reuse", Whitelisted, Gated(Stability::Unstable, + ("rustc_expected_cgu_reuse", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_synthetic", Whitelisted, Gated(Stability::Unstable, + ("rustc_synthetic", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "this attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_symbol_name", Whitelisted, Gated(Stability::Unstable, + ("rustc_symbol_name", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "internal rustc attributes will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_item_path", Whitelisted, Gated(Stability::Unstable, + ("rustc_item_path", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "internal rustc attributes will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_mir", Whitelisted, Gated(Stability::Unstable, + ("rustc_mir", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_mir]` attribute \ is just used for rustc unit tests \ and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_inherit_overflow_checks", Whitelisted, Gated(Stability::Unstable, + ("rustc_inherit_overflow_checks", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_inherit_overflow_checks]` \ attribute is just used to control \ @@ -980,41 +994,35 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ across crates and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_dump_program_clauses", Whitelisted, Gated(Stability::Unstable, + ("rustc_dump_program_clauses", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_dump_program_clauses]` \ attribute is just used for rustc unit \ tests and will never be stable", cfg_fn!(rustc_attrs))), - ("rustc_test_marker", Normal, Gated(Stability::Unstable, + ("rustc_test_marker", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "the `#[rustc_test_marker]` attribute \ is used internally to track tests", cfg_fn!(rustc_attrs))), - ("rustc_transparent_macro", Whitelisted, Gated(Stability::Unstable, + ("rustc_transparent_macro", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "used internally for testing macro hygiene", cfg_fn!(rustc_attrs))), - - // RFC #2094 - ("nll", Whitelisted, Gated(Stability::Unstable, - "nll", - "Non lexical lifetimes", - cfg_fn!(nll))), - ("compiler_builtins", Whitelisted, Gated(Stability::Unstable, + ("compiler_builtins", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "compiler_builtins", "the `#[compiler_builtins]` attribute is used to \ identify the `compiler_builtins` crate which \ contains compiler-rt intrinsics and will never be \ stable", cfg_fn!(compiler_builtins))), - ("sanitizer_runtime", Whitelisted, Gated(Stability::Unstable, + ("sanitizer_runtime", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "sanitizer_runtime", "the `#[sanitizer_runtime]` attribute is used to \ identify crates that contain the runtime of a \ sanitizer and will never be stable", cfg_fn!(sanitizer_runtime))), - ("profiler_runtime", Whitelisted, Gated(Stability::Unstable, + ("profiler_runtime", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "profiler_runtime", "the `#[profiler_runtime]` attribute is used to \ identify the `profiler_builtins` crate which \ @@ -1022,55 +1030,55 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ stable", cfg_fn!(profiler_runtime))), - ("allow_internal_unstable", Normal, Gated(Stability::Unstable, + ("allow_internal_unstable", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "allow_internal_unstable", EXPLAIN_ALLOW_INTERNAL_UNSTABLE, cfg_fn!(allow_internal_unstable))), - ("allow_internal_unsafe", Normal, Gated(Stability::Unstable, + ("allow_internal_unsafe", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "allow_internal_unsafe", EXPLAIN_ALLOW_INTERNAL_UNSAFE, cfg_fn!(allow_internal_unsafe))), - ("fundamental", Whitelisted, Gated(Stability::Unstable, + ("fundamental", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "fundamental", "the `#[fundamental]` attribute \ is an experimental feature", cfg_fn!(fundamental))), - ("proc_macro_derive", Normal, Ungated), + ("proc_macro_derive", Normal, AttributeMeta::List, Ungated), - ("rustc_copy_clone_marker", Whitelisted, Gated(Stability::Unstable, + ("rustc_copy_clone_marker", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "internal implementation detail", cfg_fn!(rustc_attrs))), // FIXME: #14408 whitelist docs since rustdoc looks at them - ("doc", Whitelisted, Ungated), + ("doc", Whitelisted, AttributeMeta::List | AttributeMeta::NameValueStr, Ungated), // FIXME: #14406 these are processed in codegen, which happens after the // lint pass - ("cold", Whitelisted, Ungated), - ("naked", Whitelisted, Gated(Stability::Unstable, + ("cold", Whitelisted, AttributeMeta::Word, Ungated), + ("naked", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "naked_functions", "the `#[naked]` attribute \ is an experimental feature", cfg_fn!(naked_functions))), - ("target_feature", Whitelisted, Ungated), - ("export_name", Whitelisted, Ungated), - ("inline", Whitelisted, Ungated), - ("link", Whitelisted, Ungated), - ("link_name", Whitelisted, Ungated), - ("link_section", Whitelisted, Ungated), - ("no_builtins", Whitelisted, Ungated), - ("no_mangle", Whitelisted, Ungated), - ("no_debug", Whitelisted, Gated( + ("target_feature", Whitelisted, AttributeMeta::List, Ungated), + ("export_name", Whitelisted, AttributeMeta::NameValueStr, Ungated), + ("inline", Whitelisted, AttributeMeta::Word | AttributeMeta::List, Ungated), + ("link", Whitelisted, AttributeMeta::List, Ungated), + ("link_name", Whitelisted, AttributeMeta::NameValueStr, Ungated), + ("link_section", Whitelisted, AttributeMeta::NameValueStr, Ungated), + ("no_builtins", Whitelisted, AttributeMeta::Word, Ungated), + ("no_mangle", Whitelisted, AttributeMeta::Word, Ungated), + ("no_debug", Whitelisted, AttributeMeta::Word, Gated( Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721", None), "no_debug", "the `#[no_debug]` attribute was an experimental feature that has been \ deprecated due to lack of demand", cfg_fn!(no_debug))), - ("omit_gdb_pretty_printer_section", Whitelisted, Gated(Stability::Unstable, + ("omit_gdb_pretty_printer_section", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "omit_gdb_pretty_printer_section", "the `#[omit_gdb_pretty_printer_section]` \ attribute is just used for the Rust test \ @@ -1078,6 +1086,7 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ cfg_fn!(omit_gdb_pretty_printer_section))), ("unsafe_destructor_blind_to_params", Normal, + AttributeMeta::Word, Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/34761", Some("replace this attribute with `#[may_dangle]`")), "dropck_parametricity", @@ -1086,93 +1095,87 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ cfg_fn!(dropck_parametricity))), ("may_dangle", Normal, + AttributeMeta::Word, Gated(Stability::Unstable, "dropck_eyepatch", "may_dangle has unstable semantics and may be removed in the future", cfg_fn!(dropck_eyepatch))), - ("unwind", Whitelisted, Gated(Stability::Unstable, + ("unwind", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "unwind_attributes", "#[unwind] is experimental", cfg_fn!(unwind_attributes))), - ("used", Whitelisted, Ungated), + ("used", Whitelisted, AttributeMeta::Word, Ungated), // used in resolve - ("prelude_import", Whitelisted, Gated(Stability::Unstable, + ("prelude_import", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "prelude_import", "`#[prelude_import]` is for use by rustc only", cfg_fn!(prelude_import))), // FIXME: #14407 these are only looked at on-demand so we can't // guarantee they'll have already been checked - ("rustc_deprecated", Whitelisted, Ungated), - ("must_use", Whitelisted, Ungated), - ("stable", Whitelisted, Ungated), - ("unstable", Whitelisted, Ungated), - ("deprecated", Normal, Ungated), + ("rustc_deprecated", Whitelisted, AttributeMeta::List, Ungated), + ("must_use", Whitelisted, AttributeMeta::Word | AttributeMeta::NameValueStr, Ungated), + ("stable", Whitelisted, AttributeMeta::List, Ungated), + ("unstable", Whitelisted, AttributeMeta::List, Ungated), + ("deprecated", Normal, AttributeMeta::Word | AttributeMeta::List, Ungated), - ("rustc_paren_sugar", Normal, Gated(Stability::Unstable, + ("rustc_paren_sugar", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "unboxed_closures", "unboxed_closures are still evolving", cfg_fn!(unboxed_closures))), - ("windows_subsystem", Whitelisted, Ungated), + ("windows_subsystem", Whitelisted, AttributeMeta::NameValueStr, Ungated), - ("proc_macro_attribute", Normal, Ungated), - ("proc_macro", Normal, Ungated), + ("proc_macro_attribute", Normal, AttributeMeta::Word, Ungated), + ("proc_macro", Normal, AttributeMeta::Word, Ungated), - ("rustc_proc_macro_decls", Normal, Gated(Stability::Unstable, + ("rustc_proc_macro_decls", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_proc_macro_decls", "used internally by rustc", cfg_fn!(rustc_attrs))), - ("allow_fail", Normal, Gated(Stability::Unstable, + ("allow_fail", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "allow_fail", "allow_fail attribute is currently unstable", cfg_fn!(allow_fail))), - ("rustc_std_internal_symbol", Whitelisted, Gated(Stability::Unstable, + ("rustc_std_internal_symbol", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "this is an internal attribute that will \ never be stable", cfg_fn!(rustc_attrs))), // whitelists "identity-like" conversion methods to suggest on type mismatch - ("rustc_conversion_suggestion", Whitelisted, Gated(Stability::Unstable, + ("rustc_conversion_suggestion", Whitelisted, AttributeMeta::Word, Gated(Stability::Unstable, "rustc_attrs", "this is an internal attribute that will \ never be stable", cfg_fn!(rustc_attrs))), - ("rustc_args_required_const", Whitelisted, Gated(Stability::Unstable, + ("rustc_args_required_const", Whitelisted, AttributeMeta::List, Gated(Stability::Unstable, "rustc_attrs", "never will be stable", cfg_fn!(rustc_attrs))), - - // RFC #2093 - ("infer_static_outlives_requirements", Normal, Gated(Stability::Unstable, - "infer_static_outlives_requirements", - "infer 'static lifetime requirements", - cfg_fn!(infer_static_outlives_requirements))), - // RFC 2070 - ("panic_handler", Normal, Ungated), + ("panic_handler", Normal, AttributeMeta::Word, Ungated), - ("alloc_error_handler", Normal, Gated(Stability::Unstable, + ("alloc_error_handler", Normal, AttributeMeta::Word, Gated(Stability::Unstable, "alloc_error_handler", "#[alloc_error_handler] is an unstable feature", cfg_fn!(alloc_error_handler))), // Crate level attributes - ("crate_name", CrateLevel, Ungated), - ("crate_type", CrateLevel, Ungated), - ("crate_id", CrateLevel, Ungated), - ("feature", CrateLevel, Ungated), - ("no_start", CrateLevel, Ungated), - ("no_main", CrateLevel, Ungated), - ("no_builtins", CrateLevel, Ungated), - ("recursion_limit", CrateLevel, Ungated), - ("type_length_limit", CrateLevel, Ungated), - ("test_runner", CrateLevel, Gated(Stability::Unstable, + ("crate_name", CrateLevel, AttributeMeta::NameValueStr, Ungated), + ("crate_type", CrateLevel, AttributeMeta::NameValueStr, Ungated), + ("crate_id", CrateLevel, AttributeMeta::NameValueStr, Ungated), + ("feature", CrateLevel, AttributeMeta::List, Ungated), + ("no_start", CrateLevel, AttributeMeta::Word, Ungated), + ("no_main", CrateLevel, AttributeMeta::Word, Ungated), + ("no_builtins", CrateLevel, AttributeMeta::Word, Ungated), + ("recursion_limit", CrateLevel, AttributeMeta::NameValueStr, Ungated), + ("type_length_limit", CrateLevel, AttributeMeta::NameValueStr, Ungated), + ("test_runner", CrateLevel, AttributeMeta::List, Gated(Stability::Unstable, "custom_test_frameworks", EXPLAIN_CUSTOM_TEST_FRAMEWORKS, cfg_fn!(custom_test_frameworks))), @@ -1249,7 +1252,7 @@ impl<'a> Context<'a> { fn check_attribute(&self, attr: &ast::Attribute, is_macro: bool) { debug!("check_attribute(attr = {:?})", attr); let name = attr.name().as_str(); - for &(n, ty, ref gateage) in BUILTIN_ATTRIBUTES { + for &(n, ty, _meta, ref gateage) in BUILTIN_ATTRIBUTES { if name == n { if let Gated(_, name, desc, ref has_feature) = *gateage { gate_feature_fn!(self, has_feature, attr.span, name, desc, GateStrength::Hard); @@ -1519,12 +1522,47 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } - 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. - if let Err(mut err) = attr.parse_meta(self.context.parse_sess) { - err.help("try enabling `#![feature(unrestricted_attribute_tokens)]`").emit() + match BUILTIN_ATTRIBUTES.iter().find(|(name, ..)| attr.path == name) { + Some(&(name, _, allowed_meta, _)) => match attr.parse_meta(self.context.parse_sess) { + Ok(meta) => if allowed_meta & AttributeMeta::Skip == 0 { + let meta_kind = match &meta.node { + ast::MetaItemKind::Word => AttributeMeta::Word, + ast::MetaItemKind::List(..) => AttributeMeta::List, + ast::MetaItemKind::NameValue(lit) if lit.node.is_str() => + AttributeMeta::NameValueStr, + ast::MetaItemKind::NameValue(..) => 0, + }; + if meta_kind & allowed_meta == 0 { + let mut msg = "attribute must be of the form ".to_owned(); + let mut first = true; + for &meta_kind in [AttributeMeta::Word, + AttributeMeta::List, + AttributeMeta::NameValueStr].iter() { + if meta_kind & allowed_meta != 0 { + let descr = match meta_kind { + AttributeMeta::Word => "", + AttributeMeta::List => "(...)", + AttributeMeta::NameValueStr => " = \"...\"", + _ => unreachable!(), + }; + if first { + first = false; + } else { + msg.push_str(" or "); + } + msg.push_str(&format!("`#[{}{}]`", name, descr)); + } + } + self.context.parse_sess.span_diagnostic.span_err(meta.span, &msg); + } + } + Err(mut err) => err.emit(), + } + None => if let Some(TokenTree::Token(_, token::Eq)) = attr.tokens.trees().next() { + // All key-value attributes are restricted to what fits into a meta-item. + if let Err(mut err) = attr.parse_meta(self.context.parse_sess) { + err.emit(); + } } } } @@ -1954,11 +1992,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], let list = match attr.meta_item_list() { Some(list) => list, - None => { - span_err!(span_handler, attr.span, E0555, - "malformed feature attribute, expected #![feature(...)]"); - continue - } + None => continue, }; for mi in list { diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 914a0667ebf0c..8bd1c5607d083 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -156,11 +156,21 @@ impl<'a> Parser<'a> { self.parse_token_tree().into() } else if self.eat(&token::Eq) { let eq = TokenTree::Token(self.prev_span, token::Eq); - let tree = match self.token { - token::CloseDelim(_) | token::Eof => self.unexpected()?, - _ => self.parse_token_tree(), + let mut is_interpolated_expr = false; + if let token::Interpolated(nt) = &self.token { + if let token::NtExpr(..) = nt.0 { + is_interpolated_expr = true; + } + } + let tokens = if is_interpolated_expr { + // We need to accept arbitrary interpolated expressions to continue + // supporting things like `doc = $expr` that work on stable. + // Non-literal interpolated expressions are rejected after expansion. + self.parse_token_tree().into() + } else { + self.parse_unsuffixed_lit()?.tokens() }; - TokenStream::new(vec![eq.into(), tree.into()]) + TokenStream::new(vec![eq.into(), tokens]) } else { TokenStream::empty() }; diff --git a/src/libsyntax_ext/proc_macro_decls.rs b/src/libsyntax_ext/proc_macro_decls.rs index 38f7ca500b25d..1d272712cacc8 100644 --- a/src/libsyntax_ext/proc_macro_decls.rs +++ b/src/libsyntax_ext/proc_macro_decls.rs @@ -105,12 +105,7 @@ impl<'a> CollectProcMacros<'a> { // `#[proc_macro_derive(Foo, attributes(A, ..))]` let list = match attr.meta_item_list() { Some(list) => list, - None => { - self.handler.span_err(attr.span(), - "attribute must be of form: \ - #[proc_macro_derive(TraitName)]"); - return - } + None => return, }; if list.len() != 1 && list.len() != 2 { self.handler.span_err(attr.span(), @@ -182,13 +177,7 @@ impl<'a> CollectProcMacros<'a> { } } - fn collect_attr_proc_macro(&mut self, item: &'a ast::Item, attr: &'a ast::Attribute) { - if !attr.is_word() { - self.handler.span_err(attr.span, "`#[proc_macro_attribute]` attribute \ - does not take any arguments"); - return; - } - + fn collect_attr_proc_macro(&mut self, item: &'a ast::Item) { if self.in_root && item.vis.node.is_pub() { self.attr_macros.push(ProcMacroDef { span: item.span, @@ -205,13 +194,7 @@ impl<'a> CollectProcMacros<'a> { } } - fn collect_bang_proc_macro(&mut self, item: &'a ast::Item, attr: &'a ast::Attribute) { - if !attr.is_word() { - self.handler.span_err(attr.span, "`#[proc_macro]` attribute \ - does not take any arguments"); - return; - } - + fn collect_bang_proc_macro(&mut self, item: &'a ast::Item) { if self.in_root && item.vis.node.is_pub() { self.bang_macros.push(ProcMacroDef { span: item.span, @@ -308,9 +291,9 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { if attr.check_name("proc_macro_derive") { self.collect_custom_derive(item, attr); } else if attr.check_name("proc_macro_attribute") { - self.collect_attr_proc_macro(item, attr); + self.collect_attr_proc_macro(item); } else if attr.check_name("proc_macro") { - self.collect_bang_proc_macro(item, attr); + self.collect_bang_proc_macro(item); }; let prev_in_root = mem::replace(&mut self.in_root, false); diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs index d48e189abc450..dd042114551c9 100644 --- a/src/libterm/terminfo/searcher.rs +++ b/src/libterm/terminfo/searcher.rs @@ -66,7 +66,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option { } #[test] -#[ignore(reason = "buildbots don't have ncurses installed and I can't mock everything I need")] +#[ignore] // buildbots don't have ncurses installed and I can't mock everything I need fn test_get_dbpath_for_term() { // woefully inadequate test coverage // note: current tests won't work with non-standard terminfo hierarchies (e.g., macOS's) diff --git a/src/test/run-pass/proc-macro/derive-b.rs b/src/test/run-pass/proc-macro/derive-b.rs index af48cabca99e4..da67534364b65 100644 --- a/src/test/run-pass/proc-macro/derive-b.rs +++ b/src/test/run-pass/proc-macro/derive-b.rs @@ -1,7 +1,5 @@ // aux-build:derive-b.rs -#![feature(unrestricted_attribute_tokens)] - extern crate derive_b; #[derive(Debug, PartialEq, derive_b::B, Eq, Copy, Clone)] diff --git a/src/test/ui/attr-eq-token-tree.rs b/src/test/ui/attr-eq-token-tree.rs index f28f76db9389d..6aacb9d572aea 100644 --- a/src/test/ui/attr-eq-token-tree.rs +++ b/src/test/ui/attr-eq-token-tree.rs @@ -1,6 +1,4 @@ -// compile-pass +#![feature(custom_attribute)] -#![feature(custom_attribute, unrestricted_attribute_tokens)] - -#[my_attr = !] // OK under feature gate +#[my_attr = !] //~ ERROR unexpected token: `!` fn main() {} diff --git a/src/test/ui/attr-eq-token-tree.stderr b/src/test/ui/attr-eq-token-tree.stderr new file mode 100644 index 0000000000000..57d6a4e0f16a2 --- /dev/null +++ b/src/test/ui/attr-eq-token-tree.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `!` + --> $DIR/attr-eq-token-tree.rs:3:11 + | +LL | #[my_attr = !] //~ ERROR unexpected token: `!` + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs b/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs index 9345229704a67..0dceba28b6ec3 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs @@ -1,8 +1,8 @@ -// -// compile-flags: --cfg broken - // https://github.com/rust-lang/rust/issues/21833#issuecomment-72353044 +// compile-flags: --cfg broken + +#![crate_type = "lib"] #![cfg_attr(broken, no_core)] //~ ERROR no_core is experimental -fn main() { } +pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs index 0638f481ae569..16813a7623c77 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs @@ -1,7 +1,7 @@ -// // compile-flags: --cfg broken #![feature(cfg_attr_multi)] +#![crate_type = "lib"] #![cfg_attr(broken, no_core, no_std)] //~ ERROR no_core is experimental -fn main() { } +pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs index 26b4936ac70b2..39f8fc4b8b9f1 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs @@ -1,7 +1,7 @@ -// // compile-flags: --cfg broken #![feature(cfg_attr_multi)] +#![crate_type = "lib"] #![cfg_attr(broken, no_std, no_core)] //~ ERROR no_core is experimental -fn main() { } +pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs index c7e1b4435e49b..c5aa903f9491f 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs @@ -27,7 +27,8 @@ struct S9; macro_rules! generate_s10 { ($expr: expr) => { - #[cfg(feature = $expr)] //~ ERROR `cfg` is not a well-formed meta-item + #[cfg(feature = $expr)] + //~^ ERROR expected unsuffixed literal or identifier, found concat!("nonexistent") struct S10; } } diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr index da06a81751cdb..bcf13ead2f4f7 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -52,11 +52,11 @@ error[E0565]: literal in `cfg` predicate value must be a string LL | #[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string | ^^^^^ help: consider removing the prefix: `"hi"` -error: `cfg` is not a well-formed meta-item - --> $DIR/cfg-attr-syntax-validation.rs:30:9 +error: expected unsuffixed literal or identifier, found concat!("nonexistent") + --> $DIR/cfg-attr-syntax-validation.rs:30:15 | -LL | #[cfg(feature = $expr)] //~ ERROR `cfg` is not a well-formed meta-item - | ^^^^^^^^^^^^^^^^^^^^^^^ help: expected syntax is: `#[cfg(/* predicate */)]` +LL | #[cfg(feature = $expr)] + | ^^^^^^^ ... LL | generate_s10!(concat!("nonexistent")); | -------------------------------------- in this macro invocation diff --git a/src/test/ui/derives/deriving-meta-empty-trait-list.rs b/src/test/ui/derives/deriving-meta-empty-trait-list.rs index 98da6d23245c7..882484146152d 100644 --- a/src/test/ui/derives/deriving-meta-empty-trait-list.rs +++ b/src/test/ui/derives/deriving-meta-empty-trait-list.rs @@ -1,9 +1,4 @@ -// run-pass - -#![allow(dead_code)] - -#[derive] //~ WARNING empty trait list in `derive` -struct Foo; +// compile-pass #[derive()] //~ WARNING empty trait list in `derive` struct Bar; diff --git a/src/test/ui/derives/deriving-meta-empty-trait-list.stderr b/src/test/ui/derives/deriving-meta-empty-trait-list.stderr index dbc2387960fdc..191bb780f7e1f 100644 --- a/src/test/ui/derives/deriving-meta-empty-trait-list.stderr +++ b/src/test/ui/derives/deriving-meta-empty-trait-list.stderr @@ -1,11 +1,5 @@ warning: empty trait list in `derive` - --> $DIR/deriving-meta-empty-trait-list.rs:5:1 - | -LL | #[derive] //~ WARNING empty trait list in `derive` - | ^^^^^^^^^ - -warning: empty trait list in `derive` - --> $DIR/deriving-meta-empty-trait-list.rs:8:1 + --> $DIR/deriving-meta-empty-trait-list.rs:3:1 | LL | #[derive()] //~ WARNING empty trait list in `derive` | ^^^^^^^^^^^ diff --git a/src/test/ui/error-codes/E0232.rs b/src/test/ui/error-codes/E0232.rs deleted file mode 100644 index 8e8062436d6e5..0000000000000 --- a/src/test/ui/error-codes/E0232.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(on_unimplemented)] - -#[rustc_on_unimplemented] -//~^ ERROR E0232 -trait Bar {} - -fn main() { -} diff --git a/src/test/ui/error-codes/E0232.stderr b/src/test/ui/error-codes/E0232.stderr deleted file mode 100644 index 9e9155b1d323c..0000000000000 --- a/src/test/ui/error-codes/E0232.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0232]: `#[rustc_on_unimplemented]` requires a value - --> $DIR/E0232.rs:3:1 - | -LL | #[rustc_on_unimplemented] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ value required here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0232`. diff --git a/src/test/ui/error-codes/E0296.rs b/src/test/ui/error-codes/E0296.rs deleted file mode 100644 index a1a86574465fb..0000000000000 --- a/src/test/ui/error-codes/E0296.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![recursion_limit] //~ ERROR E0296 - -fn main() {} diff --git a/src/test/ui/error-codes/E0296.stderr b/src/test/ui/error-codes/E0296.stderr deleted file mode 100644 index 41e9f7ea7f9fb..0000000000000 --- a/src/test/ui/error-codes/E0296.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0296]: malformed recursion limit attribute, expected #![recursion_limit="N"] - --> $DIR/E0296.rs:1:1 - | -LL | #![recursion_limit] //~ ERROR E0296 - | ^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0296`. diff --git a/src/test/ui/error-codes/E0558.rs b/src/test/ui/error-codes/E0558.rs deleted file mode 100644 index 26d16f685a047..0000000000000 --- a/src/test/ui/error-codes/E0558.rs +++ /dev/null @@ -1,6 +0,0 @@ -#[export_name] -//~^ ERROR E0558 - -pub fn something() {} - -fn main() {} diff --git a/src/test/ui/error-codes/E0558.stderr b/src/test/ui/error-codes/E0558.stderr deleted file mode 100644 index 95bd9a1a828f2..0000000000000 --- a/src/test/ui/error-codes/E0558.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0558]: `export_name` attribute has invalid format - --> $DIR/E0558.rs:1:1 - | -LL | #[export_name] - | ^^^^^^^^^^^^^^ did you mean #[export_name="*"]? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0558`. diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs index 051bfbefdc1f0..c77efe0f8b7a6 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs @@ -30,75 +30,72 @@ // inputs are handled by each, and (2.) to ease searching for related // occurrences in the source text. -// skip-codegen #![warn(unused_attributes, unknown_lints)] -#![allow(dead_code)] #![allow(stable_features)] // UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES -#![warn (x5400)] //~ WARN unknown lint: `x5400` -#![allow (x5300)] //~ WARN unknown lint: `x5300` -#![forbid (x5200)] //~ WARN unknown lint: `x5200` -#![deny (x5100)] //~ WARN unknown lint: `x5100` +#![warn(x5400)] //~ WARN unknown lint: `x5400` +#![allow(x5300)] //~ WARN unknown lint: `x5300` +#![forbid(x5200)] //~ WARN unknown lint: `x5200` +#![deny(x5100)] //~ WARN unknown lint: `x5100` #![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs) -#![macro_export = "4800"] //~ WARN unused attribute -#![plugin_registrar = "4700"] //~ WARN unused attribute +#![macro_export] //~ WARN unused attribute +#![plugin_registrar] //~ WARN unused attribute // skipping testing of cfg // skipping testing of cfg_attr -#![main = "x4400"] //~ WARN unused attribute -#![start = "x4300"] //~ WARN unused attribute +#![main] //~ WARN unused attribute +#![start] //~ WARN unused attribute // see issue-43106-gating-of-test.rs for crate-level; but non crate-level is below at "4200" // see issue-43106-gating-of-bench.rs for crate-level; but non crate-level is below at "4100" -#![repr = "3900"] +#![repr()] //~^ WARN unused attribute -//~| WARN `repr` attribute isn't configurable with a literal -#![path = "3800"] //~ WARN unused attribute -#![abi = "3700"] //~ WARN unused attribute -#![automatically_derived = "3600"] //~ WARN unused attribute -#![no_mangle = "3500"] -#![no_link = "3400"] //~ WARN unused attribute +//~| WARN `repr` attribute must have a hint +#![path = "3800"] //~ WARN unused attribute +#![automatically_derived] //~ WARN unused attribute +#![no_mangle] +#![no_link] //~ WARN unused attribute // see issue-43106-gating-of-derive.rs -#![should_panic = "3200"] //~ WARN unused attribute -#![ignore = "3100"] //~ WARN unused attribute -#![no_implicit_prelude = "3000"] +#![should_panic] //~ WARN unused attribute +#![ignore] //~ WARN unused attribute +#![no_implicit_prelude] #![reexport_test_harness_main = "2900"] // see gated-link-args.rs // see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700" // (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600") -#![proc_macro_derive = "2500"] //~ WARN unused attribute -#![doc = "2400"] -#![cold = "2300"] -#![export_name = "2200"] +#![proc_macro_derive()] //~ WARN unused attribute +#![doc = "2400"] +#![cold] +#![export_name = "2200"] // see issue-43106-gating-of-inline.rs -#![link = "2000"] -#![link_name = "1900"] -#![link_section = "1800"] -#![no_builtins = "1700"] // Yikes, dupe'd on BUILTIN_ATTRIBUTES list (see "0300") -#![no_mangle = "1600"] // Yikes, dupe'd on BUILTIN_ATTRIBUTES list (see "3500") +#![link()] +#![link_name = "1900"] +#![link_section = "1800"] +#![no_builtins] // Yikes, dupe'd on BUILTIN_ATTRIBUTES list (see "0300") +#![no_mangle] // Yikes, dupe'd on BUILTIN_ATTRIBUTES list (see "3500") // see issue-43106-gating-of-rustc_deprecated.rs -#![must_use = "1400"] +#![must_use] // see issue-43106-gating-of-stable.rs // see issue-43106-gating-of-unstable.rs // see issue-43106-gating-of-deprecated.rs -#![windows_subsystem = "1000"] +#![windows_subsystem = "1000"] // UNGATED CRATE-LEVEL BUILT-IN ATTRIBUTES -#![crate_name = "0900"] -#![crate_type = "bin"] // cannot pass "0800" here +#![crate_name = "0900"] +#![crate_type = "bin"] // cannot pass "0800" here // For #![crate_id], see issue #43142. (I cannot bear to enshrine current behavior in a test) // FIXME(#44232) we should warn that this isn't used. -#![feature ( rust1)] +#![feature(rust1)] // For #![no_start], see issue #43144. (I cannot bear to enshrine current behavior in a test) // (cannot easily gating state of crate-level #[no_main]; but non crate-level is below at "0400") -#![no_builtins = "0300"] -#![recursion_limit = "0200"] -#![type_length_limit = "0100"] +#![no_builtins] +#![recursion_limit = "0200"] +#![type_length_limit = "0100"] // USES OF BUILT-IN ATTRIBUTES IN OTHER ("UNUSUAL") PLACES @@ -195,84 +192,84 @@ mod macro_use { //~^ WARN unused attribute } -#[macro_export = "4800"] +#[macro_export] //~^ WARN unused attribute mod macro_export { - mod inner { #![macro_export="4800"] } + mod inner { #![macro_export] } //~^ WARN unused attribute - #[macro_export = "4800"] fn f() { } + #[macro_export] fn f() { } //~^ WARN unused attribute - #[macro_export = "4800"] struct S; + #[macro_export] struct S; //~^ WARN unused attribute - #[macro_export = "4800"] type T = S; + #[macro_export] type T = S; //~^ WARN unused attribute - #[macro_export = "4800"] impl S { } + #[macro_export] impl S { } //~^ WARN unused attribute } -#[plugin_registrar = "4700"] +#[plugin_registrar] //~^ WARN unused attribute mod plugin_registrar { - mod inner { #![plugin_registrar="4700"] } + mod inner { #![plugin_registrar] } //~^ WARN unused attribute // for `fn f()` case, see gated-plugin_registrar.rs - #[plugin_registrar = "4700"] struct S; + #[plugin_registrar] struct S; //~^ WARN unused attribute - #[plugin_registrar = "4700"] type T = S; + #[plugin_registrar] type T = S; //~^ WARN unused attribute - #[plugin_registrar = "4700"] impl S { } + #[plugin_registrar] impl S { } //~^ WARN unused attribute } -#[main = "4400"] +#[main] //~^ WARN unused attribute mod main { - mod inner { #![main="4300"] } + mod inner { #![main] } //~^ WARN unused attribute // for `fn f()` case, see feature-gate-main.rs - #[main = "4400"] struct S; + #[main] struct S; //~^ WARN unused attribute - #[main = "4400"] type T = S; + #[main] type T = S; //~^ WARN unused attribute - #[main = "4400"] impl S { } + #[main] impl S { } //~^ WARN unused attribute } -#[start = "4300"] +#[start] //~^ WARN unused attribute mod start { - mod inner { #![start="4300"] } + mod inner { #![start] } //~^ WARN unused attribute // for `fn f()` case, see feature-gate-start.rs - #[start = "4300"] struct S; + #[start] struct S; //~^ WARN unused attribute - #[start = "4300"] type T = S; + #[start] type T = S; //~^ WARN unused attribute - #[start = "4300"] impl S { } + #[start] impl S { } //~^ WARN unused attribute } // At time of unit test authorship, if compiling without `--test` then // non-crate-level #[test] attributes seem to be ignored. -#[test = "4200"] -mod test { mod inner { #![test="4200"] } +#[test] +mod test { mod inner { #![test] } fn f() { } @@ -286,41 +283,36 @@ mod test { mod inner { #![test="4200"] } // At time of unit test authorship, if compiling without `--test` then // non-crate-level #[bench] attributes seem to be ignored. -#[bench = "4100"] +#[bench] mod bench { - mod inner { #![bench="4100"] } + mod inner { #![bench] } - #[bench = "4100"] + #[bench] struct S; - #[bench = "4100"] + #[bench] type T = S; - #[bench = "4100"] + #[bench] impl S { } } -#[repr = "3900"] -//~^ WARN unused attribute -//~| WARN `repr` attribute isn't configurable with a literal +#[repr()] +//~^ WARN `repr` attribute must have a hint mod repr { - mod inner { #![repr="3900"] } - //~^ WARN unused attribute - //~| WARN `repr` attribute isn't configurable with a literal + mod inner { #![repr()] } + //~^ WARN `repr` attribute must have a hint - #[repr = "3900"] fn f() { } - //~^ WARN unused attribute - //~| WARN `repr` attribute isn't configurable with a literal + #[repr()] fn f() { } + //~^ WARN `repr` attribute must have a hint struct S; - #[repr = "3900"] type T = S; - //~^ WARN unused attribute - //~| WARN `repr` attribute isn't configurable with a literal + #[repr()] type T = S; + //~^ WARN `repr` attribute must have a hint - #[repr = "3900"] impl S { } - //~^ WARN unused attribute - //~| WARN `repr` attribute isn't configurable with a literal + #[repr()] impl S { } + //~^ WARN `repr` attribute must have a hint } #[path = "3800"] @@ -340,130 +332,111 @@ mod path { //~^ WARN unused attribute } -#[abi = "3700"] -//~^ WARN unused attribute -mod abi { - mod inner { #![abi="3700"] } - //~^ WARN unused attribute - - #[abi = "3700"] fn f() { } - //~^ WARN unused attribute - - #[abi = "3700"] struct S; - //~^ WARN unused attribute - - #[abi = "3700"] type T = S; - //~^ WARN unused attribute - - #[abi = "3700"] impl S { } - //~^ WARN unused attribute -} - -#[automatically_derived = "3600"] +#[automatically_derived] //~^ WARN unused attribute mod automatically_derived { - mod inner { #![automatically_derived="3600"] } + mod inner { #![automatically_derived] } //~^ WARN unused attribute - #[automatically_derived = "3600"] fn f() { } + #[automatically_derived] fn f() { } //~^ WARN unused attribute - #[automatically_derived = "3600"] struct S; + #[automatically_derived] struct S; //~^ WARN unused attribute - #[automatically_derived = "3600"] type T = S; + #[automatically_derived] type T = S; //~^ WARN unused attribute - #[automatically_derived = "3600"] impl S { } + #[automatically_derived] impl S { } //~^ WARN unused attribute } -#[no_mangle = "3500"] +#[no_mangle] mod no_mangle { - mod inner { #![no_mangle="3500"] } + mod inner { #![no_mangle] } - #[no_mangle = "3500"] fn f() { } + #[no_mangle] fn f() { } - #[no_mangle = "3500"] struct S; + #[no_mangle] struct S; - #[no_mangle = "3500"] type T = S; + #[no_mangle] type T = S; - #[no_mangle = "3500"] impl S { } + #[no_mangle] impl S { } } -#[no_link = "3400"] +#[no_link] //~^ WARN unused attribute mod no_link { - mod inner { #![no_link="3400"] } + mod inner { #![no_link] } //~^ WARN unused attribute - #[no_link = "3400"] fn f() { } + #[no_link] fn f() { } //~^ WARN unused attribute - #[no_link = "3400"] struct S; + #[no_link] struct S; //~^ WARN unused attribute - #[no_link = "3400"]type T = S; + #[no_link]type T = S; //~^ WARN unused attribute - #[no_link = "3400"] impl S { } + #[no_link] impl S { } //~^ WARN unused attribute } -#[should_panic = "3200"] +#[should_panic] //~^ WARN unused attribute mod should_panic { - mod inner { #![should_panic="3200"] } + mod inner { #![should_panic] } //~^ WARN unused attribute - #[should_panic = "3200"] fn f() { } + #[should_panic] fn f() { } //~^ WARN unused attribute - #[should_panic = "3200"] struct S; + #[should_panic] struct S; //~^ WARN unused attribute - #[should_panic = "3200"] type T = S; + #[should_panic] type T = S; //~^ WARN unused attribute - #[should_panic = "3200"] impl S { } + #[should_panic] impl S { } //~^ WARN unused attribute } -#[ignore = "3100"] +#[ignore] //~^ WARN unused attribute mod ignore { - mod inner { #![ignore="3100"] } + mod inner { #![ignore] } //~^ WARN unused attribute - #[ignore = "3100"] fn f() { } + #[ignore] fn f() { } //~^ WARN unused attribute - #[ignore = "3100"] struct S; + #[ignore] struct S; //~^ WARN unused attribute - #[ignore = "3100"] type T = S; + #[ignore] type T = S; //~^ WARN unused attribute - #[ignore = "3100"] impl S { } + #[ignore] impl S { } //~^ WARN unused attribute } -#[no_implicit_prelude = "3000"] +#[no_implicit_prelude] //~^ WARN unused attribute mod no_implicit_prelude { - mod inner { #![no_implicit_prelude="3000"] } + mod inner { #![no_implicit_prelude] } //~^ WARN unused attribute - #[no_implicit_prelude = "3000"] fn f() { } + #[no_implicit_prelude] fn f() { } //~^ WARN unused attribute - #[no_implicit_prelude = "3000"] struct S; + #[no_implicit_prelude] struct S; //~^ WARN unused attribute - #[no_implicit_prelude = "3000"] type T = S; + #[no_implicit_prelude] type T = S; //~^ WARN unused attribute - #[no_implicit_prelude = "3000"] impl S { } + #[no_implicit_prelude] impl S { } //~^ WARN unused attribute } @@ -506,27 +479,27 @@ mod macro_escape { //~^ WARN unused attribute } -#[no_std = "2600"] +#[no_std] //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute mod no_std { - mod inner { #![no_std="2600"] } + mod inner { #![no_std] } //~^ WARN unused attribute //~| WARN crate-level attribute should be in the root module - #[no_std = "2600"] fn f() { } + #[no_std] fn f() { } //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_std = "2600"] struct S; + #[no_std] struct S; //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_std = "2600"] type T = S; + #[no_std] type T = S; //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_std = "2600"] impl S { } + #[no_std] impl S { } //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute } @@ -548,17 +521,17 @@ mod doc { #[doc = "2400"] impl S { } } -#[cold = "2300"] +#[cold] mod cold { - mod inner { #![cold="2300"] } + mod inner { #![cold] } - #[cold = "2300"] fn f() { } + #[cold] fn f() { } - #[cold = "2300"] struct S; + #[cold] struct S; - #[cold = "2300"] type T = S; + #[cold] type T = S; - #[cold = "2300"] impl S { } + #[cold] impl S { } } #[export_name = "2200"] @@ -579,17 +552,17 @@ mod export_name { // out that we allow them at non-crate-level (though I do not know // whether they have the same effect here as at crate-level). -#[link = "2000"] +#[link()] mod link { - mod inner { #![link="2000"] } + mod inner { #![link()] } - #[link = "2000"] fn f() { } + #[link()] fn f() { } - #[link = "2000"] struct S; + #[link()] struct S; - #[link = "2000"] type T = S; + #[link()] type T = S; - #[link = "2000"] impl S { } + #[link()] impl S { } } #[link_name = "1900"] @@ -620,30 +593,30 @@ mod link_section { struct StructForDeprecated; -#[deprecated = "1500"] +#[deprecated] mod deprecated { - mod inner { #![deprecated="1500"] } + mod inner { #![deprecated] } - #[deprecated = "1500"] fn f() { } + #[deprecated] fn f() { } - #[deprecated = "1500"] struct S1; + #[deprecated] struct S1; - #[deprecated = "1500"] type T = super::StructForDeprecated; + #[deprecated] type T = super::StructForDeprecated; - #[deprecated = "1500"] impl super::StructForDeprecated { } + #[deprecated] impl super::StructForDeprecated { } } -#[must_use = "1400"] +#[must_use] mod must_use { - mod inner { #![must_use="1400"] } + mod inner { #![must_use] } - #[must_use = "1400"] fn f() { } + #[must_use] fn f() { } - #[must_use = "1400"] struct S; + #[must_use] struct S; - #[must_use = "1400"] type T = S; + #[must_use] type T = S; - #[must_use = "1400"] impl S { } + #[must_use] impl S { } } #[windows_subsystem = "1000"] @@ -737,42 +710,42 @@ mod feature { } -#[no_main = "0400"] +#[no_main] //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute mod no_main_1 { - mod inner { #![no_main="0400"] } + mod inner { #![no_main] } //~^ WARN unused attribute //~| WARN crate-level attribute should be in the root module - #[no_main = "0400"] fn f() { } + #[no_main] fn f() { } //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_main = "0400"] struct S; + #[no_main] struct S; //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_main = "0400"] type T = S; + #[no_main] type T = S; //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute - #[no_main = "0400"] impl S { } + #[no_main] impl S { } //~^ WARN unused attribute //~| WARN crate-level attribute should be an inner attribute } -#[no_builtins = "0300"] +#[no_builtins] mod no_builtins { - mod inner { #![no_builtins="0200"] } + mod inner { #![no_builtins] } - #[no_builtins = "0300"] fn f() { } + #[no_builtins] fn f() { } - #[no_builtins = "0300"] struct S; + #[no_builtins] struct S; - #[no_builtins = "0300"] type T = S; + #[no_builtins] type T = S; - #[no_builtins = "0300"] impl S { } + #[no_builtins] impl S { } } #[recursion_limit="0200"] @@ -825,12 +798,4 @@ mod type_length_limit { //~| WARN crate-level attribute should be an inner attribute } - - - - - - -fn main() { - println!("Hello World"); -} +fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr index cb3e9bd62a408..ca4b3594a4229 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr @@ -1,1307 +1,1235 @@ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:38:9 | -LL | #![warn (x5400)] //~ WARN unknown lint: `x5400` - | ^^^^^ +LL | #![warn(x5400)] //~ WARN unknown lint: `x5400` + | ^^^^^ | note: lint level defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:34:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:33:28 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:41:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:39:10 | -LL | #![allow (x5300)] //~ WARN unknown lint: `x5300` - | ^^^^^ +LL | #![allow(x5300)] //~ WARN unknown lint: `x5300` + | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:42:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:11 | -LL | #![forbid (x5200)] //~ WARN unknown lint: `x5200` - | ^^^^^ +LL | #![forbid(x5200)] //~ WARN unknown lint: `x5200` + | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:41:9 | -LL | #![deny (x5100)] //~ WARN unknown lint: `x5100` - | ^^^^^ +LL | #![deny(x5100)] //~ WARN unknown lint: `x5100` + | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:102:8 | LL | #[warn(x5400)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:108:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:25 | LL | mod inner { #![warn(x5400)] } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:108:12 | LL | #[warn(x5400)] fn f() { } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:12 | LL | #[warn(x5400)] struct S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:12 | LL | #[warn(x5400)] type T = S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12 | LL | #[warn(x5400)] impl S { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:9 | LL | #[allow(x5300)] | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:26 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:26 | LL | mod inner { #![allow(x5300)] } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:13 | LL | #[allow(x5300)] fn f() { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:13 | LL | #[allow(x5300)] struct S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:13 | LL | #[allow(x5300)] type T = S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13 | LL | #[allow(x5300)] impl S { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:10 | LL | #[forbid(x5200)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:27 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:27 | LL | mod inner { #![forbid(x5200)] } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:14 | LL | #[forbid(x5200)] fn f() { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:14 | LL | #[forbid(x5200)] struct S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:14 | LL | #[forbid(x5200)] type T = S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14 | LL | #[forbid(x5200)] impl S { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:8 | LL | #[deny(x5100)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:25 | LL | mod inner { #![deny(x5100)] } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:12 | LL | #[deny(x5100)] fn f() { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:12 | LL | #[deny(x5100)] struct S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:12 | LL | #[deny(x5100)] type T = S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12 | LL | #[deny(x5100)] impl S { } | ^^^^^ warning: macro_escape is a deprecated synonym for macro_use - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ warning: macro_escape is a deprecated synonym for macro_use - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ | = help: consider an outer attribute, #[macro_use] mod ... -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:17 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:17 | -LL | mod inner { #![repr="3900"] } - | ^^^^^^^^^^^^^^^ needs a hint +LL | mod inner { #![repr()] } + | ^^^^^^^^^^ needs a hint | = note: #[warn(bad_repr)] on by default = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:311:5 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5 | -LL | #[repr = "3900"] fn f() { } - | ^^^^^^^^^^^^^^^^ needs a hint +LL | #[repr()] fn f() { } + | ^^^^^^^^^ needs a hint | = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:5 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:311:5 | -LL | #[repr = "3900"] type T = S; - | ^^^^^^^^^^^^^^^^ needs a hint +LL | #[repr()] type T = S; + | ^^^^^^^^^ needs a hint | = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:5 | -LL | #[repr = "3900"] impl S { } - | ^^^^^^^^^^^^^^^^ needs a hint +LL | #[repr()] impl S { } + | ^^^^^^^^^ needs a hint | = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:1 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:300:1 | -LL | #[repr = "3900"] - | ^^^^^^^^^^^^^^^^ needs a hint +LL | #[repr()] + | ^^^^^^^^^ needs a hint | = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit -warning: `repr` attribute isn't configurable with a literal - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1 +warning: `repr` attribute must have a hint + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:1 | -LL | #![repr = "3900"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs a hint +LL | #![repr()] + | ^^^^^^^^^^ needs a hint | = help: valid hints include `#[repr(C)]`, `#[repr(packed)]`, `#[repr(rust)]` and `#[repr(transparent)]` = note: for more information, visit warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:5 | LL | #[macro_use] fn f() { } | ^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:34:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:33:9 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:188:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:5 | LL | #[macro_use] struct S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:188:5 | LL | #[macro_use] type T = S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5 | LL | #[macro_use] impl S { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:17 | -LL | mod inner { #![macro_export="4800"] } - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![macro_export] } + | ^^^^^^^^^^^^^^^^ + +warning: unused attribute + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5 + | +LL | #[macro_export] fn f() { } + | ^^^^^^^^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5 | -LL | #[macro_export = "4800"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_export] struct S; + | ^^^^^^^^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:5 | -LL | #[macro_export = "4800"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_export] type T = S; + | ^^^^^^^^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5 | -LL | #[macro_export = "4800"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_export] impl S { } + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:1 | -LL | #[macro_export = "4800"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_export] + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:17 | -LL | #[macro_export = "4800"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![plugin_registrar] } + | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:220:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:5 | -LL | mod inner { #![plugin_registrar="4700"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[plugin_registrar] struct S; + | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:5 | -LL | #[plugin_registrar = "4700"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[plugin_registrar] type T = S; + | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:5 | -LL | #[plugin_registrar = "4700"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[plugin_registrar] impl S { } + | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:231:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:214:1 | -LL | #[plugin_registrar = "4700"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[plugin_registrar] + | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:17 | -LL | #[plugin_registrar = "4700"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![main] } + | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5 | -LL | mod inner { #![main="4300"] } - | ^^^^^^^^^^^^^^^ +LL | #[main] struct S; + | ^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 | -LL | #[main = "4400"] struct S; - | ^^^^^^^^^^^^^^^^ +LL | #[main] type T = S; + | ^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5 | -LL | #[main = "4400"] type T = S; - | ^^^^^^^^^^^^^^^^ +LL | #[main] impl S { } + | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:249:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:232:1 | -LL | #[main = "4400"] impl S { } - | ^^^^^^^^^^^^^^^^ +LL | #[main] + | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:17 | -LL | #[main = "4400"] - | ^^^^^^^^^^^^^^^^ +LL | mod inner { #![start] } + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5 | -LL | mod inner { #![start="4300"] } - | ^^^^^^^^^^^^^^^^ +LL | #[start] struct S; + | ^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:261:5 | -LL | #[start = "4300"] struct S; - | ^^^^^^^^^^^^^^^^^ +LL | #[start] type T = S; + | ^^^^^^^^ warning: unused attribute --> $DIR/issue-43106-gating-of-builtin-attrs.rs:264:5 | -LL | #[start = "4300"] type T = S; - | ^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:267:5 - | -LL | #[start = "4300"] impl S { } - | ^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:1 - | -LL | #[start = "4300"] - | ^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:17 - | -LL | mod inner { #![repr="3900"] } - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:311:5 - | -LL | #[repr = "3900"] fn f() { } - | ^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:5 - | -LL | #[repr = "3900"] type T = S; - | ^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5 - | -LL | #[repr = "3900"] impl S { } - | ^^^^^^^^^^^^^^^^ +LL | #[start] impl S { } + | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:250:1 | -LL | #[repr = "3900"] - | ^^^^^^^^^^^^^^^^ +LL | #[start] + | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:322:5 | LL | #[path = "3800"] fn f() { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:5 | LL | #[path = "3800"] struct S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:5 | LL | #[path = "3800"] type T = S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5 | LL | #[path = "3800"] impl S { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:346:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:17 | -LL | mod inner { #![abi="3700"] } - | ^^^^^^^^^^^^^^ +LL | mod inner { #![automatically_derived] } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:5 | -LL | #[abi = "3700"] fn f() { } - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:5 - | -LL | #[abi = "3700"] struct S; - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5 - | -LL | #[abi = "3700"] type T = S; - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5 - | -LL | #[abi = "3700"] impl S { } - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:343:1 - | -LL | #[abi = "3700"] - | ^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:17 - | -LL | mod inner { #![automatically_derived="3600"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5 - | -LL | #[automatically_derived = "3600"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[automatically_derived] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5 | -LL | #[automatically_derived = "3600"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[automatically_derived] struct S; + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5 | -LL | #[automatically_derived = "3600"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[automatically_derived] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5 | -LL | #[automatically_derived = "3600"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[automatically_derived] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:1 | -LL | #[automatically_derived = "3600"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[automatically_derived] + | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:17 | -LL | mod inner { #![no_link="3400"] } - | ^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_link] } + | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:400:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5 | -LL | #[no_link = "3400"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_link] fn f() { } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:403:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5 | -LL | #[no_link = "3400"] struct S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_link] struct S; + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:5 | -LL | #[no_link = "3400"]type T = S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_link]type T = S; + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:5 | -LL | #[no_link = "3400"] impl S { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_link] impl S { } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:1 | -LL | #[no_link = "3400"] - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_link] + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:17 | -LL | mod inner { #![should_panic="3200"] } - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![should_panic] } + | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:5 | -LL | #[should_panic = "3200"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[should_panic] fn f() { } + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 | -LL | #[should_panic = "3200"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[should_panic] struct S; + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:425:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:5 | -LL | #[should_panic = "3200"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[should_panic] type T = S; + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:428:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5 | -LL | #[should_panic = "3200"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[should_panic] impl S { } + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:1 | -LL | #[should_panic = "3200"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[should_panic] + | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:17 | -LL | mod inner { #![ignore="3100"] } - | ^^^^^^^^^^^^^^^^^ +LL | mod inner { #![ignore] } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5 | -LL | #[ignore = "3100"] fn f() { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[ignore] fn f() { } + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5 | -LL | #[ignore = "3100"] struct S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[ignore] struct S; + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5 | -LL | #[ignore = "3100"] type T = S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[ignore] type T = S; + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5 | -LL | #[ignore = "3100"] impl S { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[ignore] impl S { } + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:1 | -LL | #[ignore = "3100"] - | ^^^^^^^^^^^^^^^^^^ +LL | #[ignore] + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:17 | -LL | mod inner { #![no_implicit_prelude="3000"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_implicit_prelude] } + | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5 | -LL | #[no_implicit_prelude = "3000"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[no_implicit_prelude] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:460:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5 | -LL | #[no_implicit_prelude = "3000"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[no_implicit_prelude] struct S; + | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:5 | -LL | #[no_implicit_prelude = "3000"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[no_implicit_prelude] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:5 | -LL | #[no_implicit_prelude = "3000"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[no_implicit_prelude] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:1 | -LL | #[no_implicit_prelude = "3000"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[no_implicit_prelude] + | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:446:17 | LL | mod inner { #![reexport_test_harness_main="2900"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:449:5 | LL | #[reexport_test_harness_main = "2900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:5 | LL | #[reexport_test_harness_main = "2900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:5 | LL | #[reexport_test_harness_main = "2900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:485:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:5 | LL | #[reexport_test_harness_main = "2900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:443:1 | LL | #[reexport_test_harness_main = "2900"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:475:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:17 | -LL | mod inner { #![no_std="2600"] } - | ^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_std] } + | ^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:17 | -LL | mod inner { #![no_std="2600"] } - | ^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_std] } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5 | -LL | #[no_std = "2600"] fn f() { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] fn f() { } + | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5 | -LL | #[no_std = "2600"] fn f() { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] fn f() { } + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:521:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5 | -LL | #[no_std = "2600"] struct S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] struct S; + | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:521:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5 | -LL | #[no_std = "2600"] struct S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] struct S; + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:525:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:498:5 | -LL | #[no_std = "2600"] type T = S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] type T = S; + | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:525:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:498:5 | -LL | #[no_std = "2600"] type T = S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] type T = S; + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5 | -LL | #[no_std = "2600"] impl S { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] impl S { } + | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5 | -LL | #[no_std = "2600"] impl S { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] impl S { } + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:509:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:1 | -LL | #[no_std = "2600"] - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] + | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:509:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:1 | -LL | #[no_std = "2600"] - | ^^^^^^^^^^^^^^^^^^ +LL | #[no_std] + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:668:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:668:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:672:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:645:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:672:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:645:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:680:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:653:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:680:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:653:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:637:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:637:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:697:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:697:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:730:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:730:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:17 | -LL | mod inner { #![no_main="0400"] } - | ^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_main] } + | ^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:17 | -LL | mod inner { #![no_main="0400"] } - | ^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![no_main] } + | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:748:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | -LL | #[no_main = "0400"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] fn f() { } + | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:748:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 | -LL | #[no_main = "0400"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] fn f() { } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:752:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | -LL | #[no_main = "0400"] struct S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] struct S; + | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:752:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 | -LL | #[no_main = "0400"] struct S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] struct S; + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | -LL | #[no_main = "0400"] type T = S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] type T = S; + | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 | -LL | #[no_main = "0400"] type T = S; - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] type T = S; + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 | -LL | #[no_main = "0400"] impl S { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] impl S { } + | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5 | -LL | #[no_main = "0400"] impl S { } - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] impl S { } + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:1 | -LL | #[no_main = "0400"] - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] + | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:1 | -LL | #[no_main = "0400"] - | ^^^^^^^^^^^^^^^^^^^ +LL | #[no_main] + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:782:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:782:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:786:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:786:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:790:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:790:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:794:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:794:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:798:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:819:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:819:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:823:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:823:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1 - | -LL | #![macro_export = "4800"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:1 | -LL | #![plugin_registrar = "4700"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![macro_export] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:1 | -LL | #![main = "x4400"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![plugin_registrar] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:47:1 | -LL | #![start = "x4300"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![main] //~ WARN unused attribute + | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:48:1 | -LL | #![repr = "3900"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![start] //~ WARN unused attribute + | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:1 | -LL | #![path = "3800"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![repr()] + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:57:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1 | -LL | #![abi = "3700"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![path = "3800"] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1 | -LL | #![automatically_derived = "3600"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![automatically_derived] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:57:1 | -LL | #![no_link = "3400"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![no_link] //~ WARN unused attribute + | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1 | -LL | #![should_panic = "3200"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![should_panic] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 | -LL | #![ignore = "3100"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![ignore] //~ WARN unused attribute + | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1 | -LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![proc_macro_derive()] //~ WARN unused attribute + | ^^^^^^^^^^^^^^^^^^^^^^^ error: invalid windows subsystem `1000`, only `windows` and `console` are allowed diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs b/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs index 32f30ce830447..360d570b65061 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs @@ -7,15 +7,7 @@ // compile-pass // skip-codegen -#![allow(dead_code)] -#![deprecated = "1100"] -// Since we expect for the mix of attributes used here to compile -// successfully, and we are just testing for the expected warnings of -// various (mis)uses of attributes, we use the `rustc_error` attribute -// on the `fn main()`. +#![deprecated] - -fn main() { - println!("Hello World"); -} +fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs b/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs index 7c17cd1af153c..27cfcd9a320a5 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-inline.rs @@ -6,23 +6,24 @@ // issue-43106-gating-of-builtin-attrs.rs) // Crate-level is accepted, though it is almost certainly unused? -#![inline = "2100"] +#![inline] -#[inline = "2100"] +#[inline] //~^ ERROR attribute should be applied to function or closure mod inline { - mod inner { #![inline="2100"] } + mod inner { #![inline] } //~^ ERROR attribute should be applied to function or closure #[inline = "2100"] fn f() { } + //~^ ERROR attribute must be of the form `#[inline]` or `#[inline(...)]` - #[inline = "2100"] struct S; + #[inline] struct S; //~^ ERROR attribute should be applied to function or closure - #[inline = "2100"] type T = S; + #[inline] type T = S; //~^ ERROR attribute should be applied to function or closure - #[inline = "2100"] impl S { } + #[inline] impl S { } //~^ ERROR attribute should be applied to function or closure } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr index 7eb0b5c197acf..4b510bfb996e2 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr @@ -1,11 +1,17 @@ +error: attribute must be of the form `#[inline]` or `#[inline(...)]` + --> $DIR/issue-43106-gating-of-inline.rs:17:5 + | +LL | #[inline = "2100"] fn f() { } + | ^^^^^^^^^^^^^^^^^^ + error[E0518]: attribute should be applied to function or closure --> $DIR/issue-43106-gating-of-inline.rs:11:1 | -LL | #[inline = "2100"] - | ^^^^^^^^^^^^^^^^^^ +LL | #[inline] + | ^^^^^^^^^ LL | //~^ ERROR attribute should be applied to function or closure LL | / mod inline { -LL | | mod inner { #![inline="2100"] } +LL | | mod inner { #![inline] } LL | | //~^ ERROR attribute should be applied to function or closure LL | | ... | @@ -16,27 +22,27 @@ LL | | } error[E0518]: attribute should be applied to function or closure --> $DIR/issue-43106-gating-of-inline.rs:14:17 | -LL | mod inner { #![inline="2100"] } - | ------------^^^^^^^^^^^^^^^^^-- not a function or closure +LL | mod inner { #![inline] } + | ------------^^^^^^^^^^-- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-inline.rs:19:5 + --> $DIR/issue-43106-gating-of-inline.rs:20:5 | -LL | #[inline = "2100"] struct S; - | ^^^^^^^^^^^^^^^^^^ --------- not a function or closure +LL | #[inline] struct S; + | ^^^^^^^^^ --------- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-inline.rs:22:5 + --> $DIR/issue-43106-gating-of-inline.rs:23:5 | -LL | #[inline = "2100"] type T = S; - | ^^^^^^^^^^^^^^^^^^ ----------- not a function or closure +LL | #[inline] type T = S; + | ^^^^^^^^^ ----------- not a function or closure error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43106-gating-of-inline.rs:25:5 + --> $DIR/issue-43106-gating-of-inline.rs:26:5 | -LL | #[inline = "2100"] impl S { } - | ^^^^^^^^^^^^^^^^^^ ---------- not a function or closure +LL | #[inline] impl S { } + | ^^^^^^^^^ ---------- not a function or closure -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0518`. diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.rs b/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.rs index bb54c0013d24e..2153c82ac1675 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.rs @@ -3,21 +3,23 @@ // corresponds to cases where the attribute is currently unused, so we // get that warning; see issue-43106-gating-of-builtin-attrs.rs -#![macro_use = "4900"] //~ ERROR arguments to macro_use are not allowed here +#![macro_use(my_macro)] +//~^ ERROR arguments to macro_use are not allowed here -#[macro_use = "2700"] +#[macro_use(my_macro)] //~^ ERROR arguments to macro_use are not allowed here mod macro_escape { - mod inner { #![macro_use="2700"] } + mod inner { #![macro_use(my_macro)] } //~^ ERROR arguments to macro_use are not allowed here - #[macro_use = "2700"] fn f() { } - #[macro_use = "2700"] struct S; + //~^ ERROR attribute must be of the form `#[macro_use]` or `#[macro_use(...)]` + + #[macro_use] fn f() { } - #[macro_use = "2700"] type T = S; + #[macro_use] type T = S; - #[macro_use = "2700"] impl S { } + #[macro_use] impl S { } } fn main() { } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.stderr index fb0e3b4caea35..0eb3449a6d5e1 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-macro_use.stderr @@ -1,20 +1,26 @@ error: arguments to macro_use are not allowed here --> $DIR/issue-43106-gating-of-macro_use.rs:6:1 | -LL | #![macro_use = "4900"] //~ ERROR arguments to macro_use are not allowed here - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![macro_use(my_macro)] + | ^^^^^^^^^^^^^^^^^^^^^^^ error: arguments to macro_use are not allowed here - --> $DIR/issue-43106-gating-of-macro_use.rs:8:1 + --> $DIR/issue-43106-gating-of-macro_use.rs:9:1 | -LL | #[macro_use = "2700"] - | ^^^^^^^^^^^^^^^^^^^^^ +LL | #[macro_use(my_macro)] + | ^^^^^^^^^^^^^^^^^^^^^^ error: arguments to macro_use are not allowed here - --> $DIR/issue-43106-gating-of-macro_use.rs:11:17 + --> $DIR/issue-43106-gating-of-macro_use.rs:12:17 | -LL | mod inner { #![macro_use="2700"] } - | ^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![macro_use(my_macro)] } + | ^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: attribute must be of the form `#[macro_use]` or `#[macro_use(...)]` + --> $DIR/issue-43106-gating-of-macro_use.rs:15:5 + | +LL | #[macro_use = "2700"] struct S; + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs b/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs index e2d0c263e65f3..a94ffd602efbf 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.rs @@ -7,27 +7,27 @@ // signal errors, making it incompatible with the "warnings only" // nature of issue-43106-gating-of-builtin-attrs.rs -#[proc_macro_derive = "2500"] +#[proc_macro_derive()] //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions mod proc_macro_derive1 { - mod inner { #![proc_macro_derive="2500"] } + mod inner { #![proc_macro_derive()] } // (no error issued here if there was one on outer module) } mod proc_macro_derive2 { - mod inner { #![proc_macro_derive="2500"] } + mod inner { #![proc_macro_derive()] } //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive = "2500"] fn f() { } + #[proc_macro_derive()] fn f() { } //~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` - #[proc_macro_derive = "2500"] struct S; + #[proc_macro_derive()] struct S; //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive = "2500"] type T = S; + #[proc_macro_derive()] type T = S; //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions - #[proc_macro_derive = "2500"] impl S { } + #[proc_macro_derive()] impl S { } //~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.stderr index aa841c3263c91..e202b472d9cae 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-proc_macro_derive.stderr @@ -1,38 +1,38 @@ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:10:1 | -LL | #[proc_macro_derive = "2500"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive()] + | ^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:18:17 | -LL | mod inner { #![proc_macro_derive="2500"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![proc_macro_derive()] } + | ^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:21:5 | -LL | #[proc_macro_derive = "2500"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive()] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:24:5 | -LL | #[proc_macro_derive = "2500"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive()] struct S; + | ^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:27:5 | -LL | #[proc_macro_derive = "2500"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive()] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute may only be used on bare functions --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:30:5 | -LL | #[proc_macro_derive = "2500"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[proc_macro_derive()] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.rs b/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.rs index b2fd6a7358fd5..60873f9cc7581 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.rs @@ -4,25 +4,25 @@ // this test incompatible with the "warnings only" nature of // issue-43106-gating-of-builtin-attrs.rs -#![rustc_deprecated = "1500"] +#![rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library -#[rustc_deprecated = "1500"] +#[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library mod rustc_deprecated { - mod inner { #![rustc_deprecated="1500"] } + mod inner { #![rustc_deprecated()] } //~^ ERROR stability attributes may not be used outside of the standard library - #[rustc_deprecated = "1500"] fn f() { } + #[rustc_deprecated()] fn f() { } //~^ ERROR stability attributes may not be used outside of the standard library - #[rustc_deprecated = "1500"] struct S; + #[rustc_deprecated()] struct S; //~^ ERROR stability attributes may not be used outside of the standard library - #[rustc_deprecated = "1500"] type T = S; + #[rustc_deprecated()] type T = S; //~^ ERROR stability attributes may not be used outside of the standard library - #[rustc_deprecated = "1500"] impl S { } + #[rustc_deprecated()] impl S { } //~^ ERROR stability attributes may not be used outside of the standard library } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.stderr index af056bc12e92c..4eead36910356 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-rustc_deprecated.stderr @@ -1,44 +1,44 @@ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1 | -LL | #![rustc_deprecated = "1500"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:10:1 | -LL | #[rustc_deprecated = "1500"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:13:17 | -LL | mod inner { #![rustc_deprecated="1500"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![rustc_deprecated()] } + | ^^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:5 | -LL | #[rustc_deprecated = "1500"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] fn f() { } + | ^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5 | -LL | #[rustc_deprecated = "1500"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] struct S; + | ^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:22:5 | -LL | #[rustc_deprecated = "1500"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] type T = S; + | ^^^^^^^^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:25:5 | -LL | #[rustc_deprecated = "1500"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] impl S { } + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-stable.rs b/src/test/ui/feature-gate/issue-43106-gating-of-stable.rs index 7d9501a799646..e3ac2749306ab 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-stable.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-stable.rs @@ -4,25 +4,25 @@ // this test incompatible with the "warnings only" nature of // issue-43106-gating-of-builtin-attrs.rs -#![stable = "1300"] +#![stable()] //~^ ERROR stability attributes may not be used outside of the standard library -#[stable = "1300"] +#[stable()] //~^ ERROR stability attributes may not be used outside of the standard library mod stable { - mod inner { #![stable="1300"] } + mod inner { #![stable()] } //~^ ERROR stability attributes may not be used outside of the standard library - #[stable = "1300"] fn f() { } + #[stable()] fn f() { } //~^ ERROR stability attributes may not be used outside of the standard library - #[stable = "1300"] struct S; + #[stable()] struct S; //~^ ERROR stability attributes may not be used outside of the standard library - #[stable = "1300"] type T = S; + #[stable()] type T = S; //~^ ERROR stability attributes may not be used outside of the standard library - #[stable = "1300"] impl S { } + #[stable()] impl S { } //~^ ERROR stability attributes may not be used outside of the standard library } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-stable.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-stable.stderr index 56066e85ba26b..03410eabe3652 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-stable.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-stable.stderr @@ -1,44 +1,44 @@ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:7:1 | -LL | #![stable = "1300"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![stable()] + | ^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:10:1 | -LL | #[stable = "1300"] - | ^^^^^^^^^^^^^^^^^^ +LL | #[stable()] + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:13:17 | -LL | mod inner { #![stable="1300"] } - | ^^^^^^^^^^^^^^^^^ +LL | mod inner { #![stable()] } + | ^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:16:5 | -LL | #[stable = "1300"] fn f() { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[stable()] fn f() { } + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:19:5 | -LL | #[stable = "1300"] struct S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[stable()] struct S; + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:22:5 | -LL | #[stable = "1300"] type T = S; - | ^^^^^^^^^^^^^^^^^^ +LL | #[stable()] type T = S; + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-stable.rs:25:5 | -LL | #[stable = "1300"] impl S { } - | ^^^^^^^^^^^^^^^^^^ +LL | #[stable()] impl S { } + | ^^^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-unstable.rs b/src/test/ui/feature-gate/issue-43106-gating-of-unstable.rs index 8be55f0baf623..8d519c3106c5e 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-unstable.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-unstable.rs @@ -4,25 +4,25 @@ // this test incompatible with the "warnings only" nature of // issue-43106-gating-of-builtin-attrs.rs -#![unstable = "1200"] +#![unstable()] //~^ ERROR stability attributes may not be used outside of the standard library -#[unstable = "1200"] +#[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library mod unstable { - mod inner { #![unstable="1200"] } + mod inner { #![unstable()] } //~^ ERROR stability attributes may not be used outside of the standard library - #[unstable = "1200"] fn f() { } + #[unstable()] fn f() { } //~^ ERROR stability attributes may not be used outside of the standard library - #[unstable = "1200"] struct S; + #[unstable()] struct S; //~^ ERROR stability attributes may not be used outside of the standard library - #[unstable = "1200"] type T = S; + #[unstable()] type T = S; //~^ ERROR stability attributes may not be used outside of the standard library - #[unstable = "1200"] impl S { } + #[unstable()] impl S { } //~^ ERROR stability attributes may not be used outside of the standard library } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-unstable.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-unstable.stderr index ee8b9d43d41e7..5952b3836aac8 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-unstable.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-unstable.stderr @@ -1,44 +1,44 @@ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:7:1 | -LL | #![unstable = "1200"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![unstable()] + | ^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:10:1 | -LL | #[unstable = "1200"] - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable()] + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:13:17 | -LL | mod inner { #![unstable="1200"] } - | ^^^^^^^^^^^^^^^^^^^ +LL | mod inner { #![unstable()] } + | ^^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:16:5 | -LL | #[unstable = "1200"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable()] fn f() { } + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:19:5 | -LL | #[unstable = "1200"] struct S; - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable()] struct S; + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:22:5 | -LL | #[unstable = "1200"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable()] type T = S; + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/issue-43106-gating-of-unstable.rs:25:5 | -LL | #[unstable = "1200"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable()] impl S { } + | ^^^^^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs index fbd9291afbe03..daa2bb5d6fafc 100644 --- a/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs +++ b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs @@ -9,3 +9,6 @@ use core::alloc::Layout; fn oom(info: Layout) -> ! { loop {} } + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { loop {} } diff --git a/src/test/ui/feature-gates/feature-gate-allow_fail.rs b/src/test/ui/feature-gates/feature-gate-allow_fail.rs index cd8b096294261..f9ad48551410c 100644 --- a/src/test/ui/feature-gates/feature-gate-allow_fail.rs +++ b/src/test/ui/feature-gates/feature-gate-allow_fail.rs @@ -5,3 +5,4 @@ fn ok_to_fail() { assert!(false); } +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs index 00a3103af2cbc..84dd1b9f814c2 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs +++ b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs @@ -6,5 +6,5 @@ async fn foo() {} //~ ERROR async fn is unstable fn main() { let _ = async {}; //~ ERROR cannot find struct, variant or union type `async` - let _ = async || {}; //~ ERROR cannot find value `async` in this scope + let _ = async || { true }; //~ ERROR cannot find value `async` in this scope } diff --git a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr index 7754dbb3b3736..450b2c42f119d 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr +++ b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr @@ -7,7 +7,7 @@ LL | let _ = async {}; //~ ERROR cannot find struct, variant or union type ` error[E0425]: cannot find value `async` in this scope --> $DIR/feature-gate-async-await-2015-edition.rs:9:13 | -LL | let _ = async || {}; //~ ERROR cannot find value `async` in this scope +LL | let _ = async || { true }; //~ ERROR cannot find value `async` in this scope | ^^^^^ not found in this scope error[E0658]: async fn is unstable (see issue #50547) diff --git a/src/test/ui/feature-gates/feature-gate-const_fn.rs b/src/test/ui/feature-gates/feature-gate-const_fn.rs index 5a0a5ac9edc6c..f46d1dc13d3f0 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn.rs +++ b/src/test/ui/feature-gates/feature-gate-const_fn.rs @@ -9,14 +9,16 @@ trait Foo { //~| ERROR trait fns cannot be declared const } -impl Foo { - const fn baz() -> u32 { 0 } // ok -} - impl Foo for u32 { const fn foo() -> u32 { 0 } //~ ERROR trait fns cannot be declared const } +trait Bar {} + +impl dyn Bar { + const fn baz() -> u32 { 0 } // ok +} + static FOO: usize = foo(); const BAR: usize = foo(); diff --git a/src/test/ui/feature-gates/feature-gate-const_fn.stderr b/src/test/ui/feature-gates/feature-gate-const_fn.stderr index 32a57719edbe5..b3fc587b1cf77 100644 --- a/src/test/ui/feature-gates/feature-gate-const_fn.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_fn.stderr @@ -11,7 +11,7 @@ LL | const fn bar() -> u32 { 0 } //~ ERROR const fn is unstable | ^^^^^ trait fns cannot be const error[E0379]: trait fns cannot be declared const - --> $DIR/feature-gate-const_fn.rs:17:5 + --> $DIR/feature-gate-const_fn.rs:13:5 | LL | const fn foo() -> u32 { 0 } //~ ERROR trait fns cannot be declared const | ^^^^^ trait fns cannot be const diff --git a/src/test/ui/feature-gates/feature-gate-doc_keyword.rs b/src/test/ui/feature-gates/feature-gate-doc_keyword.rs index f417828db15ad..b08940e28f443 100644 --- a/src/test/ui/feature-gates/feature-gate-doc_keyword.rs +++ b/src/test/ui/feature-gates/feature-gate-doc_keyword.rs @@ -1,3 +1,5 @@ #[doc(keyword = "match")] //~ ERROR: #[doc(keyword = "...")] is experimental /// wonderful mod foo{} + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs index 02aa5000661d3..a2377cda9bd66 100644 --- a/src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs +++ b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs @@ -1,14 +1,11 @@ // gate-test-dropck_parametricity // Ensure that attempts to use the unsafe attribute are feature-gated. - // Example adapted from RFC 1238 text (just left out the feature gate). // https://github.com/rust-lang/rfcs/blob/master/text/1238-nonparametric-dropck.md // #example-of-the-unguarded-escape-hatch -// #![feature(dropck_parametricity)] - use std::cell::Cell; struct Concrete<'a>(u32, Cell>>); @@ -18,6 +15,7 @@ struct Foo { data: Vec } impl Drop for Foo { #[unsafe_destructor_blind_to_params] // This is the UGEH attribute //~^ ERROR unsafe_destructor_blind_to_params has been replaced + //~| WARN use of deprecated attribute `dropck_parametricity` fn drop(&mut self) { } } @@ -29,4 +27,3 @@ fn main() { foo.data[0].1.set(Some(&foo.data[1])); foo.data[1].1.set(Some(&foo.data[0])); } - diff --git a/src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr index 99ca454bcabab..bc62fc01b4438 100644 --- a/src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr +++ b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr @@ -1,11 +1,19 @@ error[E0658]: unsafe_destructor_blind_to_params has been replaced by may_dangle and will be removed in the future (see issue #28498) - --> $DIR/feature-gate-dropck-ugeh.rs:19:5 + --> $DIR/feature-gate-dropck-ugeh.rs:16:5 | LL | #[unsafe_destructor_blind_to_params] // This is the UGEH attribute | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(dropck_parametricity)] to the crate attributes to enable +warning: use of deprecated attribute `dropck_parametricity`: unsafe_destructor_blind_to_params has been replaced by may_dangle and will be removed in the future. See https://github.com/rust-lang/rust/issues/34761 + --> $DIR/feature-gate-dropck-ugeh.rs:16:5 + | +LL | #[unsafe_destructor_blind_to_params] // This is the UGEH attribute + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this attribute with `#[may_dangle]` + | + = note: #[warn(deprecated)] on by default + error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-existential-type.rs b/src/test/ui/feature-gates/feature-gate-existential-type.rs index e14467d6c3eb5..6dfd2d10870e0 100644 --- a/src/test/ui/feature-gates/feature-gate-existential-type.rs +++ b/src/test/ui/feature-gates/feature-gate-existential-type.rs @@ -1,15 +1,17 @@ // Check that existential types must be ungated to use the `existential` keyword - - existential type Foo: std::fmt::Debug; //~ ERROR existential types are unstable trait Bar { type Baa: std::fmt::Debug; + fn define() -> Self::Baa; } impl Bar for () { existential type Baa: std::fmt::Debug; //~ ERROR existential types are unstable + fn define() -> Self::Baa { 0 } } +fn define() -> Foo { 0 } + fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-existential-type.stderr b/src/test/ui/feature-gates/feature-gate-existential-type.stderr index e88bdc01fdc19..e83d5cdbde1e6 100644 --- a/src/test/ui/feature-gates/feature-gate-existential-type.stderr +++ b/src/test/ui/feature-gates/feature-gate-existential-type.stderr @@ -1,5 +1,5 @@ error[E0658]: existential types are unstable (see issue #34511) - --> $DIR/feature-gate-existential-type.rs:5:1 + --> $DIR/feature-gate-existential-type.rs:3:1 | LL | existential type Foo: std::fmt::Debug; //~ ERROR existential types are unstable | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | existential type Foo: std::fmt::Debug; //~ ERROR existential types are unst = help: add #![feature(existential_type)] to the crate attributes to enable error[E0658]: existential types are unstable (see issue #34511) - --> $DIR/feature-gate-existential-type.rs:12:5 + --> $DIR/feature-gate-existential-type.rs:11:5 | LL | existential type Baa: std::fmt::Debug; //~ ERROR existential types are unstable | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-generators.rs b/src/test/ui/feature-gates/feature-gate-generators.rs index 88e8781d2b9ba..cee930fd785b9 100644 --- a/src/test/ui/feature-gates/feature-gate-generators.rs +++ b/src/test/ui/feature-gates/feature-gate-generators.rs @@ -1,3 +1,4 @@ fn main() { yield true; //~ ERROR yield syntax is experimental + //~^ ERROR yield statement outside of generator literal } diff --git a/src/test/ui/feature-gates/feature-gate-generators.stderr b/src/test/ui/feature-gates/feature-gate-generators.stderr index 4b90cd1c1f8e4..aea1e00d698a6 100644 --- a/src/test/ui/feature-gates/feature-gate-generators.stderr +++ b/src/test/ui/feature-gates/feature-gate-generators.stderr @@ -6,6 +6,13 @@ LL | yield true; //~ ERROR yield syntax is experimental | = help: add #![feature(generators)] to the crate attributes to enable -error: aborting due to previous error +error[E0627]: yield statement outside of generator literal + --> $DIR/feature-gate-generators.rs:2:5 + | +LL | yield true; //~ ERROR yield syntax is experimental + | ^^^^^^^^^^ + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0627, E0658. +For more information about an error, try `rustc --explain E0627`. diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs index 86a1f5ca4d5d5..17548d7b9e88c 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs +++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs @@ -11,9 +11,9 @@ trait PointerFamily { struct Foo; impl PointerFamily for Foo { - type Pointer = Box; + type Pointer = Box; //~^ ERROR generic associated types are unstable - type Pointer2 = Box; + type Pointer2 = Box; //~^ ERROR generic associated types are unstable } diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr index 392d0f1bd7e15..8a207c966cdab 100644 --- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr +++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr @@ -25,7 +25,7 @@ LL | type Pointer2: Deref where T: Clone, U: Clone; error[E0658]: generic associated types are unstable (see issue #44265) --> $DIR/feature-gate-generic_associated_types.rs:14:5 | -LL | type Pointer = Box; +LL | type Pointer = Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(generic_associated_types)] to the crate attributes to enable @@ -33,7 +33,7 @@ LL | type Pointer = Box; error[E0658]: generic associated types are unstable (see issue #44265) --> $DIR/feature-gate-generic_associated_types.rs:16:5 | -LL | type Pointer2 = Box; +LL | type Pointer2 = Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(generic_associated_types)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-intrinsics.rs b/src/test/ui/feature-gates/feature-gate-intrinsics.rs index 0916d7fcd36d3..d1da94338283b 100644 --- a/src/test/ui/feature-gates/feature-gate-intrinsics.rs +++ b/src/test/ui/feature-gates/feature-gate-intrinsics.rs @@ -1,9 +1,7 @@ extern "rust-intrinsic" { //~ ERROR intrinsics are subject to change - fn bar(); + fn bar(); //~ ERROR unrecognized intrinsic function: `bar` } -extern "rust-intrinsic" fn baz() { //~ ERROR intrinsics are subject to change -} +extern "rust-intrinsic" fn baz() {} //~ ERROR intrinsics are subject to change -fn main() { -} +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-intrinsics.stderr b/src/test/ui/feature-gates/feature-gate-intrinsics.stderr index 034e2b1b588b5..092cb98a2f963 100644 --- a/src/test/ui/feature-gates/feature-gate-intrinsics.stderr +++ b/src/test/ui/feature-gates/feature-gate-intrinsics.stderr @@ -2,7 +2,7 @@ error[E0658]: intrinsics are subject to change --> $DIR/feature-gate-intrinsics.rs:1:1 | LL | / extern "rust-intrinsic" { //~ ERROR intrinsics are subject to change -LL | | fn bar(); +LL | | fn bar(); //~ ERROR unrecognized intrinsic function: `bar` LL | | } | |_^ | @@ -11,12 +11,18 @@ LL | | } error[E0658]: intrinsics are subject to change --> $DIR/feature-gate-intrinsics.rs:5:1 | -LL | / extern "rust-intrinsic" fn baz() { //~ ERROR intrinsics are subject to change -LL | | } - | |_^ +LL | extern "rust-intrinsic" fn baz() {} //~ ERROR intrinsics are subject to change + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(intrinsics)] to the crate attributes to enable -error: aborting due to 2 previous errors +error[E0093]: unrecognized intrinsic function: `bar` + --> $DIR/feature-gate-intrinsics.rs:2:5 + | +LL | fn bar(); //~ ERROR unrecognized intrinsic function: `bar` + | ^^^^^^^^^ unrecognized intrinsic + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0093, E0658. +For more information about an error, try `rustc --explain E0093`. diff --git a/src/test/ui/feature-gates/feature-gate-lang-items.rs b/src/test/ui/feature-gates/feature-gate-lang-items.rs index 943ca161d678d..93262f2171bfe 100644 --- a/src/test/ui/feature-gates/feature-gate-lang-items.rs +++ b/src/test/ui/feature-gates/feature-gate-lang-items.rs @@ -1,5 +1,5 @@ -#[lang="foo"] //~ ERROR language items are subject to change +#[lang = "foo"] //~ ERROR language items are subject to change + //~^ ERROR definition of an unknown language item: `foo` trait Foo {} -fn main() { -} +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-lang-items.stderr b/src/test/ui/feature-gates/feature-gate-lang-items.stderr index 3383eaab01f32..ccbb711fe6d43 100644 --- a/src/test/ui/feature-gates/feature-gate-lang-items.stderr +++ b/src/test/ui/feature-gates/feature-gate-lang-items.stderr @@ -1,11 +1,18 @@ error[E0658]: language items are subject to change --> $DIR/feature-gate-lang-items.rs:1:1 | -LL | #[lang="foo"] //~ ERROR language items are subject to change - | ^^^^^^^^^^^^^ +LL | #[lang = "foo"] //~ ERROR language items are subject to change + | ^^^^^^^^^^^^^^^ | = help: add #![feature(lang_items)] to the crate attributes to enable -error: aborting due to previous error +error[E0522]: definition of an unknown language item: `foo` + --> $DIR/feature-gate-lang-items.rs:1:1 + | +LL | #[lang = "foo"] //~ ERROR language items are subject to change + | ^^^^^^^^^^^^^^^ definition of unknown language item `foo` + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0522, E0658. +For more information about an error, try `rustc --explain E0522`. diff --git a/src/test/ui/feature-gates/feature-gate-linkage.rs b/src/test/ui/feature-gates/feature-gate-linkage.rs index 282c9a8b843f9..70f33cc0c6cc7 100644 --- a/src/test/ui/feature-gates/feature-gate-linkage.rs +++ b/src/test/ui/feature-gates/feature-gate-linkage.rs @@ -2,3 +2,5 @@ extern { #[linkage = "extern_weak"] static foo: isize; //~^ ERROR: the `linkage` attribute is experimental and not portable } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-may-dangle.rs b/src/test/ui/feature-gates/feature-gate-may-dangle.rs index 45666e90b210a..20896e426f65d 100644 --- a/src/test/ui/feature-gates/feature-gate-may-dangle.rs +++ b/src/test/ui/feature-gates/feature-gate-may-dangle.rs @@ -3,7 +3,9 @@ // Check that `may_dangle` is rejected if `dropck_eyepatch` feature gate is absent. struct Pt(A); -impl<#[may_dangle] A> Drop for Pt { +unsafe impl<#[may_dangle] A> Drop for Pt { //~^ ERROR may_dangle has unstable semantics and may be removed in the future fn drop(&mut self) { } } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-may-dangle.stderr b/src/test/ui/feature-gates/feature-gate-may-dangle.stderr index b537a5815886f..6d21147c9eeb3 100644 --- a/src/test/ui/feature-gates/feature-gate-may-dangle.stderr +++ b/src/test/ui/feature-gates/feature-gate-may-dangle.stderr @@ -1,8 +1,8 @@ error[E0658]: may_dangle has unstable semantics and may be removed in the future (see issue #34761) - --> $DIR/feature-gate-may-dangle.rs:6:6 + --> $DIR/feature-gate-may-dangle.rs:6:13 | -LL | impl<#[may_dangle] A> Drop for Pt { - | ^^^^^^^^^^^^^ +LL | unsafe impl<#[may_dangle] A> Drop for Pt { + | ^^^^^^^^^^^^^ | = help: add #![feature(dropck_eyepatch)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-min_const_fn.rs b/src/test/ui/feature-gates/feature-gate-min_const_fn.rs index e685b500ff3bb..669631df2ad17 100644 --- a/src/test/ui/feature-gates/feature-gate-min_const_fn.rs +++ b/src/test/ui/feature-gates/feature-gate-min_const_fn.rs @@ -9,14 +9,16 @@ trait Foo { //~| ERROR trait fns cannot be declared const } -impl Foo { - const fn baz() -> u32 { 0 } // stabilized -} - impl Foo for u32 { const fn foo() -> u32 { 0 } //~ ERROR trait fns cannot be declared const } +trait Bar {} + +impl dyn Bar { + const fn baz() -> u32 { 0 } // stabilized +} + static FOO: usize = foo(); const BAR: usize = foo(); diff --git a/src/test/ui/feature-gates/feature-gate-min_const_fn.stderr b/src/test/ui/feature-gates/feature-gate-min_const_fn.stderr index 998a2243edcfa..bcc5b0198c319 100644 --- a/src/test/ui/feature-gates/feature-gate-min_const_fn.stderr +++ b/src/test/ui/feature-gates/feature-gate-min_const_fn.stderr @@ -11,7 +11,7 @@ LL | const fn bar() -> u32 { 0 } //~ ERROR const fn is unstable | ^^^^^ trait fns cannot be const error[E0379]: trait fns cannot be declared const - --> $DIR/feature-gate-min_const_fn.rs:17:5 + --> $DIR/feature-gate-min_const_fn.rs:13:5 | LL | const fn foo() -> u32 { 0 } //~ ERROR trait fns cannot be declared const | ^^^^^ trait fns cannot be const diff --git a/src/test/ui/feature-gates/feature-gate-naked_functions.rs b/src/test/ui/feature-gates/feature-gate-naked_functions.rs index 36bc636b0bb7b..16a51a1e82fc6 100644 --- a/src/test/ui/feature-gates/feature-gate-naked_functions.rs +++ b/src/test/ui/feature-gates/feature-gate-naked_functions.rs @@ -7,3 +7,5 @@ fn naked() {} fn naked_2() -> isize { 0 } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-never_type.rs b/src/test/ui/feature-gates/feature-gate-never_type.rs index 44a3bdd2ca36b..be8c27dbb1b02 100644 --- a/src/test/ui/feature-gates/feature-gate-never_type.rs +++ b/src/test/ui/feature-gates/feature-gate-never_type.rs @@ -6,8 +6,8 @@ trait Foo { type Ma = (u32, !, i32); //~ ERROR type is experimental type Meeshka = Vec; //~ ERROR type is experimental -type Mow = &fn(!) -> !; //~ ERROR type is experimental -type Skwoz = &mut !; //~ ERROR type is experimental +type Mow = &'static fn(!) -> !; //~ ERROR type is experimental +type Skwoz = &'static mut !; //~ ERROR type is experimental impl Foo for Meeshka { type Wub = !; //~ ERROR type is experimental diff --git a/src/test/ui/feature-gates/feature-gate-never_type.stderr b/src/test/ui/feature-gates/feature-gate-never_type.stderr index 927758b67b9cc..c4f8771171e8b 100644 --- a/src/test/ui/feature-gates/feature-gate-never_type.stderr +++ b/src/test/ui/feature-gates/feature-gate-never_type.stderr @@ -15,18 +15,18 @@ LL | type Meeshka = Vec; //~ ERROR type is experimental = help: add #![feature(never_type)] to the crate attributes to enable error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:9:16 + --> $DIR/feature-gate-never_type.rs:9:24 | -LL | type Mow = &fn(!) -> !; //~ ERROR type is experimental - | ^ +LL | type Mow = &'static fn(!) -> !; //~ ERROR type is experimental + | ^ | = help: add #![feature(never_type)] to the crate attributes to enable error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:10:19 + --> $DIR/feature-gate-never_type.rs:10:27 | -LL | type Skwoz = &mut !; //~ ERROR type is experimental - | ^ +LL | type Skwoz = &'static mut !; //~ ERROR type is experimental + | ^ | = help: add #![feature(never_type)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-no_core.rs b/src/test/ui/feature-gates/feature-gate-no_core.rs index 03b237867aa91..40178edd74b8d 100644 --- a/src/test/ui/feature-gates/feature-gate-no_core.rs +++ b/src/test/ui/feature-gates/feature-gate-no_core.rs @@ -1,3 +1,5 @@ +#![crate_type = "rlib"] + #![no_core] //~ ERROR no_core is experimental -fn main() {} +pub struct S {} diff --git a/src/test/ui/feature-gates/feature-gate-no_core.stderr b/src/test/ui/feature-gates/feature-gate-no_core.stderr index cb8fe25df58a2..7390051b95da2 100644 --- a/src/test/ui/feature-gates/feature-gate-no_core.stderr +++ b/src/test/ui/feature-gates/feature-gate-no_core.stderr @@ -1,5 +1,5 @@ error[E0658]: no_core is experimental (see issue #29639) - --> $DIR/feature-gate-no_core.rs:1:1 + --> $DIR/feature-gate-no_core.rs:3:1 | LL | #![no_core] //~ ERROR no_core is experimental | ^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs index 9d70cbee53b09..35c05b75d365c 100644 --- a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs +++ b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs @@ -3,14 +3,10 @@ struct DummyStruct; -trait DummyTrait { - fn dummy(&self) {} -} - auto trait AutoDummyTrait {} //~^ ERROR auto traits are experimental and possibly buggy -impl !DummyTrait for DummyStruct {} +impl !AutoDummyTrait for DummyStruct {} //~^ ERROR negative trait bounds are not yet fully implemented; use marker types for now fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr index c523147611a81..e5d0a8681fb45 100644 --- a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr +++ b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr @@ -1,5 +1,5 @@ error[E0658]: auto traits are experimental and possibly buggy (see issue #13231) - --> $DIR/feature-gate-optin-builtin-traits.rs:10:1 + --> $DIR/feature-gate-optin-builtin-traits.rs:6:1 | LL | auto trait AutoDummyTrait {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,10 +7,10 @@ LL | auto trait AutoDummyTrait {} = help: add #![feature(optin_builtin_traits)] to the crate attributes to enable error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now (see issue #13231) - --> $DIR/feature-gate-optin-builtin-traits.rs:13:1 + --> $DIR/feature-gate-optin-builtin-traits.rs:9:1 | -LL | impl !DummyTrait for DummyStruct {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl !AutoDummyTrait for DummyStruct {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(optin_builtin_traits)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-repr-simd.rs b/src/test/ui/feature-gates/feature-gate-repr-simd.rs index 67ae538e22c9d..9d28f437415c9 100644 --- a/src/test/ui/feature-gates/feature-gate-repr-simd.rs +++ b/src/test/ui/feature-gates/feature-gate-repr-simd.rs @@ -1,7 +1,7 @@ #[repr(simd)] //~ error: SIMD types are experimental struct Foo(u64, u64); -#[repr(C)] +#[repr(C)] //~ warn: conflicting representation hints #[repr(simd)] //~ error: SIMD types are experimental struct Bar(u64, u64); diff --git a/src/test/ui/feature-gates/feature-gate-repr-simd.stderr b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr index 161cc67e81344..20cdbceeb689a 100644 --- a/src/test/ui/feature-gates/feature-gate-repr-simd.stderr +++ b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr @@ -14,6 +14,15 @@ LL | #[repr(simd)] //~ error: SIMD types are experimental | = help: add #![feature(repr_simd)] to the crate attributes to enable +warning[E0566]: conflicting representation hints + --> $DIR/feature-gate-repr-simd.rs:4:8 + | +LL | #[repr(C)] //~ warn: conflicting representation hints + | ^ +LL | #[repr(simd)] //~ error: SIMD types are experimental + | ^^^^ + error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0566, E0658. +For more information about an error, try `rustc --explain E0566`. diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.rs b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.rs index f7ff3eb3ac9ff..2b23388fdc96d 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.rs +++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.rs @@ -5,4 +5,4 @@ #[rustc_variance] //~ ERROR the `#[rustc_variance]` attribute is just used for rustc unit tests and will never be stable #[rustc_error] //~ ERROR the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable -fn main() {} +fn main() {} //~ ERROR [] diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr index 2b90699384b48..31e24f5b99f1e 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr +++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr @@ -14,6 +14,13 @@ LL | #[rustc_error] //~ ERROR the `#[rustc_error]` attribute is just used for ru | = help: add #![feature(rustc_attrs)] to the crate attributes to enable -error: aborting due to 2 previous errors +error[E0208]: [] + --> $DIR/feature-gate-rustc-attrs-1.rs:8:1 + | +LL | fn main() {} //~ ERROR [] + | ^^^^^^^^^^^^ + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0208, E0658. +For more information about an error, try `rustc --explain E0208`. diff --git a/src/test/ui/feature-gates/feature-gate-start.rs b/src/test/ui/feature-gates/feature-gate-start.rs index bf097c8203156..46a1279a3fb16 100644 --- a/src/test/ui/feature-gates/feature-gate-start.rs +++ b/src/test/ui/feature-gates/feature-gate-start.rs @@ -1,2 +1,3 @@ #[start] -fn foo() {} //~ ERROR: a #[start] function is an experimental feature +fn foo(_: isize, _: *const *const u8) -> isize { 0 } +//~^ ERROR a #[start] function is an experimental feature diff --git a/src/test/ui/feature-gates/feature-gate-start.stderr b/src/test/ui/feature-gates/feature-gate-start.stderr index 255703d767388..d39e5f3555537 100644 --- a/src/test/ui/feature-gates/feature-gate-start.stderr +++ b/src/test/ui/feature-gates/feature-gate-start.stderr @@ -1,8 +1,8 @@ error[E0658]: a #[start] function is an experimental feature whose signature may change over time (see issue #29633) --> $DIR/feature-gate-start.rs:2:1 | -LL | fn foo() {} //~ ERROR: a #[start] function is an experimental feature - | ^^^^^^^^^^^ +LL | fn foo(_: isize, _: *const *const u8) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(start)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-thread_local.rs b/src/test/ui/feature-gates/feature-gate-thread_local.rs index c47bdc1006c72..0efae1f6bc356 100644 --- a/src/test/ui/feature-gates/feature-gate-thread_local.rs +++ b/src/test/ui/feature-gates/feature-gate-thread_local.rs @@ -8,8 +8,4 @@ #[thread_local] //~ ERROR `#[thread_local]` is an experimental feature static FOO: i32 = 3; -pub fn main() { - FOO.with(|x| { - println!("x: {}", x); - }); -} +pub fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs index fc5902721d788..ff6e2b8290389 100644 --- a/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs +++ b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs @@ -3,25 +3,29 @@ // never triggers (yet), because they encounter other problems around // angle bracket vs parentheses notation. -#![allow(dead_code)] +#![feature(fn_traits)] struct Foo; impl Fn<()> for Foo { +//~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change extern "rust-call" fn call(self, args: ()) -> () {} //~^ ERROR rust-call ABI is subject to change } struct Foo1; impl FnOnce() for Foo1 { +//~^ ERROR associated type bindings are not allowed here extern "rust-call" fn call_once(self, args: ()) -> () {} //~^ ERROR rust-call ABI is subject to change } struct Bar; impl FnMut<()> for Bar { +//~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change extern "rust-call" fn call_mut(&self, args: ()) -> () {} //~^ ERROR rust-call ABI is subject to change } struct Baz; impl FnOnce<()> for Baz { +//~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change extern "rust-call" fn call_once(&self, args: ()) -> () {} //~^ ERROR rust-call ABI is subject to change } diff --git a/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr index 0e40e1fddb0c7..865b87e7dd5d7 100644 --- a/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr +++ b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr @@ -1,5 +1,5 @@ error[E0658]: rust-call ABI is subject to change (see issue #29625) - --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:10:5 + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:11:5 | LL | extern "rust-call" fn call(self, args: ()) -> () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | extern "rust-call" fn call(self, args: ()) -> () {} = help: add #![feature(unboxed_closures)] to the crate attributes to enable error[E0658]: rust-call ABI is subject to change (see issue #29625) - --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:15:5 + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:17:5 | LL | extern "rust-call" fn call_once(self, args: ()) -> () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | extern "rust-call" fn call_once(self, args: ()) -> () {} = help: add #![feature(unboxed_closures)] to the crate attributes to enable error[E0658]: rust-call ABI is subject to change (see issue #29625) - --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:20:5 + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:23:5 | LL | extern "rust-call" fn call_mut(&self, args: ()) -> () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,13 +23,44 @@ LL | extern "rust-call" fn call_mut(&self, args: ()) -> () {} = help: add #![feature(unboxed_closures)] to the crate attributes to enable error[E0658]: rust-call ABI is subject to change (see issue #29625) - --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:25:5 + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:29:5 | LL | extern "rust-call" fn call_once(&self, args: ()) -> () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(unboxed_closures)] to the crate attributes to enable -error: aborting due to 4 previous errors +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:9:6 + | +LL | impl Fn<()> for Foo { + | ^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error[E0229]: associated type bindings are not allowed here + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:15:12 + | +LL | impl FnOnce() for Foo1 { + | ^^ associated type not allowed here + +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:21:6 + | +LL | impl FnMut<()> for Bar { + | ^^^^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:27:6 + | +LL | impl FnOnce<()> for Baz { + | ^^^^^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error: aborting due to 8 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0229, E0658. +For more information about an error, try `rustc --explain E0229`. diff --git a/src/test/ui/feature-gates/feature-gate-unboxed-closures.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures.rs index 4c0d7d14a5064..c3f5c99dcb482 100644 --- a/src/test/ui/feature-gates/feature-gate-unboxed-closures.rs +++ b/src/test/ui/feature-gates/feature-gate-unboxed-closures.rs @@ -1,6 +1,9 @@ +#![feature(fn_traits)] + struct Test; impl FnOnce<(u32, u32)> for Test { +//~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change type Output = u32; extern "rust-call" fn call_once(self, (a, b): (u32, u32)) -> u32 { diff --git a/src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr index 420b331ccccb3..e7b1fc589bb4a 100644 --- a/src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr +++ b/src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr @@ -1,5 +1,5 @@ error[E0658]: rust-call ABI is subject to change (see issue #29625) - --> $DIR/feature-gate-unboxed-closures.rs:6:5 + --> $DIR/feature-gate-unboxed-closures.rs:9:5 | LL | / extern "rust-call" fn call_once(self, (a, b): (u32, u32)) -> u32 { LL | | a + b @@ -8,6 +8,14 @@ LL | | } | = help: add #![feature(unboxed_closures)] to the crate attributes to enable -error: aborting due to previous error +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/feature-gate-unboxed-closures.rs:5:6 + | +LL | impl FnOnce<(u32, u32)> for Test { + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.rs b/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.rs deleted file mode 100644 index 181c8592c547b..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![feature(custom_attribute)] - -#[my_attr(a b c d)] -//~^ ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `b` -//~| ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `c` -//~| ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `d` -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.stderr b/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.stderr deleted file mode 100644 index 1ddf2ff6d640b..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-unrestricted-attribute-tokens.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: expected one of `(`, `)`, `,`, `::`, or `=`, found `b` - --> $DIR/feature-gate-unrestricted-attribute-tokens.rs:3:13 - | -LL | #[my_attr(a b c d)] - | ^ expected one of `(`, `)`, `,`, `::`, or `=` here - -error: expected one of `(`, `)`, `,`, `::`, or `=`, found `c` - --> $DIR/feature-gate-unrestricted-attribute-tokens.rs:3:15 - | -LL | #[my_attr(a b c d)] - | ^ expected one of `(`, `)`, `,`, `::`, or `=` here - -error: expected one of `(`, `)`, `,`, `::`, or `=`, found `d` - --> $DIR/feature-gate-unrestricted-attribute-tokens.rs:3:17 - | -LL | #[my_attr(a b c d)] - | ^ expected one of `(`, `)`, `,`, `::`, or `=` here - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs index 6dda2c5551358..e0cb9c882192b 100644 --- a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs +++ b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs @@ -8,7 +8,7 @@ extern { fn extern_fn(); // CHECK-NOT: Function Attrs: nounwind // CHECK: declare void @unwinding_extern_fn - #[unwind] //~ ERROR #[unwind] is experimental + #[unwind(allowed)] //~ ERROR #[unwind] is experimental fn unwinding_extern_fn(); } diff --git a/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr b/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr index e558712afd13b..918d40d681bb4 100644 --- a/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr +++ b/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr @@ -1,8 +1,8 @@ error[E0658]: #[unwind] is experimental --> $DIR/feature-gate-unwind-attributes.rs:11:5 | -LL | #[unwind] //~ ERROR #[unwind] is experimental - | ^^^^^^^^^ +LL | #[unwind(allowed)] //~ ERROR #[unwind] is experimental + | ^^^^^^^^^^^^^^^^^^ | = help: add #![feature(unwind_attributes)] to the crate attributes to enable diff --git a/src/test/ui/gated-bad-feature.rs b/src/test/ui/gated-bad-feature.rs index 0782fe4c108f7..6a83b9dcad0de 100644 --- a/src/test/ui/gated-bad-feature.rs +++ b/src/test/ui/gated-bad-feature.rs @@ -6,8 +6,8 @@ //~^^^ ERROR: malformed feature //~^^^ ERROR: malformed feature -#![feature] //~ ERROR: malformed feature -#![feature = "foo"] //~ ERROR: malformed feature +#![feature] //~ ERROR: attribute must be of the form `#[feature(...)]` +#![feature = "foo"] //~ ERROR: attribute must be of the form `#[feature(...)]` #![feature(test_removed_feature)] //~ ERROR: feature has been removed diff --git a/src/test/ui/gated-bad-feature.stderr b/src/test/ui/gated-bad-feature.stderr index a8c35dd6b086c..1c505bde149aa 100644 --- a/src/test/ui/gated-bad-feature.stderr +++ b/src/test/ui/gated-bad-feature.stderr @@ -10,25 +10,25 @@ error[E0556]: malformed feature, expected just one word LL | foo = "baz" | ^^^^^^^^^^^ -error[E0555]: malformed feature attribute, expected #![feature(...)] +error[E0557]: feature has been removed + --> $DIR/gated-bad-feature.rs:12:12 + | +LL | #![feature(test_removed_feature)] //~ ERROR: feature has been removed + | ^^^^^^^^^^^^^^^^^^^^ + +error: attribute must be of the form `#[feature(...)]` --> $DIR/gated-bad-feature.rs:9:1 | -LL | #![feature] //~ ERROR: malformed feature +LL | #![feature] //~ ERROR: attribute must be of the form `#[feature(...)]` | ^^^^^^^^^^^ -error[E0555]: malformed feature attribute, expected #![feature(...)] +error: attribute must be of the form `#[feature(...)]` --> $DIR/gated-bad-feature.rs:10:1 | -LL | #![feature = "foo"] //~ ERROR: malformed feature +LL | #![feature = "foo"] //~ ERROR: attribute must be of the form `#[feature(...)]` | ^^^^^^^^^^^^^^^^^^^ -error[E0557]: feature has been removed - --> $DIR/gated-bad-feature.rs:12:12 - | -LL | #![feature(test_removed_feature)] //~ ERROR: feature has been removed - | ^^^^^^^^^^^^^^^^^^^^ - error: aborting due to 5 previous errors -Some errors occurred: E0555, E0556, E0557. -For more information about an error, try `rustc --explain E0555`. +Some errors occurred: E0556, E0557. +For more information about an error, try `rustc --explain E0556`. diff --git a/src/test/ui/invalid_crate_type_syntax.rs b/src/test/ui/invalid_crate_type_syntax.rs index eae4fad5b4fa7..35d6bf41ae691 100644 --- a/src/test/ui/invalid_crate_type_syntax.rs +++ b/src/test/ui/invalid_crate_type_syntax.rs @@ -1,5 +1,5 @@ // regression test for issue 16974 -#![crate_type(lib)] //~ ERROR `crate_type` requires a value +#![crate_type(lib)] //~ ERROR attribute must be of the form `#[crate_type = "..."]` fn my_lib_fn() {} diff --git a/src/test/ui/invalid_crate_type_syntax.stderr b/src/test/ui/invalid_crate_type_syntax.stderr index 8494f718817f3..9bc3d559f48d6 100644 --- a/src/test/ui/invalid_crate_type_syntax.stderr +++ b/src/test/ui/invalid_crate_type_syntax.stderr @@ -1,10 +1,8 @@ -error: `crate_type` requires a value +error: attribute must be of the form `#[crate_type = "..."]` --> $DIR/invalid_crate_type_syntax.rs:2:1 | -LL | #![crate_type(lib)] //~ ERROR `crate_type` requires a value +LL | #![crate_type(lib)] //~ ERROR attribute must be of the form `#[crate_type = "..."]` | ^^^^^^^^^^^^^^^^^^^ - | - = note: for example: `#![crate_type="lib"]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-43988.rs b/src/test/ui/issues/issue-43988.rs index b2a203546fe07..31b1dd006299b 100644 --- a/src/test/ui/issues/issue-43988.rs +++ b/src/test/ui/issues/issue-43988.rs @@ -24,6 +24,7 @@ fn main() { #[repr] let _y = "123"; //~^^ ERROR attribute should not be applied to a statement + //~| ERROR attribute must be of the form `#[repr(...)]` //~| WARN `repr` attribute must have a hint @@ -35,5 +36,6 @@ fn main() { let _z = #[repr] 1; //~^ ERROR attribute should not be applied to an expression + //~| ERROR attribute must be of the form `#[repr(...)]` //~| WARN `repr` attribute must have a hint } diff --git a/src/test/ui/issues/issue-43988.stderr b/src/test/ui/issues/issue-43988.stderr index 811816d0087b8..1c6eaa732c3cc 100644 --- a/src/test/ui/issues/issue-43988.stderr +++ b/src/test/ui/issues/issue-43988.stderr @@ -1,3 +1,15 @@ +error: attribute must be of the form `#[repr(...)]` + --> $DIR/issue-43988.rs:24:5 + | +LL | #[repr] + | ^^^^^^^ + +error: attribute must be of the form `#[repr(...)]` + --> $DIR/issue-43988.rs:37:14 + | +LL | let _z = #[repr] 1; + | ^^^^^^^ + warning: `repr` attribute must have a hint --> $DIR/issue-43988.rs:24:5 | @@ -9,7 +21,7 @@ LL | #[repr] = note: for more information, visit warning: `repr` attribute must have a hint - --> $DIR/issue-43988.rs:36:14 + --> $DIR/issue-43988.rs:37:14 | LL | let _z = #[repr] 1; | ^^^^^^^ needs a hint @@ -60,7 +72,7 @@ LL | let _y = "123"; | --------------- not a struct, enum or union error[E0518]: attribute should be applied to function or closure - --> $DIR/issue-43988.rs:32:5 + --> $DIR/issue-43988.rs:33:5 | LL | #[inline(ABC)] | ^^^^^^^^^^^^^^ @@ -68,12 +80,12 @@ LL | foo(); | ----- not a function or closure error[E0517]: attribute should not be applied to an expression - --> $DIR/issue-43988.rs:36:14 + --> $DIR/issue-43988.rs:37:14 | LL | let _z = #[repr] 1; | ^^^^^^^ - not defining a struct, enum or union -error: aborting due to 7 previous errors +error: aborting due to 9 previous errors Some errors occurred: E0517, E0518. For more information about an error, try `rustc --explain E0517`. diff --git a/src/test/ui/issues/issue-51279.rs b/src/test/ui/issues/issue-51279.rs index ad5438fbd46cb..f8f3626caabe7 100644 --- a/src/test/ui/issues/issue-51279.rs +++ b/src/test/ui/issues/issue-51279.rs @@ -15,7 +15,7 @@ pub struct Y<#[cfg(none)] T>(T); // shouldn't care when the entire item is strip struct M(*const T); -unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M { +impl<#[cfg_attr(none, may_dangle)] T> Drop for M { //~^ ERROR #[cfg_attr] cannot be applied on a generic parameter fn drop(&mut self) {} } @@ -23,3 +23,5 @@ unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M { type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; //~^ ERROR #[cfg] cannot be applied on a generic parameter //~| ERROR attribute `ignored` is currently unknown to the compiler + +fn main() {} diff --git a/src/test/ui/issues/issue-51279.stderr b/src/test/ui/issues/issue-51279.stderr index 1706e98e83b63..bc33eacac9994 100644 --- a/src/test/ui/issues/issue-51279.stderr +++ b/src/test/ui/issues/issue-51279.stderr @@ -35,10 +35,10 @@ LL | pub fn f<#[cfg(none)] 'a, #[cfg(none)] T>(_: &'a T) {} | ^^^^^^^^^^^^ error: #[cfg_attr] cannot be applied on a generic parameter - --> $DIR/issue-51279.rs:18:13 + --> $DIR/issue-51279.rs:18:6 | -LL | unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<#[cfg_attr(none, may_dangle)] T> Drop for M { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: #[cfg] cannot be applied on a generic parameter --> $DIR/issue-51279.rs:23:23 diff --git a/src/test/ui/lint/lint-malformed.rs b/src/test/ui/lint/lint-malformed.rs index e9232497c3f04..709e2104e9f15 100644 --- a/src/test/ui/lint/lint-malformed.rs +++ b/src/test/ui/lint/lint-malformed.rs @@ -1,4 +1,4 @@ -#![deny = "foo"] //~ ERROR malformed lint attribute +#![deny = "foo"] //~ ERROR attribute must be of the form `#[deny(...)]` #![allow(bar = "baz")] //~ ERROR malformed lint attribute fn main() { } diff --git a/src/test/ui/lint/lint-malformed.stderr b/src/test/ui/lint/lint-malformed.stderr index 554b0250d0a1e..685785d58823b 100644 --- a/src/test/ui/lint/lint-malformed.stderr +++ b/src/test/ui/lint/lint-malformed.stderr @@ -1,15 +1,15 @@ -error[E0452]: malformed lint attribute - --> $DIR/lint-malformed.rs:1:1 - | -LL | #![deny = "foo"] //~ ERROR malformed lint attribute - | ^^^^^^^^^^^^^^^^ - error[E0452]: malformed lint attribute --> $DIR/lint-malformed.rs:2:10 | LL | #![allow(bar = "baz")] //~ ERROR malformed lint attribute | ^^^^^^^^^^^ +error: attribute must be of the form `#[deny(...)]` + --> $DIR/lint-malformed.rs:1:1 + | +LL | #![deny = "foo"] //~ ERROR attribute must be of the form `#[deny(...)]` + | ^^^^^^^^^^^^^^^^ + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0452`. diff --git a/src/test/ui/macros/macro-attribute.rs b/src/test/ui/macros/macro-attribute.rs index 7ddac2745c5a4..f580dfa8e34ed 100644 --- a/src/test/ui/macros/macro-attribute.rs +++ b/src/test/ui/macros/macro-attribute.rs @@ -1,4 +1,2 @@ -#![feature(unrestricted_attribute_tokens)] - -#[doc = $not_there] //~ ERROR expected `]`, found `not_there` +#[doc = $not_there] //~ ERROR unexpected token: `$` fn main() { } diff --git a/src/test/ui/macros/macro-attribute.stderr b/src/test/ui/macros/macro-attribute.stderr index fd4e7252d530d..7314e48334893 100644 --- a/src/test/ui/macros/macro-attribute.stderr +++ b/src/test/ui/macros/macro-attribute.stderr @@ -1,8 +1,8 @@ -error: expected `]`, found `not_there` - --> $DIR/macro-attribute.rs:3:10 +error: unexpected token: `$` + --> $DIR/macro-attribute.rs:1:7 | -LL | #[doc = $not_there] //~ ERROR expected `]`, found `not_there` - | ^^^^^^^^^ expected `]` +LL | #[doc = $not_there] //~ ERROR unexpected token: `$` + | ^ error: aborting due to previous error diff --git a/src/test/ui/malformed/malformed-derive-entry.rs b/src/test/ui/malformed/malformed-derive-entry.rs index 2c8ebc497728b..f0257462f6130 100644 --- a/src/test/ui/malformed/malformed-derive-entry.rs +++ b/src/test/ui/malformed/malformed-derive-entry.rs @@ -11,7 +11,7 @@ struct Test2; struct Test3; #[derive] -//~^ WARNING empty trait list +//~^ ERROR attribute must be of the form `#[derive(...)]` struct Test4; fn main() {} diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr index b3474220eec02..7c9a811f6f119 100644 --- a/src/test/ui/malformed/malformed-derive-entry.stderr +++ b/src/test/ui/malformed/malformed-derive-entry.stderr @@ -16,11 +16,11 @@ warning: empty trait list in `derive` LL | #[derive()] | ^^^^^^^^^^^ -warning: empty trait list in `derive` +error: attribute must be of the form `#[derive(...)]` --> $DIR/malformed-derive-entry.rs:13:1 | LL | #[derive] | ^^^^^^^^^ -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors diff --git a/src/test/ui/malformed/malformed-interpolated.rs b/src/test/ui/malformed/malformed-interpolated.rs new file mode 100644 index 0000000000000..e452435968bac --- /dev/null +++ b/src/test/ui/malformed/malformed-interpolated.rs @@ -0,0 +1,18 @@ +#![feature(custom_attribute)] + +macro_rules! check { + ($expr: expr) => ( + #[my_attr = $expr] //~ ERROR suffixed literals are not allowed in attributes + //~| ERROR unexpected token: `-0` + //~| ERROR unexpected token: `0 + 0` + use main as _; + ); +} + +check!("0"); // OK +check!(0); // OK +check!(0u8); // ERROR, see above +check!(-0); // ERROR, see above +check!(0 + 0); // ERROR, see above + +fn main() {} diff --git a/src/test/ui/malformed/malformed-interpolated.stderr b/src/test/ui/malformed/malformed-interpolated.stderr new file mode 100644 index 0000000000000..24aa590c4d903 --- /dev/null +++ b/src/test/ui/malformed/malformed-interpolated.stderr @@ -0,0 +1,31 @@ +error: suffixed literals are not allowed in attributes + --> $DIR/malformed-interpolated.rs:5:21 + | +LL | #[my_attr = $expr] //~ ERROR suffixed literals are not allowed in attributes + | ^^^^^ +... +LL | check!(0u8); // ERROR, see above + | ------------ in this macro invocation + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: unexpected token: `-0` + --> $DIR/malformed-interpolated.rs:5:19 + | +LL | #[my_attr = $expr] //~ ERROR suffixed literals are not allowed in attributes + | ^ +... +LL | check!(-0); // ERROR, see above + | ----------- in this macro invocation + +error: unexpected token: `0 + 0` + --> $DIR/malformed-interpolated.rs:5:19 + | +LL | #[my_attr = $expr] //~ ERROR suffixed literals are not allowed in attributes + | ^ +... +LL | check!(0 + 0); // ERROR, see above + | -------------- in this macro invocation + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/malformed/malformed-plugin-1.rs b/src/test/ui/malformed/malformed-plugin-1.rs index c5a251d28fa58..841a0000b197b 100644 --- a/src/test/ui/malformed/malformed-plugin-1.rs +++ b/src/test/ui/malformed/malformed-plugin-1.rs @@ -1,4 +1,4 @@ #![feature(plugin)] -#![plugin] //~ ERROR malformed plugin attribute +#![plugin] //~ ERROR attribute must be of the form `#[plugin(...)]` fn main() {} diff --git a/src/test/ui/malformed/malformed-plugin-1.stderr b/src/test/ui/malformed/malformed-plugin-1.stderr index 4124fd6e4a6d4..0592bde826ad4 100644 --- a/src/test/ui/malformed/malformed-plugin-1.stderr +++ b/src/test/ui/malformed/malformed-plugin-1.stderr @@ -1,9 +1,8 @@ -error[E0498]: malformed plugin attribute +error: attribute must be of the form `#[plugin(...)]` --> $DIR/malformed-plugin-1.rs:2:1 | -LL | #![plugin] //~ ERROR malformed plugin attribute +LL | #![plugin] //~ ERROR attribute must be of the form `#[plugin(...)]` | ^^^^^^^^^^ error: aborting due to previous error -For more information about this error, try `rustc --explain E0498`. diff --git a/src/test/ui/malformed/malformed-plugin-2.rs b/src/test/ui/malformed/malformed-plugin-2.rs index 96a3138e712ca..1d0cd905c9d9f 100644 --- a/src/test/ui/malformed/malformed-plugin-2.rs +++ b/src/test/ui/malformed/malformed-plugin-2.rs @@ -1,4 +1,4 @@ #![feature(plugin)] -#![plugin="bleh"] //~ ERROR malformed plugin attribute +#![plugin="bleh"] //~ ERROR attribute must be of the form `#[plugin(...)]` fn main() {} diff --git a/src/test/ui/malformed/malformed-plugin-2.stderr b/src/test/ui/malformed/malformed-plugin-2.stderr index 308db46b6fc9f..d287d683423eb 100644 --- a/src/test/ui/malformed/malformed-plugin-2.stderr +++ b/src/test/ui/malformed/malformed-plugin-2.stderr @@ -1,9 +1,8 @@ -error[E0498]: malformed plugin attribute +error: attribute must be of the form `#[plugin(...)]` --> $DIR/malformed-plugin-2.rs:2:1 | -LL | #![plugin="bleh"] //~ ERROR malformed plugin attribute +LL | #![plugin="bleh"] //~ ERROR attribute must be of the form `#[plugin(...)]` | ^^^^^^^^^^^^^^^^^ error: aborting due to previous error -For more information about this error, try `rustc --explain E0498`. diff --git a/src/test/ui/malformed/malformed-special-attrs.rs b/src/test/ui/malformed/malformed-special-attrs.rs new file mode 100644 index 0000000000000..0dadc2e0048c1 --- /dev/null +++ b/src/test/ui/malformed/malformed-special-attrs.rs @@ -0,0 +1,13 @@ +#[cfg_attr] //~ ERROR expected `(`, found `` +struct S1; + +#[cfg_attr = ""] //~ ERROR expected `(`, found `=` +struct S2; + +#[derive] //~ ERROR attribute must be of the form `#[derive(...)]` +struct S3; + +#[derive = ""] //~ ERROR attribute must be of the form `#[derive(...)]` +struct S4; + +fn main() {} diff --git a/src/test/ui/malformed/malformed-special-attrs.stderr b/src/test/ui/malformed/malformed-special-attrs.stderr new file mode 100644 index 0000000000000..d2b4660bbbffe --- /dev/null +++ b/src/test/ui/malformed/malformed-special-attrs.stderr @@ -0,0 +1,25 @@ +error: expected `(`, found `` + +error: expected `(`, found `=` + --> $DIR/malformed-special-attrs.rs:4:12 + | +LL | #[cfg_attr] //~ ERROR expected `(`, found `` + | - expected `(` +... +LL | #[cfg_attr = ""] //~ ERROR expected `(`, found `=` + | ^ unexpected token + +error: attribute must be of the form `#[derive(...)]` + --> $DIR/malformed-special-attrs.rs:7:1 + | +LL | #[derive] //~ ERROR attribute must be of the form `#[derive(...)]` + | ^^^^^^^^^ + +error: attribute must be of the form `#[derive(...)]` + --> $DIR/malformed-special-attrs.rs:10:1 + | +LL | #[derive = ""] //~ ERROR attribute must be of the form `#[derive(...)]` + | ^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/ui/marker_trait_attr/marker-attribute-with-values.rs b/src/test/ui/marker_trait_attr/marker-attribute-with-values.rs index 4756bb11455c5..5d3b07d238d18 100644 --- a/src/test/ui/marker_trait_attr/marker-attribute-with-values.rs +++ b/src/test/ui/marker_trait_attr/marker-attribute-with-values.rs @@ -1,16 +1,15 @@ #![feature(marker_trait_attr)] -#![feature(unrestricted_attribute_tokens)] #[marker(always)] trait Marker1 {} -//~^^ ERROR attribute should be empty +//~^^ ERROR attribute must be of the form `#[marker]` #[marker("never")] trait Marker2 {} -//~^^ ERROR attribute should be empty +//~^^ ERROR attribute must be of the form `#[marker]` #[marker(key = value)] trait Marker3 {} -//~^^ ERROR attribute should be empty +//~^^ ERROR expected unsuffixed literal or identifier, found value fn main() {} diff --git a/src/test/ui/marker_trait_attr/marker-attribute-with-values.stderr b/src/test/ui/marker_trait_attr/marker-attribute-with-values.stderr index e7c1e90df33db..62c22a3e9f1ec 100644 --- a/src/test/ui/marker_trait_attr/marker-attribute-with-values.stderr +++ b/src/test/ui/marker_trait_attr/marker-attribute-with-values.stderr @@ -1,20 +1,20 @@ -error: attribute should be empty - --> $DIR/marker-attribute-with-values.rs:4:1 +error: attribute must be of the form `#[marker]` + --> $DIR/marker-attribute-with-values.rs:3:1 | LL | #[marker(always)] | ^^^^^^^^^^^^^^^^^ -error: attribute should be empty - --> $DIR/marker-attribute-with-values.rs:8:1 +error: attribute must be of the form `#[marker]` + --> $DIR/marker-attribute-with-values.rs:7:1 | LL | #[marker("never")] | ^^^^^^^^^^^^^^^^^^ -error: attribute should be empty - --> $DIR/marker-attribute-with-values.rs:12:1 +error: expected unsuffixed literal or identifier, found value + --> $DIR/marker-attribute-with-values.rs:11:10 | LL | #[marker(key = value)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/nll/user-annotations/normalization.rs b/src/test/ui/nll/user-annotations/normalization.rs index 51d9adccd7372..e0af2e67e1836 100644 --- a/src/test/ui/nll/user-annotations/normalization.rs +++ b/src/test/ui/nll/user-annotations/normalization.rs @@ -2,7 +2,6 @@ // after normalization. #![feature(nll)] -#![ignore(unused)] trait Foo { type Out; } impl Foo for () { type Out = &'static u32; } diff --git a/src/test/ui/nll/user-annotations/normalization.stderr b/src/test/ui/nll/user-annotations/normalization.stderr index b059d5aa89ad0..71bf8507a735f 100644 --- a/src/test/ui/nll/user-annotations/normalization.stderr +++ b/src/test/ui/nll/user-annotations/normalization.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/normalization.rs:12:31 + --> $DIR/normalization.rs:11:31 | LL | let b: <() as Foo>::Out = &a; //~ ERROR | ---------------- ^^ borrowed value does not live long enough diff --git a/src/test/ui/no_crate_type.rs b/src/test/ui/no_crate_type.rs index 43efdac5e8c74..13c2493d9247f 100644 --- a/src/test/ui/no_crate_type.rs +++ b/src/test/ui/no_crate_type.rs @@ -1,5 +1,5 @@ // regression test for issue 11256 -#![crate_type] //~ ERROR `crate_type` requires a value +#![crate_type] //~ ERROR attribute must be of the form `#[crate_type = "..."]` fn main() { return diff --git a/src/test/ui/no_crate_type.stderr b/src/test/ui/no_crate_type.stderr index 9d691f3eb54ca..f11540e464da1 100644 --- a/src/test/ui/no_crate_type.stderr +++ b/src/test/ui/no_crate_type.stderr @@ -1,10 +1,8 @@ -error: `crate_type` requires a value +error: attribute must be of the form `#[crate_type = "..."]` --> $DIR/no_crate_type.rs:2:1 | -LL | #![crate_type] //~ ERROR `crate_type` requires a value +LL | #![crate_type] //~ ERROR attribute must be of the form `#[crate_type = "..."]` | ^^^^^^^^^^^^^^ - | - = note: for example: `#![crate_type="lib"]` error: aborting due to previous error diff --git a/src/test/ui/on-unimplemented/bad-annotation.rs b/src/test/ui/on-unimplemented/bad-annotation.rs index e5e921ca28f95..35f3fb41f7046 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.rs +++ b/src/test/ui/on-unimplemented/bad-annotation.rs @@ -14,7 +14,8 @@ trait MyFromIterator { fn my_from_iter>(iterator: T) -> Self; } -#[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value +#[rustc_on_unimplemented] +//~^ ERROR attribute must be of the form `#[rustc_on_unimplemented(...)]` or `#[rustc_on_unimplemented = "..."]` trait BadAnnotation1 {} diff --git a/src/test/ui/on-unimplemented/bad-annotation.stderr b/src/test/ui/on-unimplemented/bad-annotation.stderr index 70f693253ee08..50616c931acc7 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.stderr +++ b/src/test/ui/on-unimplemented/bad-annotation.stderr @@ -1,25 +1,23 @@ -error[E0232]: `#[rustc_on_unimplemented]` requires a value +error: attribute must be of the form `#[rustc_on_unimplemented(...)]` or `#[rustc_on_unimplemented = "..."]` --> $DIR/bad-annotation.rs:17:1 | -LL | #[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value - | ^^^^^^^^^^^^^^^^^^^^^^^^^ value required here - | - = note: eg `#[rustc_on_unimplemented(message="foo")]` +LL | #[rustc_on_unimplemented] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0230]: there is no parameter `C` on trait `BadAnnotation2` - --> $DIR/bad-annotation.rs:21:1 + --> $DIR/bad-annotation.rs:22:1 | LL | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0231]: only named substitution parameters are allowed - --> $DIR/bad-annotation.rs:26:1 + --> $DIR/bad-annotation.rs:27:1 | LL | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:31:26 + --> $DIR/bad-annotation.rs:32:26 | LL | #[rustc_on_unimplemented(lorem="")] | ^^^^^^^^ expected value here @@ -27,7 +25,7 @@ LL | #[rustc_on_unimplemented(lorem="")] = note: eg `#[rustc_on_unimplemented(message="foo")]` error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:35:26 + --> $DIR/bad-annotation.rs:36:26 | LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] | ^^^^^^^^^^^^^^^^^^^ expected value here @@ -35,7 +33,7 @@ LL | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] = note: eg `#[rustc_on_unimplemented(message="foo")]` error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:39:39 + --> $DIR/bad-annotation.rs:40:39 | LL | #[rustc_on_unimplemented(message="x", message="y")] | ^^^^^^^^^^^ expected value here @@ -43,7 +41,7 @@ LL | #[rustc_on_unimplemented(message="x", message="y")] = note: eg `#[rustc_on_unimplemented(message="foo")]` error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:43:39 + --> $DIR/bad-annotation.rs:44:39 | LL | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here @@ -51,13 +49,13 @@ LL | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))] = note: eg `#[rustc_on_unimplemented(message="foo")]` error[E0232]: empty `on`-clause in `#[rustc_on_unimplemented]` - --> $DIR/bad-annotation.rs:47:26 + --> $DIR/bad-annotation.rs:48:26 | LL | #[rustc_on_unimplemented(on(), message="y")] | ^^^^ empty on-clause here error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:51:26 + --> $DIR/bad-annotation.rs:52:26 | LL | #[rustc_on_unimplemented(on="x", message="y")] | ^^^^^^ expected value here @@ -65,7 +63,7 @@ LL | #[rustc_on_unimplemented(on="x", message="y")] = note: eg `#[rustc_on_unimplemented(message="foo")]` error[E0232]: this attribute must have a valid value - --> $DIR/bad-annotation.rs:58:40 + --> $DIR/bad-annotation.rs:59:40 | LL | #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.rs b/src/test/ui/on-unimplemented/expected-comma-found-token.rs index a3e6609f98215..d8717f360e9d2 100644 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.rs +++ b/src/test/ui/on-unimplemented/expected-comma-found-token.rs @@ -6,9 +6,8 @@ #[rustc_on_unimplemented( message="the message" - label="the label" + label="the label" //~ ERROR expected one of `)` or `,`, found `label` )] trait T {} -//~^^^ ERROR expected one of `)` or `,`, found `label` fn main() { } diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr b/src/test/ui/on-unimplemented/expected-comma-found-token.stderr index 5bbdbe29416c1..1e0808e1d8408 100644 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr +++ b/src/test/ui/on-unimplemented/expected-comma-found-token.stderr @@ -3,7 +3,7 @@ error: expected one of `)` or `,`, found `label` | LL | message="the message" | - expected one of `)` or `,` here -LL | label="the label" +LL | label="the label" //~ ERROR expected one of `)` or `,`, found `label` | ^^^^^ unexpected token error: aborting due to previous error diff --git a/src/test/ui/parser/attr-bad-meta-2.stderr b/src/test/ui/parser/attr-bad-meta-2.stderr index 1c1c2762e47bd..f7354b4ba5ba0 100644 --- a/src/test/ui/parser/attr-bad-meta-2.stderr +++ b/src/test/ui/parser/attr-bad-meta-2.stderr @@ -1,8 +1,8 @@ error: unexpected token: `]` - --> $DIR/attr-bad-meta-2.rs:3:9 + --> $DIR/attr-bad-meta-2.rs:3:8 | LL | #[path =] //~ ERROR unexpected token: `]` - | ^ unexpected token after this + | ^ error: aborting due to previous error diff --git a/src/test/ui/parser/attr-bad-meta.rs b/src/test/ui/parser/attr-bad-meta.rs index 28d5cea05abe2..eb8f559dc0db2 100644 --- a/src/test/ui/parser/attr-bad-meta.rs +++ b/src/test/ui/parser/attr-bad-meta.rs @@ -1,6 +1,4 @@ // compile-flags: -Z parse-only -#![feature(unrestricted_attribute_tokens)] - #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` mod m {} diff --git a/src/test/ui/parser/attr-bad-meta.stderr b/src/test/ui/parser/attr-bad-meta.stderr index f29c14ab353d9..7351702ec9dce 100644 --- a/src/test/ui/parser/attr-bad-meta.stderr +++ b/src/test/ui/parser/attr-bad-meta.stderr @@ -1,5 +1,5 @@ error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` - --> $DIR/attr-bad-meta.rs:5:7 + --> $DIR/attr-bad-meta.rs:3:7 | LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*` | ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here diff --git a/src/test/ui/proc-macro/attribute.rs b/src/test/ui/proc-macro/attribute.rs index 736030fca39b7..1ef8d816b1b52 100644 --- a/src/test/ui/proc-macro/attribute.rs +++ b/src/test/ui/proc-macro/attribute.rs @@ -6,13 +6,13 @@ extern crate proc_macro; #[proc_macro_derive] -//~^ ERROR: attribute must be of form: #[proc_macro_derive(TraitName)] +//~^ ERROR: attribute must be of the form `#[proc_macro_derive(...)]` pub fn foo1(input: proc_macro::TokenStream) -> proc_macro::TokenStream { input } #[proc_macro_derive = "foo"] -//~^ ERROR: attribute must be of form: #[proc_macro_derive(TraitName)] +//~^ ERROR: attribute must be of the form `#[proc_macro_derive(...)]` pub fn foo2(input: proc_macro::TokenStream) -> proc_macro::TokenStream { input } diff --git a/src/test/ui/proc-macro/attribute.stderr b/src/test/ui/proc-macro/attribute.stderr index a8fecd2d2dea8..b3e7758628723 100644 --- a/src/test/ui/proc-macro/attribute.stderr +++ b/src/test/ui/proc-macro/attribute.stderr @@ -1,15 +1,3 @@ -error: attribute must be of form: #[proc_macro_derive(TraitName)] - --> $DIR/attribute.rs:8:1 - | -LL | #[proc_macro_derive] - | ^^^^^^^^^^^^^^^^^^^^ - -error: attribute must be of form: #[proc_macro_derive(TraitName)] - --> $DIR/attribute.rs:14:1 - | -LL | #[proc_macro_derive = "foo"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error: must only be one word --> $DIR/attribute.rs:21:5 | @@ -46,5 +34,17 @@ error: attribute must have either one or two arguments LL | #[proc_macro_derive(l, attributes(m), n)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: attribute must be of the form `#[proc_macro_derive(...)]` + --> $DIR/attribute.rs:8:1 + | +LL | #[proc_macro_derive] + | ^^^^^^^^^^^^^^^^^^^^ + +error: attribute must be of the form `#[proc_macro_derive(...)]` + --> $DIR/attribute.rs:14:1 + | +LL | #[proc_macro_derive = "foo"] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: aborting due to 8 previous errors diff --git a/src/test/ui/proc-macro/invalid-attributes.rs b/src/test/ui/proc-macro/invalid-attributes.rs index 22ebc77544082..a749210d171e5 100644 --- a/src/test/ui/proc-macro/invalid-attributes.rs +++ b/src/test/ui/proc-macro/invalid-attributes.rs @@ -7,20 +7,20 @@ extern crate proc_macro; use proc_macro::TokenStream; -#[proc_macro = "test"] //~ ERROR: does not take any arguments +#[proc_macro = "test"] //~ ERROR attribute must be of the form `#[proc_macro]` pub fn a(a: TokenStream) -> TokenStream { a } -#[proc_macro()] //~ ERROR: does not take any arguments +#[proc_macro()] //~ ERROR attribute must be of the form `#[proc_macro]` pub fn c(a: TokenStream) -> TokenStream { a } -#[proc_macro(x)] //~ ERROR: does not take any arguments +#[proc_macro(x)] //~ ERROR attribute must be of the form `#[proc_macro]` pub fn d(a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute = "test"] //~ ERROR: does not take any arguments +#[proc_macro_attribute = "test"] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` pub fn e(_: TokenStream, a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute()] //~ ERROR: does not take any arguments +#[proc_macro_attribute()] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` pub fn g(_: TokenStream, a: TokenStream) -> TokenStream { a } -#[proc_macro_attribute(x)] //~ ERROR: does not take any arguments +#[proc_macro_attribute(x)] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` pub fn h(_: TokenStream, a: TokenStream) -> TokenStream { a } diff --git a/src/test/ui/proc-macro/invalid-attributes.stderr b/src/test/ui/proc-macro/invalid-attributes.stderr index 31c42bcb07d35..f44a1ff95e438 100644 --- a/src/test/ui/proc-macro/invalid-attributes.stderr +++ b/src/test/ui/proc-macro/invalid-attributes.stderr @@ -1,37 +1,37 @@ -error: `#[proc_macro]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro]` --> $DIR/invalid-attributes.rs:10:1 | -LL | #[proc_macro = "test"] //~ ERROR: does not take any arguments +LL | #[proc_macro = "test"] //~ ERROR attribute must be of the form `#[proc_macro]` | ^^^^^^^^^^^^^^^^^^^^^^ -error: `#[proc_macro]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro]` --> $DIR/invalid-attributes.rs:13:1 | -LL | #[proc_macro()] //~ ERROR: does not take any arguments +LL | #[proc_macro()] //~ ERROR attribute must be of the form `#[proc_macro]` | ^^^^^^^^^^^^^^^ -error: `#[proc_macro]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro]` --> $DIR/invalid-attributes.rs:16:1 | -LL | #[proc_macro(x)] //~ ERROR: does not take any arguments +LL | #[proc_macro(x)] //~ ERROR attribute must be of the form `#[proc_macro]` | ^^^^^^^^^^^^^^^^ -error: `#[proc_macro_attribute]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro_attribute]` --> $DIR/invalid-attributes.rs:19:1 | -LL | #[proc_macro_attribute = "test"] //~ ERROR: does not take any arguments +LL | #[proc_macro_attribute = "test"] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[proc_macro_attribute]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro_attribute]` --> $DIR/invalid-attributes.rs:22:1 | -LL | #[proc_macro_attribute()] //~ ERROR: does not take any arguments +LL | #[proc_macro_attribute()] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[proc_macro_attribute]` attribute does not take any arguments +error: attribute must be of the form `#[proc_macro_attribute]` --> $DIR/invalid-attributes.rs:25:1 | -LL | #[proc_macro_attribute(x)] //~ ERROR: does not take any arguments +LL | #[proc_macro_attribute(x)] //~ ERROR attribute must be of the form `#[proc_macro_attribute]` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/proc-macro/proc-macro-attributes.rs b/src/test/ui/proc-macro/proc-macro-attributes.rs index 1cc824e943c75..062053453ee42 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.rs +++ b/src/test/ui/proc-macro/proc-macro-attributes.rs @@ -8,7 +8,6 @@ extern crate derive_b; #[B(D)] //~ ERROR `B` is ambiguous #[B(E = "foo")] //~ ERROR `B` is ambiguous #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous - //~^ ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` #[derive(B)] struct B; diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr index 7ac44c9354dd5..a5ec787ac67e6 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.stderr +++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr @@ -13,7 +13,7 @@ LL | #[B] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:12:10 + --> $DIR/proc-macro-attributes.rs:11:10 | LL | #[derive(B)] | ^ @@ -30,7 +30,7 @@ LL | #[B(D)] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:12:10 + --> $DIR/proc-macro-attributes.rs:11:10 | LL | #[derive(B)] | ^ @@ -47,7 +47,7 @@ LL | #[B(E = "foo")] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:12:10 + --> $DIR/proc-macro-attributes.rs:11:10 | LL | #[derive(B)] | ^ @@ -64,7 +64,7 @@ LL | #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:12:10 + --> $DIR/proc-macro-attributes.rs:11:10 | LL | #[derive(B)] | ^ @@ -74,13 +74,7 @@ note: `B` could also refer to the derive macro imported here LL | #[macro_use] | ^^^^^^^^^^^^ -error: expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` - --> $DIR/proc-macro-attributes.rs:10:15 - | -LL | #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous - | ^^^^^^ expected one of `(`, `)`, `,`, `::`, or `=` here - -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors Some errors occurred: E0658, E0659. For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/ui/proc-macro/proc-macro-gates.rs b/src/test/ui/proc-macro/proc-macro-gates.rs index b708f6303148a..af6bfa08aaa94 100644 --- a/src/test/ui/proc-macro/proc-macro-gates.rs +++ b/src/test/ui/proc-macro/proc-macro-gates.rs @@ -19,7 +19,7 @@ mod _test2_inner { //~| ERROR: non-builtin inner attributes are unstable } -#[a = y] //~ ERROR: must only be followed by a delimiter token +#[a = "y"] //~ ERROR: must only be followed by a delimiter token fn _test3() {} fn attrs() { diff --git a/src/test/ui/proc-macro/proc-macro-gates.stderr b/src/test/ui/proc-macro/proc-macro-gates.stderr index c0bc06d358de9..abfcf09bfaf6c 100644 --- a/src/test/ui/proc-macro/proc-macro-gates.stderr +++ b/src/test/ui/proc-macro/proc-macro-gates.stderr @@ -33,8 +33,8 @@ LL | #![a] //~ ERROR: custom attributes cannot be applied to modules error: custom attribute invocations must be of the form #[foo] or #[foo(..)], the macro name must only be followed by a delimiter token --> $DIR/proc-macro-gates.rs:22:1 | -LL | #[a = y] //~ ERROR: must only be followed by a delimiter token - | ^^^^^^^^ +LL | #[a = "y"] //~ ERROR: must only be followed by a delimiter token + | ^^^^^^^^^^ error[E0658]: custom attributes cannot be applied to statements (see issue #54727) --> $DIR/proc-macro-gates.rs:31:5 diff --git a/src/test/ui/repr.rs b/src/test/ui/repr.rs index a35252c41b8d9..6f214f28bab0c 100644 --- a/src/test/ui/repr.rs +++ b/src/test/ui/repr.rs @@ -1,15 +1,16 @@ -// compile-pass - #[repr] -//^ WARN `repr` attribute must have a hint +//~^ ERROR attribute must be of the form `#[repr(...)]` +//~| WARN `repr` attribute must have a hint struct _A {} #[repr = "B"] -//^ WARN `repr` attribute isn't configurable with a literal +//~^ ERROR attribute must be of the form `#[repr(...)]` +//~| WARN `repr` attribute isn't configurable with a literal struct _B {} #[repr = "C"] -//^ WARN `repr` attribute isn't configurable with a literal +//~^ ERROR attribute must be of the form `#[repr(...)]` +//~| WARN `repr` attribute isn't configurable with a literal struct _C {} #[repr(C)] diff --git a/src/test/ui/repr.stderr b/src/test/ui/repr.stderr index 503d47c36c94a..e13f0532c91b3 100644 --- a/src/test/ui/repr.stderr +++ b/src/test/ui/repr.stderr @@ -1,5 +1,23 @@ +error: attribute must be of the form `#[repr(...)]` + --> $DIR/repr.rs:1:1 + | +LL | #[repr] + | ^^^^^^^ + +error: attribute must be of the form `#[repr(...)]` + --> $DIR/repr.rs:6:1 + | +LL | #[repr = "B"] + | ^^^^^^^^^^^^^ + +error: attribute must be of the form `#[repr(...)]` + --> $DIR/repr.rs:11:1 + | +LL | #[repr = "C"] + | ^^^^^^^^^^^^^ + warning: `repr` attribute must have a hint - --> $DIR/repr.rs:3:1 + --> $DIR/repr.rs:1:1 | LL | #[repr] | ^^^^^^^ needs a hint @@ -9,7 +27,7 @@ LL | #[repr] = note: for more information, visit warning: `repr` attribute isn't configurable with a literal - --> $DIR/repr.rs:7:1 + --> $DIR/repr.rs:6:1 | LL | #[repr = "B"] | ^^^^^^^^^^^^^ needs a hint @@ -23,3 +41,5 @@ warning: `repr` attribute isn't configurable with a literal LL | #[repr = "C"] | ^^^^^^^^^^^^^ help: give `repr` a hint: `#[repr(C)]` +error: aborting due to 3 previous errors + diff --git a/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs b/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs index 27db48998eb26..08f56f38f076b 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs @@ -1,7 +1,7 @@ #![feature(non_exhaustive)] #[non_exhaustive(anything)] -//~^ ERROR attribute should be empty [E0702] +//~^ ERROR attribute must be of the form `#[non_exhaustive]` struct Foo; #[non_exhaustive] diff --git a/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr b/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr index c06999934e888..1d055fe8d4cb8 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr @@ -1,11 +1,8 @@ -error[E0702]: attribute should be empty +error: attribute must be of the form `#[non_exhaustive]` --> $DIR/invalid-attribute.rs:3:1 | LL | #[non_exhaustive(anything)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | //~^ ERROR attribute should be empty [E0702] -LL | struct Foo; - | ----------- not empty error[E0701]: attribute can only be applied to a struct or enum --> $DIR/invalid-attribute.rs:7:1 @@ -30,5 +27,4 @@ LL | | } error: aborting due to 3 previous errors -Some errors occurred: E0701, E0702. -For more information about an error, try `rustc --explain E0701`. +For more information about this error, try `rustc --explain E0701`. diff --git a/src/test/ui/span/gated-features-attr-spans.rs b/src/test/ui/span/gated-features-attr-spans.rs index ff722a5352079..69511ab8e1fc7 100644 --- a/src/test/ui/span/gated-features-attr-spans.rs +++ b/src/test/ui/span/gated-features-attr-spans.rs @@ -1,7 +1,7 @@ #[repr(simd)] //~ ERROR are experimental -struct Weapon { - name: String, - damage: u32 +struct Coord { + x: u32, + y: u32, } fn main() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs index 3c4d629f77fc7..1f0a7a8f8a5e6 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs @@ -1,6 +1,6 @@ // compile-flags:-Zforce-unstable-if-unmarked -#[unstable] //~ ERROR: stability attributes may not be used -#[stable] //~ ERROR: stability attributes may not be used -#[rustc_deprecated] //~ ERROR: stability attributes may not be used +#[unstable()] //~ ERROR: stability attributes may not be used +#[stable()] //~ ERROR: stability attributes may not be used +#[rustc_deprecated()] //~ ERROR: stability attributes may not be used fn main() { } diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr index 2b8fb865fbe99..cd8ea921d3036 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr @@ -1,20 +1,20 @@ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 | -LL | #[unstable] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^^^ +LL | #[unstable()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged-force-unstable.rs:4:1 | -LL | #[stable] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^ +LL | #[stable()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged-force-unstable.rs:5:1 | -LL | #[rustc_deprecated] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged.rs b/src/test/ui/stability-attribute/stability-attribute-non-staged.rs index 3b223851ce0fa..fc2c2b587fead 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged.rs +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged.rs @@ -1,4 +1,4 @@ -#[unstable] //~ ERROR: stability attributes may not be used -#[stable] //~ ERROR: stability attributes may not be used -#[rustc_deprecated] //~ ERROR: stability attributes may not be used +#[unstable()] //~ ERROR: stability attributes may not be used +#[stable()] //~ ERROR: stability attributes may not be used +#[rustc_deprecated()] //~ ERROR: stability attributes may not be used fn main() { } diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr index ad437dd2ebecc..67f6ef857f179 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr @@ -1,20 +1,20 @@ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged.rs:1:1 | -LL | #[unstable] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^^^ +LL | #[unstable()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged.rs:2:1 | -LL | #[stable] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^ +LL | #[stable()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^ error: stability attributes may not be used outside of the standard library --> $DIR/stability-attribute-non-staged.rs:3:1 | -LL | #[rustc_deprecated] //~ ERROR: stability attributes may not be used - | ^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity-4.rs b/src/test/ui/stability-attribute/stability-attribute-sanity-4.rs new file mode 100644 index 0000000000000..90fc109ff6451 --- /dev/null +++ b/src/test/ui/stability-attribute/stability-attribute-sanity-4.rs @@ -0,0 +1,29 @@ +// Various checks that stability attributes are used correctly, per RFC 507 + +#![feature(staged_api)] + +#![stable(feature = "rust1", since = "1.0.0")] + +mod bogus_attribute_types_2 { + #[unstable] //~ ERROR attribute must be of the form `#[unstable(...)]` + fn f1() { } + + #[unstable = "b"] //~ ERROR attribute must be of the form `#[unstable(...)]` + fn f2() { } + + #[stable] //~ ERROR attribute must be of the form `#[stable(...)]` + fn f3() { } + + #[stable = "a"] //~ ERROR attribute must be of the form `#[stable(...)]` + fn f4() { } + + #[stable(feature = "a", since = "b")] + #[rustc_deprecated] //~ ERROR attribute must be of the form `#[rustc_deprecated(...)]` + fn f5() { } + + #[stable(feature = "a", since = "b")] + #[rustc_deprecated = "a"] //~ ERROR attribute must be of the form `#[rustc_deprecated(...)]` + fn f6() { } +} + +fn main() { } diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr new file mode 100644 index 0000000000000..b5e31820223b8 --- /dev/null +++ b/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr @@ -0,0 +1,38 @@ +error: attribute must be of the form `#[unstable(...)]` + --> $DIR/stability-attribute-sanity-4.rs:8:5 + | +LL | #[unstable] //~ ERROR attribute must be of the form `#[unstable(...)]` + | ^^^^^^^^^^^ + +error: attribute must be of the form `#[unstable(...)]` + --> $DIR/stability-attribute-sanity-4.rs:11:5 + | +LL | #[unstable = "b"] //~ ERROR attribute must be of the form `#[unstable(...)]` + | ^^^^^^^^^^^^^^^^^ + +error: attribute must be of the form `#[stable(...)]` + --> $DIR/stability-attribute-sanity-4.rs:14:5 + | +LL | #[stable] //~ ERROR attribute must be of the form `#[stable(...)]` + | ^^^^^^^^^ + +error: attribute must be of the form `#[stable(...)]` + --> $DIR/stability-attribute-sanity-4.rs:17:5 + | +LL | #[stable = "a"] //~ ERROR attribute must be of the form `#[stable(...)]` + | ^^^^^^^^^^^^^^^ + +error: attribute must be of the form `#[rustc_deprecated(...)]` + --> $DIR/stability-attribute-sanity-4.rs:21:5 + | +LL | #[rustc_deprecated] //~ ERROR attribute must be of the form `#[rustc_deprecated(...)]` + | ^^^^^^^^^^^^^^^^^^^ + +error: attribute must be of the form `#[rustc_deprecated(...)]` + --> $DIR/stability-attribute-sanity-4.rs:25:5 + | +LL | #[rustc_deprecated = "a"] //~ ERROR attribute must be of the form `#[rustc_deprecated(...)]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.rs b/src/test/ui/stability-attribute/stability-attribute-sanity.rs index cb10df93708d5..aebdb3bdbf571 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.rs +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.rs @@ -21,28 +21,6 @@ mod bogus_attribute_types_1 { fn f6() { } } -mod bogus_attribute_types_2 { - #[unstable] //~ ERROR incorrect stability attribute type [E0548] - fn f1() { } - - #[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548] - fn f2() { } - - #[stable] //~ ERROR incorrect stability attribute type [E0548] - fn f3() { } - - #[stable = "a"] //~ ERROR incorrect stability attribute type [E0548] - fn f4() { } - - #[stable(feature = "a", since = "b")] - #[rustc_deprecated] //~ ERROR incorrect stability attribute type [E0548] - fn f5() { } - - #[stable(feature = "a", since = "b")] - #[rustc_deprecated = "a"] //~ ERROR incorrect stability attribute type [E0548] - fn f6() { } -} - mod missing_feature_names { #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546] fn f1() { } diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index 14c0728c5c73a..74c1bbfed6f70 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -28,115 +28,79 @@ error[E0539]: incorrect meta item LL | #[stable(feature(b), since = "a")] //~ ERROR incorrect meta item [E0539] | ^^^^^^^^^^ -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:25:5 - | -LL | #[unstable] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^^^ - -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:28:5 - | -LL | #[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^^^^^^^^^ - -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:31:5 - | -LL | #[stable] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^ - -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:34:5 - | -LL | #[stable = "a"] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^^^^^^^ - -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:38:5 - | -LL | #[rustc_deprecated] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^^^^^^^^^^^ - -error[E0548]: incorrect stability attribute type - --> $DIR/stability-attribute-sanity.rs:42:5 - | -LL | #[rustc_deprecated = "a"] //~ ERROR incorrect stability attribute type [E0548] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0546]: missing 'feature' - --> $DIR/stability-attribute-sanity.rs:47:5 + --> $DIR/stability-attribute-sanity.rs:25:5 | LL | #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546] | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0547]: missing 'issue' - --> $DIR/stability-attribute-sanity.rs:50:5 + --> $DIR/stability-attribute-sanity.rs:28:5 | LL | #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0546]: missing 'feature' - --> $DIR/stability-attribute-sanity.rs:53:5 + --> $DIR/stability-attribute-sanity.rs:31:5 | LL | #[stable(since = "a")] //~ ERROR missing 'feature' [E0546] | ^^^^^^^^^^^^^^^^^^^^^^ error[E0542]: missing 'since' - --> $DIR/stability-attribute-sanity.rs:58:5 + --> $DIR/stability-attribute-sanity.rs:36:5 | LL | #[stable(feature = "a")] //~ ERROR missing 'since' [E0542] | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0542]: missing 'since' - --> $DIR/stability-attribute-sanity.rs:62:5 + --> $DIR/stability-attribute-sanity.rs:40:5 | LL | #[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:67:1 + --> $DIR/stability-attribute-sanity.rs:45:1 | LL | #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:71:1 + --> $DIR/stability-attribute-sanity.rs:49:1 | LL | #[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:75:1 + --> $DIR/stability-attribute-sanity.rs:53:1 | LL | #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0540]: multiple rustc_deprecated attributes - --> $DIR/stability-attribute-sanity.rs:83:1 + --> $DIR/stability-attribute-sanity.rs:61:1 | LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0553]: multiple rustc_const_unstable attributes - --> $DIR/stability-attribute-sanity.rs:83:1 + --> $DIR/stability-attribute-sanity.rs:61:1 | LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Invalid stability or deprecation version found - --> $DIR/stability-attribute-sanity.rs:83:1 + --> $DIR/stability-attribute-sanity.rs:61:1 | LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute - --> $DIR/stability-attribute-sanity.rs:88:1 + --> $DIR/stability-attribute-sanity.rs:66:1 | LL | fn deprecated_without_unstable_or_stable() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 23 previous errors +error: aborting due to 17 previous errors -Some errors occurred: E0539, E0540, E0541, E0542, E0544, E0546, E0547, E0548, E0549... +Some errors occurred: E0539, E0540, E0541, E0542, E0544, E0546, E0547, E0549, E0553. For more information about an error, try `rustc --explain E0539`. diff --git a/src/test/ui/suffixed-literal-meta.rs b/src/test/ui/suffixed-literal-meta.rs index a311b65a63b05..eb1f964868bc3 100644 --- a/src/test/ui/suffixed-literal-meta.rs +++ b/src/test/ui/suffixed-literal-meta.rs @@ -1,13 +1,15 @@ -#[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 -#[path = 1u32] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1u64] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1isize] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1i8] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1i16] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1i32] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1i64] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes -#[path = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes +#![feature(custom_attribute)] + +#[macro_use(x = 1usize)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1u8)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1u16)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1u32)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1u64)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1isize)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1i8)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1i16)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1i32)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1i64)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1.0f32)] //~ ERROR: suffixed literals are not allowed in attributes +#[macro_use(x = 1.0f64)] //~ ERROR: suffixed literals are not allowed in attributes fn main() { } diff --git a/src/test/ui/suffixed-literal-meta.stderr b/src/test/ui/suffixed-literal-meta.stderr index 2f3ad8a1aedce..69a403f2fb812 100644 --- a/src/test/ui/suffixed-literal-meta.stderr +++ b/src/test/ui/suffixed-literal-meta.stderr @@ -1,96 +1,96 @@ error: suffixed literals are not allowed in attributes - --> $DIR/suffixed-literal-meta.rs:1:10 + --> $DIR/suffixed-literal-meta.rs:3:17 | -LL | #[path = 1usize] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^^^ +LL | #[macro_use(x = 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:2:10 + --> $DIR/suffixed-literal-meta.rs:4:17 | -LL | #[path = 1u8] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^ +LL | #[macro_use(x = 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:3:10 + --> $DIR/suffixed-literal-meta.rs:5:17 | -LL | #[path = 1u16] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:4:10 + --> $DIR/suffixed-literal-meta.rs:6:17 | -LL | #[path = 1u32] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:5:10 + --> $DIR/suffixed-literal-meta.rs:7:17 | -LL | #[path = 1u64] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:6:10 + --> $DIR/suffixed-literal-meta.rs:8:17 | -LL | #[path = 1isize] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^^^ +LL | #[macro_use(x = 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:7:10 + --> $DIR/suffixed-literal-meta.rs:9:17 | -LL | #[path = 1i8] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^ +LL | #[macro_use(x = 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:8:10 + --> $DIR/suffixed-literal-meta.rs:10:17 | -LL | #[path = 1i16] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:9:10 + --> $DIR/suffixed-literal-meta.rs:11:17 | -LL | #[path = 1i32] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:10:10 + --> $DIR/suffixed-literal-meta.rs:12:17 | -LL | #[path = 1i64] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^ +LL | #[macro_use(x = 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:11:10 + --> $DIR/suffixed-literal-meta.rs:13:17 | -LL | #[path = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^^^ +LL | #[macro_use(x = 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:12:10 + --> $DIR/suffixed-literal-meta.rs:14:17 | -LL | #[path = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes - | ^^^^^^ +LL | #[macro_use(x = 1.0f64)] //~ 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.). diff --git a/src/test/ui/target-feature-wrong.stderr b/src/test/ui/target-feature-wrong.stderr index 2eeaa10748c76..b2182197707a6 100644 --- a/src/test/ui/target-feature-wrong.stderr +++ b/src/test/ui/target-feature-wrong.stderr @@ -1,4 +1,4 @@ -error: #[target_feature] attribute must be of the form #[target_feature(..)] +error: attribute must be of the form `#[target_feature(...)]` --> $DIR/target-feature-wrong.rs:16:1 | LL | #[target_feature = "+sse2"] diff --git a/src/test/ui/test-should-panic-attr.rs b/src/test/ui/test-should-panic-attr.rs index 1b5afdaa89b6c..6b7de062be1b5 100644 --- a/src/test/ui/test-should-panic-attr.rs +++ b/src/test/ui/test-should-panic-attr.rs @@ -1,9 +1,9 @@ -// run-pass // compile-flags: --test #[test] #[should_panic = "foo"] //~^ WARN: attribute must be of the form: +//~| ERROR: attribute must be of the form `#[should_panic]` or `#[should_panic(...)]` fn test1() { panic!(); } diff --git a/src/test/ui/test-should-panic-attr.stderr b/src/test/ui/test-should-panic-attr.stderr index 0f25477e53f1a..7a05a321538c1 100644 --- a/src/test/ui/test-should-panic-attr.stderr +++ b/src/test/ui/test-should-panic-attr.stderr @@ -1,5 +1,5 @@ warning: attribute must be of the form: `#[should_panic]` or `#[should_panic(expected = "error message")]` - --> $DIR/test-should-panic-attr.rs:5:1 + --> $DIR/test-should-panic-attr.rs:4:1 | LL | #[should_panic = "foo"] | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -38,3 +38,11 @@ LL | #[should_panic(expected = "foo", bar)] | = note: Errors in this attribute were erroneously allowed and will become a hard error in a future release. +error: attribute must be of the form `#[should_panic]` or `#[should_panic(...)]` + --> $DIR/test-should-panic-attr.rs:4:1 + | +LL | #[should_panic = "foo"] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/unrestricted-attribute-tokens.rs b/src/test/ui/unrestricted-attribute-tokens.rs index 9d8ba03eca567..a37b5072c70be 100644 --- a/src/test/ui/unrestricted-attribute-tokens.rs +++ b/src/test/ui/unrestricted-attribute-tokens.rs @@ -1,6 +1,6 @@ // compile-pass -#![feature(custom_attribute, unrestricted_attribute_tokens)] +#![feature(custom_attribute)] #[my_attr(a b c d)] fn main() {} diff --git a/src/test/ui/utf8_idents.rs b/src/test/ui/utf8_idents.rs index c9f433c3c3b3d..bed0d9bb2be54 100644 --- a/src/test/ui/utf8_idents.rs +++ b/src/test/ui/utf8_idents.rs @@ -3,6 +3,7 @@ fn foo< 'β, //~ ERROR non-ascii idents are not fully supported γ //~ ERROR non-ascii idents are not fully supported + //~^ WARN type parameter `γ` should have a camel case name such as `Γ` >() {} struct X { diff --git a/src/test/ui/utf8_idents.stderr b/src/test/ui/utf8_idents.stderr index b1bb4a3001557..1ccf767491cdb 100644 --- a/src/test/ui/utf8_idents.stderr +++ b/src/test/ui/utf8_idents.stderr @@ -15,7 +15,7 @@ LL | γ //~ ERROR non-ascii idents are not fully supported = help: add #![feature(non_ascii_idents)] to the crate attributes to enable error[E0658]: non-ascii idents are not fully supported. (see issue #55467) - --> $DIR/utf8_idents.rs:9:5 + --> $DIR/utf8_idents.rs:10:5 | LL | δ: usize //~ ERROR non-ascii idents are not fully supported | ^ @@ -23,13 +23,21 @@ LL | δ: usize //~ ERROR non-ascii idents are not fully supported = help: add #![feature(non_ascii_idents)] to the crate attributes to enable error[E0658]: non-ascii idents are not fully supported. (see issue #55467) - --> $DIR/utf8_idents.rs:13:9 + --> $DIR/utf8_idents.rs:14:9 | LL | let α = 0.00001f64; //~ ERROR non-ascii idents are not fully supported | ^ | = help: add #![feature(non_ascii_idents)] to the crate attributes to enable +warning: type parameter `γ` should have a camel case name such as `Γ` + --> $DIR/utf8_idents.rs:5:5 + | +LL | γ //~ ERROR non-ascii idents are not fully supported + | ^ + | + = note: #[warn(non_camel_case_types)] on by default + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0658`.