From facc78784e48eed34ed304f44dee6d4d15620542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 24 Jun 2026 18:59:31 +0200 Subject: [PATCH 01/33] rustfmt: Discover modules via `cfg_select!` --- src/tools/rustfmt/src/modules.rs | 19 ++++++----- src/tools/rustfmt/src/modules/visitor.rs | 32 +++++++++---------- .../macros/{cfg_match.rs => cfg_select.rs} | 12 +++---- src/tools/rustfmt/src/parse/macros/mod.rs | 2 +- src/tools/rustfmt/src/test/mod.rs | 12 +++---- .../format_me_please_1.rs | 0 .../format_me_please_2.rs | 0 .../format_me_please_3.rs | 0 .../format_me_please_4.rs | 0 .../source/{cfg_match => cfg_select}/lib.rs | 6 ++-- .../source/{cfg_match => cfg_select}/lib2.rs | 0 .../format_me_please_1.rs | 0 .../format_me_please_2.rs | 0 .../format_me_please_3.rs | 0 .../format_me_please_4.rs | 0 .../target/{cfg_match => cfg_select}/lib.rs | 6 ++-- .../target/{cfg_match => cfg_select}/lib2.rs | 0 17 files changed, 44 insertions(+), 45 deletions(-) rename src/tools/rustfmt/src/parse/macros/{cfg_match.rs => cfg_select.rs} (84%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/format_me_please_1.rs (100%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/format_me_please_2.rs (100%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/format_me_please_3.rs (100%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/format_me_please_4.rs (100%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/lib.rs (71%) rename src/tools/rustfmt/tests/source/{cfg_match => cfg_select}/lib2.rs (100%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/format_me_please_1.rs (100%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/format_me_please_2.rs (100%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/format_me_please_3.rs (100%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/format_me_please_4.rs (100%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/lib.rs (71%) rename src/tools/rustfmt/tests/target/{cfg_match => cfg_select}/lib2.rs (100%) diff --git a/src/tools/rustfmt/src/modules.rs b/src/tools/rustfmt/src/modules.rs index 099a644282102..89f3e71f9eb45 100644 --- a/src/tools/rustfmt/src/modules.rs +++ b/src/tools/rustfmt/src/modules.rs @@ -167,8 +167,11 @@ impl<'ast, 'psess, 'c> ModResolver<'ast, 'psess> { Ok(()) } - fn visit_cfg_match(&mut self, item: Cow<'ast, ast::Item>) -> Result<(), ModuleResolutionError> { - let mut visitor = visitor::CfgMatchVisitor::new(self.psess); + fn visit_cfg_select( + &mut self, + item: Cow<'ast, ast::Item>, + ) -> Result<(), ModuleResolutionError> { + let mut visitor = visitor::CfgSelectVisitor::new(self.psess); visitor.visit_item(&item); for module_item in visitor.mods() { if let ast::ItemKind::Mod(_, _, ref sub_mod_kind) = module_item.item.kind { @@ -197,8 +200,8 @@ impl<'ast, 'psess, 'c> ModResolver<'ast, 'psess> { continue; } - if is_cfg_match(&item) { - self.visit_cfg_match(Cow::Owned(*item))?; + if is_cfg_select(&item) { + self.visit_cfg_select(Cow::Owned(*item))?; continue; } @@ -228,8 +231,8 @@ impl<'ast, 'psess, 'c> ModResolver<'ast, 'psess> { self.visit_cfg_if(Cow::Borrowed(item))?; } - if is_cfg_match(item) { - self.visit_cfg_match(Cow::Borrowed(item))?; + if is_cfg_select(item) { + self.visit_cfg_select(Cow::Borrowed(item))?; } if let ast::ItemKind::Mod(_, _, ref sub_mod_kind) = item.kind { @@ -605,11 +608,11 @@ fn is_cfg_if(item: &ast::Item) -> bool { } } -fn is_cfg_match(item: &ast::Item) -> bool { +fn is_cfg_select(item: &ast::Item) -> bool { match item.kind { ast::ItemKind::MacCall(ref mac) => { if let Some(last_segment) = mac.path.segments.last() { - if last_segment.ident.name == Symbol::intern("cfg_match") { + if last_segment.ident.name == Symbol::intern("cfg_select") { return true; } } diff --git a/src/tools/rustfmt/src/modules/visitor.rs b/src/tools/rustfmt/src/modules/visitor.rs index d302a9ede6cb7..485f44a936bd8 100644 --- a/src/tools/rustfmt/src/modules/visitor.rs +++ b/src/tools/rustfmt/src/modules/visitor.rs @@ -5,7 +5,7 @@ use tracing::debug; use crate::attr::MetaVisitor; use crate::parse::macros::cfg_if::parse_cfg_if; -use crate::parse::macros::cfg_match::parse_cfg_match; +use crate::parse::macros::cfg_select::parse_cfg_select; use crate::parse::session::ParseSess; pub(crate) struct ModItem { @@ -72,15 +72,15 @@ impl<'a, 'ast: 'a> CfgIfVisitor<'a> { } } -/// Traverse `cfg_match!` macro and fetch modules. -pub(crate) struct CfgMatchVisitor<'a> { +/// Traverse `cfg_select!` macro and fetch modules. +pub(crate) struct CfgSelectVisitor<'a> { psess: &'a ParseSess, mods: Vec, } -impl<'a> CfgMatchVisitor<'a> { - pub(crate) fn new(psess: &'a ParseSess) -> CfgMatchVisitor<'a> { - CfgMatchVisitor { +impl<'a> CfgSelectVisitor<'a> { + pub(crate) fn new(psess: &'a ParseSess) -> CfgSelectVisitor<'a> { + CfgSelectVisitor { mods: vec![], psess, } @@ -91,7 +91,7 @@ impl<'a> CfgMatchVisitor<'a> { } } -impl<'a, 'ast: 'a> Visitor<'ast> for CfgMatchVisitor<'a> { +impl<'a, 'ast: 'a> Visitor<'ast> for CfgSelectVisitor<'a> { fn visit_mac_call(&mut self, mac: &'ast ast::MacCall) { match self.visit_mac_inner(mac) { Ok(()) => (), @@ -100,30 +100,30 @@ impl<'a, 'ast: 'a> Visitor<'ast> for CfgMatchVisitor<'a> { } } -impl<'a, 'ast: 'a> CfgMatchVisitor<'a> { +impl<'a, 'ast: 'a> CfgSelectVisitor<'a> { fn visit_mac_inner(&mut self, mac: &'ast ast::MacCall) -> Result<(), &'static str> { // Support both: // ``` - // std::cfg_match! {..} - // core::cfg_match! {..} + // std::cfg_select! {..} + // core::cfg_select! {..} // ``` // And: // ``` - // use std::cfg_match; - // cfg_match! {..} + // use std::cfg_select; + // cfg_select! {..} // ``` match mac.path.segments.last() { Some(last_segment) => { - if last_segment.ident.name != Symbol::intern("cfg_match") { - return Err("Expected cfg_match"); + if last_segment.ident.name != Symbol::intern("cfg_select") { + return Err("Expected cfg_select"); } } None => { - return Err("Expected cfg_match"); + return Err("Expected cfg_select"); } }; - let items = parse_cfg_match(self.psess, mac)?; + let items = parse_cfg_select(self.psess, mac)?; self.mods .append(&mut items.into_iter().map(|item| ModItem { item }).collect()); diff --git a/src/tools/rustfmt/src/parse/macros/cfg_match.rs b/src/tools/rustfmt/src/parse/macros/cfg_select.rs similarity index 84% rename from src/tools/rustfmt/src/parse/macros/cfg_match.rs rename to src/tools/rustfmt/src/parse/macros/cfg_select.rs index 476289b08b72a..040447ff1898f 100644 --- a/src/tools/rustfmt/src/parse/macros/cfg_match.rs +++ b/src/tools/rustfmt/src/parse/macros/cfg_select.rs @@ -8,18 +8,18 @@ use rustc_parse::parser::{AllowConstBlockItems, ForceCollect}; use crate::parse::macros::build_stream_parser; use crate::parse::session::ParseSess; -pub(crate) fn parse_cfg_match<'a>( +pub(crate) fn parse_cfg_select<'a>( psess: &'a ParseSess, mac: &'a ast::MacCall, ) -> Result, &'static str> { - match catch_unwind(AssertUnwindSafe(|| parse_cfg_match_inner(psess, mac))) { + match catch_unwind(AssertUnwindSafe(|| parse_cfg_select_inner(psess, mac))) { Ok(Ok(items)) => Ok(items), Ok(err @ Err(_)) => err, - Err(..) => Err("failed to parse cfg_match!"), + Err(..) => Err("failed to parse cfg_select!"), } } -fn parse_cfg_match_inner<'a>( +fn parse_cfg_select_inner<'a>( psess: &'a ParseSess, mac: &'a ast::MacCall, ) -> Result, &'static str> { @@ -27,7 +27,7 @@ fn parse_cfg_match_inner<'a>( let mut parser = build_stream_parser(psess.inner(), ts); if parser.token == TokenKind::OpenBrace { - return Err("Expression position cfg_match! not yet supported"); + return Err("Expression position cfg_select! not yet supported"); } let mut items = vec![]; @@ -58,7 +58,7 @@ fn parse_cfg_match_inner<'a>( err.cancel(); parser.psess.dcx().reset_err_count(); return Err( - "Expected item inside cfg_match block, but failed to parse it as an item", + "Expected item inside cfg_select block, but failed to parse it as an item", ); } }; diff --git a/src/tools/rustfmt/src/parse/macros/mod.rs b/src/tools/rustfmt/src/parse/macros/mod.rs index 00e0f6f58bd37..3d32821ce08b3 100644 --- a/src/tools/rustfmt/src/parse/macros/mod.rs +++ b/src/tools/rustfmt/src/parse/macros/mod.rs @@ -10,7 +10,7 @@ use crate::macros::MacroArg; use crate::rewrite::RewriteContext; pub(crate) mod cfg_if; -pub(crate) mod cfg_match; +pub(crate) mod cfg_select; pub(crate) mod lazy_static; fn build_stream_parser<'a>(psess: &'a ParseSess, tokens: TokenStream) -> Parser<'a> { diff --git a/src/tools/rustfmt/src/test/mod.rs b/src/tools/rustfmt/src/test/mod.rs index 4eded7c49eb50..ff5ed15fce743 100644 --- a/src/tools/rustfmt/src/test/mod.rs +++ b/src/tools/rustfmt/src/test/mod.rs @@ -42,8 +42,8 @@ const FILE_SKIP_LIST: &[&str] = &[ "issue-3253/foo.rs", "issue-3253/bar.rs", "issue-3253/paths", - // This directory is directly tested by format_files_find_new_files_via_cfg_match - "cfg_match", + // This directory is directly tested by format_files_find_new_files_via_cfg_select + "cfg_select", // These files and directory are a part of modules defined inside `cfg_attr(..)`. "cfg_mod/dir", "cfg_mod/bar.rs", @@ -471,15 +471,15 @@ fn format_files_find_new_files_via_cfg_if() { } #[test] -fn format_files_find_new_files_via_cfg_match() { +fn format_files_find_new_files_via_cfg_select() { init_log(); run_test_with(&TestSetting::default(), || { - // We load these two files into the same session to test cfg_match! + // We load these two files into the same session to test cfg_select! // transparent mod discovery, and to ensure that it does not suffer // from a similar issue as cfg_if! support did with issue-4656. let files = vec![ - Path::new("tests/source/cfg_match/lib2.rs"), - Path::new("tests/source/cfg_match/lib.rs"), + Path::new("tests/source/cfg_select/lib2.rs"), + Path::new("tests/source/cfg_select/lib.rs"), ]; let config = Config::default(); diff --git a/src/tools/rustfmt/tests/source/cfg_match/format_me_please_1.rs b/src/tools/rustfmt/tests/source/cfg_select/format_me_please_1.rs similarity index 100% rename from src/tools/rustfmt/tests/source/cfg_match/format_me_please_1.rs rename to src/tools/rustfmt/tests/source/cfg_select/format_me_please_1.rs diff --git a/src/tools/rustfmt/tests/source/cfg_match/format_me_please_2.rs b/src/tools/rustfmt/tests/source/cfg_select/format_me_please_2.rs similarity index 100% rename from src/tools/rustfmt/tests/source/cfg_match/format_me_please_2.rs rename to src/tools/rustfmt/tests/source/cfg_select/format_me_please_2.rs diff --git a/src/tools/rustfmt/tests/source/cfg_match/format_me_please_3.rs b/src/tools/rustfmt/tests/source/cfg_select/format_me_please_3.rs similarity index 100% rename from src/tools/rustfmt/tests/source/cfg_match/format_me_please_3.rs rename to src/tools/rustfmt/tests/source/cfg_select/format_me_please_3.rs diff --git a/src/tools/rustfmt/tests/source/cfg_match/format_me_please_4.rs b/src/tools/rustfmt/tests/source/cfg_select/format_me_please_4.rs similarity index 100% rename from src/tools/rustfmt/tests/source/cfg_match/format_me_please_4.rs rename to src/tools/rustfmt/tests/source/cfg_select/format_me_please_4.rs diff --git a/src/tools/rustfmt/tests/source/cfg_match/lib.rs b/src/tools/rustfmt/tests/source/cfg_select/lib.rs similarity index 71% rename from src/tools/rustfmt/tests/source/cfg_match/lib.rs rename to src/tools/rustfmt/tests/source/cfg_select/lib.rs index 2f0accac7d77a..62fb6dfbe9e38 100644 --- a/src/tools/rustfmt/tests/source/cfg_match/lib.rs +++ b/src/tools/rustfmt/tests/source/cfg_select/lib.rs @@ -1,13 +1,11 @@ -#![feature(cfg_match)] - -std::cfg_match! { +cfg_select! { test => { mod format_me_please_1; } target_family = "unix" => { mod format_me_please_2; } - cfg(target_pointer_width = "32") => { + target_pointer_width = "32" => { mod format_me_please_3; } _ => { diff --git a/src/tools/rustfmt/tests/source/cfg_match/lib2.rs b/src/tools/rustfmt/tests/source/cfg_select/lib2.rs similarity index 100% rename from src/tools/rustfmt/tests/source/cfg_match/lib2.rs rename to src/tools/rustfmt/tests/source/cfg_select/lib2.rs diff --git a/src/tools/rustfmt/tests/target/cfg_match/format_me_please_1.rs b/src/tools/rustfmt/tests/target/cfg_select/format_me_please_1.rs similarity index 100% rename from src/tools/rustfmt/tests/target/cfg_match/format_me_please_1.rs rename to src/tools/rustfmt/tests/target/cfg_select/format_me_please_1.rs diff --git a/src/tools/rustfmt/tests/target/cfg_match/format_me_please_2.rs b/src/tools/rustfmt/tests/target/cfg_select/format_me_please_2.rs similarity index 100% rename from src/tools/rustfmt/tests/target/cfg_match/format_me_please_2.rs rename to src/tools/rustfmt/tests/target/cfg_select/format_me_please_2.rs diff --git a/src/tools/rustfmt/tests/target/cfg_match/format_me_please_3.rs b/src/tools/rustfmt/tests/target/cfg_select/format_me_please_3.rs similarity index 100% rename from src/tools/rustfmt/tests/target/cfg_match/format_me_please_3.rs rename to src/tools/rustfmt/tests/target/cfg_select/format_me_please_3.rs diff --git a/src/tools/rustfmt/tests/target/cfg_match/format_me_please_4.rs b/src/tools/rustfmt/tests/target/cfg_select/format_me_please_4.rs similarity index 100% rename from src/tools/rustfmt/tests/target/cfg_match/format_me_please_4.rs rename to src/tools/rustfmt/tests/target/cfg_select/format_me_please_4.rs diff --git a/src/tools/rustfmt/tests/target/cfg_match/lib.rs b/src/tools/rustfmt/tests/target/cfg_select/lib.rs similarity index 71% rename from src/tools/rustfmt/tests/target/cfg_match/lib.rs rename to src/tools/rustfmt/tests/target/cfg_select/lib.rs index 2f0accac7d77a..62fb6dfbe9e38 100644 --- a/src/tools/rustfmt/tests/target/cfg_match/lib.rs +++ b/src/tools/rustfmt/tests/target/cfg_select/lib.rs @@ -1,13 +1,11 @@ -#![feature(cfg_match)] - -std::cfg_match! { +cfg_select! { test => { mod format_me_please_1; } target_family = "unix" => { mod format_me_please_2; } - cfg(target_pointer_width = "32") => { + target_pointer_width = "32" => { mod format_me_please_3; } _ => { diff --git a/src/tools/rustfmt/tests/target/cfg_match/lib2.rs b/src/tools/rustfmt/tests/target/cfg_select/lib2.rs similarity index 100% rename from src/tools/rustfmt/tests/target/cfg_match/lib2.rs rename to src/tools/rustfmt/tests/target/cfg_select/lib2.rs From 28d994a835e2c388cabd99159dc94a405e06624f Mon Sep 17 00:00:00 2001 From: Rachit2323 Date: Tue, 14 Jul 2026 12:33:29 +0530 Subject: [PATCH 02/33] str: add ASCII fast path to word_to_titlecase --- library/alloc/src/str.rs | 16 +++++++++++---- library/alloctests/tests/lib.rs | 1 + library/alloctests/tests/str.rs | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index 52cdbe20ba176..1bd728170611f 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -552,11 +552,10 @@ impl str { without modifying the original"] #[unstable(feature = "titlecase", issue = "153892")] pub fn word_to_titlecase(&self) -> String { - // FIXME: add ASCII fast path - let mut s = String::with_capacity(self.len()); let mut chars = self.char_indices(); + // The first cased character is title-cased; leading uncased characters pass through. 'until_first_cased_char: for (_, c) in chars.by_ref() { if c.is_cased() { s.extend(c.to_titlecase()); @@ -566,14 +565,23 @@ impl str { } } - for (i, c) in chars { + // Everything after the first cased character is lower-cased. Use the ASCII fast + // path (auto-vectorized) for its ASCII prefix, mirroring `to_lowercase`. + let remainder = chars.as_str(); + let rest_start = self.len() - remainder.len(); + // SAFETY: `to_ascii_lowercase` preserves ASCII bytes, so the prefix stays valid UTF-8. + let (ascii, rest) = unsafe { convert_while_ascii(remainder, u8::to_ascii_lowercase) }; + s.push_str(&ascii); + let prefix_len = rest_start + ascii.len(); + + for (i, c) in rest.char_indices() { if c == 'Σ' { // Σ maps to σ, except at the end of a word where it maps to ς. // This is the only conditional (contextual) but language-independent mapping // in `SpecialCasing.txt`, // so hard-code it rather than have a generic "condition" mechanism. // See https://github.com/rust-lang/rust/issues/26035 - let sigma_lowercase = map_uppercase_sigma(self, i); + let sigma_lowercase = map_uppercase_sigma(self, prefix_len + i); s.push(sigma_lowercase); } else { match conversions::to_lower(c) { diff --git a/library/alloctests/tests/lib.rs b/library/alloctests/tests/lib.rs index 96dcde71fc071..d67ea5959765d 100644 --- a/library/alloctests/tests/lib.rs +++ b/library/alloctests/tests/lib.rs @@ -37,6 +37,7 @@ #![feature(string_replace_in_place)] #![feature(test)] #![feature(thin_box)] +#![feature(titlecase)] #![feature(trusted_len)] #![feature(try_reserve_kind)] #![feature(try_with_capacity)] diff --git a/library/alloctests/tests/str.rs b/library/alloctests/tests/str.rs index af4930a0744be..195cbf75cf9c2 100644 --- a/library/alloctests/tests/str.rs +++ b/library/alloctests/tests/str.rs @@ -1889,6 +1889,41 @@ fn to_uppercase() { assert_eq!("aéDžßẞfiᾀ".to_uppercase(), "AÉDŽSSẞFIἈΙ"); } +#[test] +fn word_to_titlecase() { + // ASCII fast path: first cased letter is upper-cased, the rest lower-cased. + assert_eq!("hello WORLD".word_to_titlecase(), "Hello world"); + assert_eq!("HELLO".word_to_titlecase(), "Hello"); + + // Leading uncased characters pass through, then the first cased letter is title-cased. + assert_eq!("'twas".word_to_titlecase(), "'Twas"); + assert_eq!("123 abc".word_to_titlecase(), "123 Abc"); + + // Empty and no-cased-character inputs are unchanged. + assert_eq!("".word_to_titlecase(), ""); + assert_eq!("农历新年".word_to_titlecase(), "农历新年"); + assert_eq!("123 456".word_to_titlecase(), "123 456"); + + // Final-sigma handling: Σ maps to ς at the end of a word, σ elsewhere. + assert_eq!("ὈΔΥΣΣΕΎΣ".word_to_titlecase(), "Ὀδυσσεύς"); + assert_eq!("ΑΣ".word_to_titlecase(), "Ας"); + assert_eq!("ΑΣΑ".word_to_titlecase(), "Ασα"); + + // Mixed ASCII prefix followed by a non-ASCII tail exercises the boundary index math, + // including around the chunk size used by the ASCII prefix optimization. + assert_eq!("HELLO ὈΔΥΣΣΕΎΣ".word_to_titlecase(), "Hello ὀδυσσεύς"); + assert_eq!("ABCDEFGHIJKLMNOΣ".word_to_titlecase(), "Abcdefghijklmnoς"); + assert_eq!("ABCDEFGHIJKLMNOPΣ".word_to_titlecase(), "Abcdefghijklmnopς"); + assert_eq!("ABCDEFGHIJKLMNOPQΣ".word_to_titlecase(), "Abcdefghijklmnopqς"); + + // A long ASCII-only string exercises the auto-vectorized fast path. + assert_eq!(str::repeat("A", 511).word_to_titlecase(), { + let mut expected = String::from("A"); + expected.push_str(&str::repeat("a", 510)); + expected + }); +} + #[test] fn to_casefold_unnormalized() { assert_eq!("".to_casefold_unnormalized(), ""); From ac53b43f85694fbb0878d476265d54612ac9ba50 Mon Sep 17 00:00:00 2001 From: Rachit2323 Date: Tue, 14 Jul 2026 21:08:36 +0530 Subject: [PATCH 03/33] add ligature test cases to word_to_titlecase --- library/alloctests/tests/str.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/alloctests/tests/str.rs b/library/alloctests/tests/str.rs index 195cbf75cf9c2..013149d1623fa 100644 --- a/library/alloctests/tests/str.rs +++ b/library/alloctests/tests/str.rs @@ -1922,6 +1922,21 @@ fn word_to_titlecase() { expected.push_str(&str::repeat("a", 510)); expected }); + + // LJ ligatures and title-case characters. + // Lj is already a title-case letter, so it stays as the first char. + assert_eq!("Ljj".word_to_titlecase(), "Ljj"); + assert_eq!("LjJ".word_to_titlecase(), "Ljj"); + // l is the first cased char (uppercases to L), Lj lowercases to lj. + assert_eq!("lLjfi".word_to_titlecase(), "Lljfi"); + assert_eq!("LLjfi".word_to_titlecase(), "Lljfi"); + + // LJ ligatures: lower=lj (U+01C9), upper=LJ (U+01C7), title=Lj (U+01C8). + // ß decomposes to "Ss" in title case (first char) but stays ß elsewhere. + assert_eq!("ßljLJLj".word_to_titlecase(), "Ssljljlj"); + assert_eq!("ljLJLjß".word_to_titlecase(), "Ljljljß"); + assert_eq!("LJLjßlj".word_to_titlecase(), "Ljljßlj"); + assert_eq!("LjßljLJ".word_to_titlecase(), "Ljßljlj"); } #[test] From 905a7e08b83e9d28d27e6336cfe05694a30ab22c Mon Sep 17 00:00:00 2001 From: Dnreikronos Date: Thu, 16 Jul 2026 10:56:16 -0300 Subject: [PATCH 04/33] Track placeholder assumptions for created universes --- .../src/canonical/mod.rs | 8 ++++++- .../src/placeholder.rs | 24 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/canonical/mod.rs b/compiler/rustc_next_trait_solver/src/canonical/mod.rs index b2f6ac78040b6..0b98f312481da 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/mod.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/mod.rs @@ -160,7 +160,13 @@ where let prev_universe = delegate.universe(); let universes_created_in_query = response.max_universe.index(); for _ in 0..universes_created_in_query { - delegate.create_next_universe(); + let new_universe = delegate.create_next_universe(); + if delegate.cx().assumptions_on_binders() { + delegate.insert_placeholder_assumptions( + new_universe, + Some(rustc_type_ir::region_constraint::Assumptions::empty()), + ); + } } let var_values = response.value.var_values(); diff --git a/compiler/rustc_next_trait_solver/src/placeholder.rs b/compiler/rustc_next_trait_solver/src/placeholder.rs index b5bb488c43b89..cc463304c5152 100644 --- a/compiler/rustc_next_trait_solver/src/placeholder.rs +++ b/compiler/rustc_next_trait_solver/src/placeholder.rs @@ -47,6 +47,7 @@ where IndexMap, ty::BoundTy>, IndexMap, ty::BoundConst>, ) { + let old_universes = universe_indices.clone(); let mut replacer = BoundVarReplacer { infcx, mapped_regions: Default::default(), @@ -57,8 +58,29 @@ where }; let value = value.fold_with(&mut replacer); + let BoundVarReplacer { + mapped_regions, + mapped_types, + mapped_consts, + universe_indices, + infcx: _, + current_index: _, + } = replacer; + + if infcx.cx().assumptions_on_binders() { + for (old, new) in old_universes.into_iter().zip(universe_indices.iter()) { + if let (None, Some(new)) = (old, new) { + // FIXME(-Zassumptions-on-binders): `replace_bound_vars` does not have enough + // context to compute placeholder assumptions for the binders it enters. + infcx.insert_placeholder_assumptions( + *new, + Some(rustc_type_ir::region_constraint::Assumptions::empty()), + ); + } + } + } - (value, replacer.mapped_regions, replacer.mapped_types, replacer.mapped_consts) + (value, mapped_regions, mapped_types, mapped_consts) } fn universe_for(&mut self, debruijn: ty::DebruijnIndex) -> ty::UniverseIndex { From 8211f9061397ec204877641153254f5ac8406002 Mon Sep 17 00:00:00 2001 From: Dnreikronos Date: Thu, 16 Jul 2026 10:56:31 -0300 Subject: [PATCH 05/33] Add coverage for placeholder assumption ICE --- .../placeholder-assumptions-issue-157840.rs | 17 +++++++++++++++++ .../placeholder-assumptions-issue-157840.stderr | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.rs create mode 100644 tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.stderr diff --git a/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.rs b/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.rs new file mode 100644 index 0000000000000..74f0618e4291f --- /dev/null +++ b/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.rs @@ -0,0 +1,17 @@ +//@ compile-flags: -Znext-solver=globally -Zassumptions-on-binders + +trait Trait {} + +trait Proj<'a> { + type Assoc; +} + +fn foo<'a, T>() +where + T: Proj<'a, Assoc = fn(::Assoc)>, + (): Trait<>::Assoc>, + //~^ ERROR the trait bound `(): Trait fn(>::Assoc))>` is not satisfied +{ +} + +fn main() {} diff --git a/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.stderr b/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.stderr new file mode 100644 index 0000000000000..5e8e131addd28 --- /dev/null +++ b/tests/ui/assumptions_on_binders/placeholder-assumptions-issue-157840.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `(): Trait fn(>::Assoc))>` is not satisfied + --> $DIR/placeholder-assumptions-issue-157840.rs:12:9 + | +LL | (): Trait<>::Assoc>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait fn(>::Assoc))>` is not implemented for `()` + | +help: consider extending the `where` clause, but there might be an alternative better way to express this requirement + | +LL | (): Trait<>::Assoc>, (): Trait fn(>::Assoc))> + | +++++++++++++++++++++++++++++++++++++++++++++++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. From 74c230edd24e3507d7a7212ef91b54e6e1c3457b Mon Sep 17 00:00:00 2001 From: sgasho Date: Fri, 10 Jul 2026 11:00:59 +0000 Subject: [PATCH 06/33] ci: Enable autodiff tests on x86_64 linux * Enable autodiff tests on x86_64 linux * move autodiff job def * remove redundant ./x build --- .../optional-x86_64-gnu-autodiff/Dockerfile | 37 +++++++++++++++++++ src/ci/docker/scripts/autodiff.sh | 9 +++++ src/ci/github-actions/jobs.yml | 4 ++ 3 files changed, 50 insertions(+) create mode 100644 src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile create mode 100755 src/ci/docker/scripts/autodiff.sh diff --git a/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile b/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile new file mode 100644 index 0000000000000..f4633f951c645 --- /dev/null +++ b/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:24.04 + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + make \ + ninja-build \ + file \ + curl \ + ca-certificates \ + python3 \ + git \ + cmake \ + pkg-config \ + xz-utils \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +COPY scripts/autodiff.sh /scripts/ + +ENV NO_DOWNLOAD_CI_LLVM 1 +ENV CODEGEN_BACKENDS llvm + +ENV RUST_CONFIGURE_ARGS \ + --build=x86_64-unknown-linux-gnu \ + --enable-llvm-enzyme \ + --enable-llvm-link-shared \ + --enable-ninja \ + --enable-option-checking \ + --disable-docs \ + --set llvm.download-ci-llvm=false + +ENV SCRIPT /scripts/autodiff.sh diff --git a/src/ci/docker/scripts/autodiff.sh b/src/ci/docker/scripts/autodiff.sh new file mode 100755 index 0000000000000..90b36078faccd --- /dev/null +++ b/src/ci/docker/scripts/autodiff.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +../x.py test --stage 2 --no-fail-fast \ + tests/codegen-llvm/autodiff \ + tests/pretty/autodiff \ + tests/ui/autodiff \ + tests/ui/feature-gates/feature-gate-autodiff.rs diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index a8eebe7599fda..a6b23fe516c89 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -469,6 +469,10 @@ auto: - name: x86_64-gnu-miri <<: *job-linux-4c + - name: optional-x86_64-gnu-autodiff + continue_on_error: true + <<: *job-linux-4c + #################### # macOS Builders # #################### From 4ee71fea02ec90e3031966ee46ea28bfabe91142 Mon Sep 17 00:00:00 2001 From: sgasho Date: Sun, 19 Jul 2026 18:13:29 +0900 Subject: [PATCH 07/33] docs: add autodiff CI job document --- src/ci/github-actions/jobs.yml | 1 + src/doc/rustc-dev-guide/src/SUMMARY.md | 1 + .../src/tests/autodiff-ci-job.md | 45 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 src/doc/rustc-dev-guide/src/tests/autodiff-ci-job.md diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index a6b23fe516c89..706095890b114 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -471,6 +471,7 @@ auto: - name: optional-x86_64-gnu-autodiff continue_on_error: true + doc_url: https://rustc-dev-guide.rust-lang.org/tests/autodiff-ci-job.html <<: *job-linux-4c #################### diff --git a/src/doc/rustc-dev-guide/src/SUMMARY.md b/src/doc/rustc-dev-guide/src/SUMMARY.md index bf2de84575d69..6a3a5a0a936f3 100644 --- a/src/doc/rustc-dev-guide/src/SUMMARY.md +++ b/src/doc/rustc-dev-guide/src/SUMMARY.md @@ -34,6 +34,7 @@ - [Codegen backend testing](./tests/codegen-backend-tests/intro.md) - [Cranelift codegen backend](./tests/codegen-backend-tests/cg_clif.md) - [GCC codegen backend](./tests/codegen-backend-tests/cg_gcc.md) + - [Autodiff CI job](./tests/autodiff-ci-job.md) - [Performance testing](./tests/perf.md) - [Pre-stabilization CI job for the next solver and polonius alpha](./tests/x86_64-gnu-next-trait-solver-polonius-ci-job.md) - [Misc info](./tests/misc.md) diff --git a/src/doc/rustc-dev-guide/src/tests/autodiff-ci-job.md b/src/doc/rustc-dev-guide/src/tests/autodiff-ci-job.md new file mode 100644 index 0000000000000..3e5d55fbc81a9 --- /dev/null +++ b/src/doc/rustc-dev-guide/src/tests/autodiff-ci-job.md @@ -0,0 +1,45 @@ +# Autodiff CI job + +The [`optional-x86_64-gnu-autodiff`] job provides continuous test coverage for +the experimental `autodiff` feature and its integration with LLVM Enzyme. It is +an optional [auto job](./ci.md#auto-builds), so a failure does not prevent a +pull request from being merged. + +For more context about the feature, see the [autodiff tracking issue] and the +[autodiff internals](../autodiff/internals.md) chapter. + +## What is tested + +The job checks: + +- forward- and reverse-mode macro expansion and diagnostics; +- LLVM IR generation for autodiff; +- enforcement of the `autodiff` feature gate. + +## Running the job + +To run the job in a try build, comment on a pull request: + +```text +@bors try jobs=optional-x86_64-gnu-autodiff +``` + +To run the job locally, run this command from a Rust checkout: + +```console +$ cargo run --manifest-path src/ci/citool/Cargo.toml run-local optional-x86_64-gnu-autodiff +``` + +See [Testing with Docker](./docker.md) for more information about running CI +jobs locally. + +## Point of contact + +If you have questions or need help with a failure in this job, open a new topic +in the [autodiff Zulip channel]. For suspected Enzyme backend failures, see the +[autodiff debugging guide]. + +[autodiff Zulip channel]: https://rust-lang.zulipchat.com/#narrow/channel/390790-wg-autodiff +[autodiff debugging guide]: ../autodiff/debugging.md +[autodiff tracking issue]: https://github.com/rust-lang/rust/issues/124509 +[`optional-x86_64-gnu-autodiff`]: https://github.com/rust-lang/rust/blob/HEAD/src/ci/github-actions/jobs.yml From 4e53ac1907b713026674cf110961e2f4fe844f06 Mon Sep 17 00:00:00 2001 From: Yukang Date: Tue, 14 Jul 2026 23:18:54 +0800 Subject: [PATCH 08/33] Add allow_list checking for eii implementation attributes --- .../rustc_ast_passes/src/ast_validation.rs | 46 +++++++- compiler/rustc_ast_passes/src/diagnostics.rs | 11 ++ compiler/rustc_passes/src/check_attr.rs | 16 --- compiler/rustc_passes/src/diagnostics.rs | 10 -- ...tation-attribute-allowlist-issue-159015.rs | 102 ++++++++++++++++++ ...on-attribute-allowlist-issue-159015.stderr | 67 ++++++++++++ tests/ui/eii/track_caller_errors.stderr | 3 +- 7 files changed, 226 insertions(+), 29 deletions(-) create mode 100644 tests/ui/eii/implementation-attribute-allowlist-issue-159015.rs create mode 100644 tests/ui/eii/implementation-attribute-allowlist-issue-159015.stderr diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 478dbc0dd7684..f7d9acef6eb84 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -1202,6 +1202,48 @@ impl<'a> AstValidator<'a> { self.visit_vis(vis); self.visit_ident(ident); } + + // Check EII implementation attributes against an allowlist. + fn check_eii_impl_attrs(&self, attrs: &[Attribute], eii_impls: &[EiiImpl]) { + if eii_impls.is_empty() { + return; + } + + let allowed_attrs: &[Symbol] = &[ + sym::allow, + sym::warn, + sym::deny, + sym::forbid, + sym::expect, + sym::doc, + sym::inline, + sym::cold, + sym::optimize, + sym::coverage, + sym::sanitize, + sym::must_use, + sym::deprecated, + ]; + + for attr in attrs { + let AttrKind::Normal(normal) = &attr.kind else { + continue; + }; + if attr.has_any_name(allowed_attrs) { + continue; + } + + let attr_name = pprust::path_to_string(&normal.item.path); + for eii_impl in eii_impls { + self.dcx().emit_err(diagnostics::EiiImplAttributeNotSupported { + attr_span: attr.span, + attr_name: &attr_name, + eii_span: eii_impl.span, + eii_name: pprust::path_to_string(&eii_impl.eii_macro_path), + }); + } + } + } } /// Checks that generic parameters are in the correct order, @@ -1391,6 +1433,7 @@ impl Visitor<'_> for AstValidator<'_> { for EiiImpl { eii_macro_path, .. } in eii_impls { self.visit_path(eii_macro_path); } + self.check_eii_impl_attrs(&item.attrs, eii_impls); let is_intrinsic = item.attrs.iter().any(|a| a.has_name(sym::rustc_intrinsic)); if body.is_none() && !is_intrinsic && !self.is_sdylib_interface { @@ -1566,8 +1609,9 @@ impl Visitor<'_> for AstValidator<'_> { visit::walk_item(self, item); } - ItemKind::Static(StaticItem { expr, safety, .. }) => { + ItemKind::Static(StaticItem { expr, safety, eii_impls, .. }) => { self.check_item_safety(item.span, *safety); + self.check_eii_impl_attrs(&item.attrs, eii_impls); if matches!(safety, Safety::Unsafe(_)) { self.dcx().emit_err(diagnostics::UnsafeStatic { span: item.span }); } diff --git a/compiler/rustc_ast_passes/src/diagnostics.rs b/compiler/rustc_ast_passes/src/diagnostics.rs index 0cf7ef5c1de19..5bcffe96f6086 100644 --- a/compiler/rustc_ast_passes/src/diagnostics.rs +++ b/compiler/rustc_ast_passes/src/diagnostics.rs @@ -189,6 +189,17 @@ pub(crate) struct FnParamForbiddenAttr { pub span: Span, } +#[derive(Diagnostic)] +#[diag("`#[{$eii_name}]` is not allowed to have `#[{$attr_name}]`")] +pub(crate) struct EiiImplAttributeNotSupported<'a> { + #[primary_span] + pub attr_span: Span, + pub attr_name: &'a str, + pub eii_name: String, + #[label("`#[{$eii_name}]` is not allowed to have `#[{$attr_name}]`")] + pub eii_span: Span, +} + #[derive(Diagnostic)] #[diag("`self` parameter is only allowed in associated functions")] #[note("associated functions are those in `impl` or `trait` definitions")] diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 3139c8746b95a..8408b2e889063 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -791,22 +791,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { sig_span: sig.span, }); } - - if let Some(impls) = find_attr!(attrs, EiiImpls(impls) => impls) { - let sig = self.tcx.hir_node(hir_id).fn_sig().unwrap(); - for i in impls { - let name = match i.resolution { - EiiImplResolution::Macro(def_id) => self.tcx.item_name(def_id), - EiiImplResolution::Known(def_id) => self.tcx.item_name(def_id), - EiiImplResolution::Error(_eg) => continue, - }; - self.dcx().emit_err(diagnostics::EiiWithTrackCaller { - attr_span, - name, - sig_span: sig.span, - }); - } - } } _ => {} } diff --git a/compiler/rustc_passes/src/diagnostics.rs b/compiler/rustc_passes/src/diagnostics.rs index 2589941d7dae1..860cc435db330 100644 --- a/compiler/rustc_passes/src/diagnostics.rs +++ b/compiler/rustc_passes/src/diagnostics.rs @@ -1077,16 +1077,6 @@ pub(crate) struct EiiImplRequiresUnsafeSuggestion { pub right: Span, } -#[derive(Diagnostic)] -#[diag("`#[{$name}]` is not allowed to have `#[track_caller]`")] -pub(crate) struct EiiWithTrackCaller { - #[primary_span] - pub attr_span: Span, - pub name: Symbol, - #[label("`#[{$name}]` is not allowed to have `#[track_caller]`")] - pub sig_span: Span, -} - #[derive(Diagnostic)] #[diag("`#[{$name}]` {$kind} required, but not found")] pub(crate) struct EiiWithoutImpl { diff --git a/tests/ui/eii/implementation-attribute-allowlist-issue-159015.rs b/tests/ui/eii/implementation-attribute-allowlist-issue-159015.rs new file mode 100644 index 0000000000000..d27ea2a833e0f --- /dev/null +++ b/tests/ui/eii/implementation-attribute-allowlist-issue-159015.rs @@ -0,0 +1,102 @@ +// EII implementations only accept attributes from a conservative allowlist. +// Regression test for #159015 + +//@ edition: 2024 +//@ needs-asm-support + +#![feature(coverage_attribute)] +#![feature(extern_item_impls)] +#![feature(optimize_attribute)] +#![feature(sanitize)] + +#[eii] +fn allowed(); + +/// Sugared and explicit documentation attributes are both allowed. +#[allowed] +#[allow(dead_code)] +#[warn(unreachable_code)] +#[deny(unused_mut)] +#[forbid(unsafe_code)] +#[expect(unused_variables)] +#[cfg(all())] +#[doc = "An allowed EII implementation."] +#[cold] +#[optimize(none)] +#[coverage(off)] +#[sanitize(address = "off")] +#[must_use] +#[deprecated] +fn allowed_impl() { + let unused = (); +} + +#[eii] +fn allowed_inline(); + +#[allowed_inline] +#[allow(unused_attributes)] +#[cfg_attr(all(), inline)] +fn allowed_inline_impl() {} + +#[eii] +fn foo(); + +#[foo] +#[unsafe(no_mangle)] +//~^ ERROR `#[foo]` is not allowed to have `#[no_mangle]` +fn bar() {} + +#[eii] +fn baz(); + +#[baz] +#[unsafe(export_name = "qux")] +//~^ ERROR `#[baz]` is not allowed to have `#[export_name]` +fn qux() {} + +#[eii] +fn quux(); + +#[quux] +#[unsafe(link_section = "__TEXT,__text")] +//~^ ERROR `#[quux]` is not allowed to have `#[link_section]` +fn corge() {} + +#[eii] +fn grault(); + +#[grault] +#[track_caller] +//~^ ERROR `#[grault]` is not allowed to have `#[track_caller]` +fn garply() {} + +#[eii] +extern "C" fn naked_attr(); + +#[naked_attr] +#[unsafe(naked)] +//~^ ERROR `#[naked_attr]` is not allowed to have `#[naked]` +extern "C" fn naked_attr_impl() { + core::arch::naked_asm!("") +} + +#[eii] +fn multiple_invalid_attrs(); + +#[multiple_invalid_attrs] +#[unsafe(no_mangle)] +//~^ ERROR `#[multiple_invalid_attrs]` is not allowed to have `#[no_mangle]` +#[track_caller] +//~^ ERROR `#[multiple_invalid_attrs]` is not allowed to have `#[track_caller]` +fn multiple_invalid_attrs_impl() {} + +#[eii(static_eii)] +static STATIC_EII: u8; + +#[static_eii] +#[used] +//~^ ERROR `#[static_eii]` is not allowed to have `#[used]` +static STATIC_EII_IMPL: u8 = 0; + +fn main() {} diff --git a/tests/ui/eii/implementation-attribute-allowlist-issue-159015.stderr b/tests/ui/eii/implementation-attribute-allowlist-issue-159015.stderr new file mode 100644 index 0000000000000..af9673099f20f --- /dev/null +++ b/tests/ui/eii/implementation-attribute-allowlist-issue-159015.stderr @@ -0,0 +1,67 @@ +error: `#[foo]` is not allowed to have `#[no_mangle]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:46:1 + | +LL | #[foo] + | ------ `#[foo]` is not allowed to have `#[no_mangle]` +LL | #[unsafe(no_mangle)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: `#[baz]` is not allowed to have `#[export_name]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:54:1 + | +LL | #[baz] + | ------ `#[baz]` is not allowed to have `#[export_name]` +LL | #[unsafe(export_name = "qux")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `#[quux]` is not allowed to have `#[link_section]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:62:1 + | +LL | #[quux] + | ------- `#[quux]` is not allowed to have `#[link_section]` +LL | #[unsafe(link_section = "__TEXT,__text")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `#[grault]` is not allowed to have `#[track_caller]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:70:1 + | +LL | #[grault] + | --------- `#[grault]` is not allowed to have `#[track_caller]` +LL | #[track_caller] + | ^^^^^^^^^^^^^^^ + +error: `#[naked_attr]` is not allowed to have `#[naked]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:78:1 + | +LL | #[naked_attr] + | ------------- `#[naked_attr]` is not allowed to have `#[naked]` +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + +error: `#[multiple_invalid_attrs]` is not allowed to have `#[no_mangle]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:88:1 + | +LL | #[multiple_invalid_attrs] + | ------------------------- `#[multiple_invalid_attrs]` is not allowed to have `#[no_mangle]` +LL | #[unsafe(no_mangle)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: `#[multiple_invalid_attrs]` is not allowed to have `#[track_caller]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:90:1 + | +LL | #[multiple_invalid_attrs] + | ------------------------- `#[multiple_invalid_attrs]` is not allowed to have `#[track_caller]` +... +LL | #[track_caller] + | ^^^^^^^^^^^^^^^ + +error: `#[static_eii]` is not allowed to have `#[used]` + --> $DIR/implementation-attribute-allowlist-issue-159015.rs:98:1 + | +LL | #[static_eii] + | ------------- `#[static_eii]` is not allowed to have `#[used]` +LL | #[used] + | ^^^^^^^ + +error: aborting due to 8 previous errors + diff --git a/tests/ui/eii/track_caller_errors.stderr b/tests/ui/eii/track_caller_errors.stderr index e096146b67830..356f86093d638 100644 --- a/tests/ui/eii/track_caller_errors.stderr +++ b/tests/ui/eii/track_caller_errors.stderr @@ -4,8 +4,7 @@ error: `#[decl1]` is not allowed to have `#[track_caller]` LL | #[track_caller] | ^^^^^^^^^^^^^^^ LL | #[decl1] -LL | fn impl1(x: u64) { - | ---------------- `#[decl1]` is not allowed to have `#[track_caller]` + | -------- `#[decl1]` is not allowed to have `#[track_caller]` error: aborting due to 1 previous error From f68af893b54f5280f04fdcda2e964961b051ced1 Mon Sep 17 00:00:00 2001 From: sgasho Date: Tue, 21 Jul 2026 22:22:31 +0900 Subject: [PATCH 09/33] rdg: Move Autodiff CI job below performance testing --- src/doc/rustc-dev-guide/src/SUMMARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustc-dev-guide/src/SUMMARY.md b/src/doc/rustc-dev-guide/src/SUMMARY.md index 6a3a5a0a936f3..a2b386cc83071 100644 --- a/src/doc/rustc-dev-guide/src/SUMMARY.md +++ b/src/doc/rustc-dev-guide/src/SUMMARY.md @@ -34,8 +34,8 @@ - [Codegen backend testing](./tests/codegen-backend-tests/intro.md) - [Cranelift codegen backend](./tests/codegen-backend-tests/cg_clif.md) - [GCC codegen backend](./tests/codegen-backend-tests/cg_gcc.md) - - [Autodiff CI job](./tests/autodiff-ci-job.md) - [Performance testing](./tests/perf.md) + - [Autodiff CI job](./tests/autodiff-ci-job.md) - [Pre-stabilization CI job for the next solver and polonius alpha](./tests/x86_64-gnu-next-trait-solver-polonius-ci-job.md) - [Misc info](./tests/misc.md) - [Debugging the compiler](./compiler-debugging.md) From 2bb8a3b44ab94616e7757364c8e567f351e72de1 Mon Sep 17 00:00:00 2001 From: sgasho Date: Tue, 21 Jul 2026 22:23:34 +0900 Subject: [PATCH 10/33] Delete autodiff.sh and move the test command to the Dockerfile --- .../host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile | 8 +++++--- src/ci/docker/scripts/autodiff.sh | 9 --------- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100755 src/ci/docker/scripts/autodiff.sh diff --git a/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile b/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile index f4633f951c645..a7b6dc620e967 100644 --- a/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile +++ b/src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile @@ -20,8 +20,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh -COPY scripts/autodiff.sh /scripts/ - ENV NO_DOWNLOAD_CI_LLVM 1 ENV CODEGEN_BACKENDS llvm @@ -34,4 +32,8 @@ ENV RUST_CONFIGURE_ARGS \ --disable-docs \ --set llvm.download-ci-llvm=false -ENV SCRIPT /scripts/autodiff.sh +ENV SCRIPT="../x.py test --stage 2 --no-fail-fast \ + tests/codegen-llvm/autodiff \ + tests/pretty/autodiff \ + tests/ui/autodiff \ + tests/ui/feature-gates/feature-gate-autodiff.rs" diff --git a/src/ci/docker/scripts/autodiff.sh b/src/ci/docker/scripts/autodiff.sh deleted file mode 100755 index 90b36078faccd..0000000000000 --- a/src/ci/docker/scripts/autodiff.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -ex - -../x.py test --stage 2 --no-fail-fast \ - tests/codegen-llvm/autodiff \ - tests/pretty/autodiff \ - tests/ui/autodiff \ - tests/ui/feature-gates/feature-gate-autodiff.rs From 737220233d0c8c591b96546e83eec7b2194d555e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Tue, 21 Jul 2026 15:50:58 +0000 Subject: [PATCH 11/33] Make some parser structured suggestions verbose Replace most of the `.span_suggestion(` in `rustc_parse` with `.span_suggestion_verbose(`, as they are more readabale, if more verbose. Verbose suggestions also tend to highlight off-by-one `Span` errors better. --- compiler/rustc_parse/src/lexer/mod.rs | 2 +- .../src/lexer/unescape_error_reporting.rs | 10 ++--- .../rustc_parse/src/parser/diagnostics.rs | 16 ++++---- compiler/rustc_parse/src/parser/expr.rs | 13 ++++-- compiler/rustc_parse/src/parser/item.rs | 16 ++++---- compiler/rustc_parse/src/parser/mod.rs | 2 +- compiler/rustc_parse/src/parser/path.rs | 4 +- .../in-trait/bad-signatures.stderr | 11 +++-- tests/ui/async-await/no-async-const.stderr | 10 +++-- tests/ui/async-await/no-unsafe-async.stderr | 20 ++++++---- .../attribute/attr-with-a-semicolon.stderr | 8 +--- tests/ui/parser/duplicate-visibility.stderr | 10 +++-- tests/ui/parser/eq-less-to-less-eq.stderr | 10 +++-- tests/ui/parser/inverted-parameters.stderr | 33 +++++++++------ tests/ui/parser/issues/issue-113342.stderr | 11 +++-- tests/ui/parser/issues/issue-19398.stderr | 10 +++-- .../ui/parser/issues/issue-76437-async.stderr | 11 +++-- .../issue-76437-const-async-unsafe.stderr | 11 +++-- .../issues/issue-76437-const-async.stderr | 11 +++-- .../ui/parser/issues/issue-76437-const.stderr | 11 +++-- .../issue-76437-pub-crate-unsafe.stderr | 11 +++-- .../parser/issues/issue-76437-unsafe.stderr | 11 +++-- .../const-async-const.stderr | 10 +++-- .../issue-87217-keyword-order/recovery.stderr | 20 ++++++---- .../several-kw-jump.stderr | 10 +++-- .../wrong-async.stderr | 10 +++-- .../wrong-const.stderr | 10 +++-- .../wrong-unsafe-abi.stderr | 10 +++-- .../wrong-unsafe.stderr | 10 +++-- .../issues/issue-87694-duplicated-pub.stderr | 10 +++-- .../issues/issue-87694-misplaced-pub.stderr | 11 +++-- tests/ui/parser/issues/issue-89396.stderr | 21 ++++++---- .../issues/recover-ge-as-fat-arrow.stderr | 11 +++-- .../kw-in-item-pos-recovery-151238.stderr | 11 +++-- .../macro/misspelled-macro-rules.stderr | 10 +++-- .../ui/parser/range-exclusive-dotdotlt.stderr | 40 +++++++++++++------ .../ui/parser/raw/raw-byte-string-eof.stderr | 8 ++-- tests/ui/parser/raw/raw-str-unbalanced.stderr | 24 +++++++++-- tests/ui/parser/raw/raw-string-2.stderr | 6 ++- tests/ui/parser/raw/raw-string.stderr | 8 ++-- .../removed-syntax-field-let-2.stderr | 20 ++++++---- .../removed-syntax-field-let.stderr | 10 +++-- .../suggest-add-self-issue-131084.stderr | 11 +++-- .../ice-120503-async-const-method.stderr | 10 +++-- 44 files changed, 339 insertions(+), 204 deletions(-) diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 1a30d5f1e79a0..4f7c76e7df816 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -987,7 +987,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { let lo = start + BytePos(possible_offset); let hi = lo + BytePos(found_terminators); let span = self.mk_sp(lo, hi); - err.span_suggestion( + err.span_suggestion_verbose( span, "consider terminating the string here", "#".repeat(n_hashes as usize), diff --git a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs index 54c8f3c09ec48..9176192c95640 100644 --- a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs +++ b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs @@ -162,7 +162,7 @@ pub(crate) fn emit_unescape_error( ); } else { if mode == Mode::Str || mode == Mode::Char { - diag.span_suggestion( + diag.span_suggestion_verbose( full_lit_span, "if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal", format!("r\"{lit}\""), @@ -204,7 +204,7 @@ pub(crate) fn emit_unescape_error( // Note: the \\xHH suggestions are not given for raw byte string // literals, because they are araw and so cannot use any escapes. if (c as u32) <= 0xFF && mode != Mode::RawByteStr { - err.span_suggestion( + err.span_suggestion_verbose( span, format!( "if you meant to use the unicode code point for {c:?}, use a \\xHH escape" @@ -217,7 +217,7 @@ pub(crate) fn emit_unescape_error( } else if mode != Mode::RawByteStr { let mut utf8 = String::new(); utf8.push(c); - err.span_suggestion( + err.span_suggestion_verbose( span, format!("if you meant to use the UTF-8 encoding of {c:?}, use \\xHH escapes"), utf8.as_bytes() @@ -313,7 +313,7 @@ fn foreign_escape_suggestion( err_span: Span, ) { if escaped_char == "?" { - diag.span_suggestion( + diag.span_suggestion_verbose( err_span, "if you meant to write a literal question mark, don't escape the character", "?", @@ -336,7 +336,7 @@ fn foreign_escape_suggestion( _ => return, }; - diag.span_suggestion( + diag.span_suggestion_verbose( escape_span, format!("if you meant to write {name}, use a hex escape"), format!("x{hex}"), diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index e5be778458135..9ee4576e3483c 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -597,7 +597,7 @@ impl<'a> Parser<'a> { .iter() .any(|tok| matches!(tok, TokenType::FatArrow | TokenType::CloseBrace)) { - err.span_suggestion( + err.span_suggestion_verbose( self.token.span, "you might have meant to write a \"greater than or equal to\" comparison", ">=", @@ -942,7 +942,7 @@ impl<'a> Parser<'a> { count += 1; } err.span(span); - err.span_suggestion( + err.span_suggestion_verbose( span, format!("remove the extra `#`{}", pluralize!(count)), "", @@ -2062,7 +2062,7 @@ impl<'a> Parser<'a> { Applicability::MachineApplicable, ); } - err.span_suggestion(lo.shrink_to_lo(), format!("{prefix}you can still access the deprecated `try!()` macro using the \"raw identifier\" syntax"), "r#", Applicability::MachineApplicable); + err.span_suggestion_verbose(lo.shrink_to_lo(), format!("{prefix}you can still access the deprecated `try!()` macro using the \"raw identifier\" syntax"), "r#", Applicability::MachineApplicable); let guar = err.emit(); Ok(self.mk_expr_err(lo.to(hi), guar)) } else { @@ -2243,7 +2243,7 @@ impl<'a> Parser<'a> { let ident = self.parse_ident_common(true).unwrap(); let span = pat.span.with_hi(ident.span.hi()); - err.span_suggestion( + err.span_suggestion_verbose( span, "declare the type after the parameter binding", ": ", @@ -2641,7 +2641,7 @@ impl<'a> Parser<'a> { Ok((expr, _)) => { // Find a mistake like `MyTrait`. if snapshot.token == token::EqEq { - err.span_suggestion( + err.span_suggestion_verbose( snapshot.token.span, "if you meant to use an associated type binding, replace `==` with `=`", "=", @@ -2655,7 +2655,7 @@ impl<'a> Parser<'a> { && matches!(expr.kind, ExprKind::Path(..)) { // Find a mistake like "foo::var:A". - err.span_suggestion( + err.span_suggestion_verbose( snapshot.token.span, "write a path separator here", "::", @@ -2938,7 +2938,7 @@ impl<'a> Parser<'a> { Applicability::MachineApplicable, ); if let CommaRecoveryMode::EitherTupleOrPipe = rt { - err.span_suggestion( + err.span_suggestion_verbose( comma_span, "...or a vertical bar to match on alternatives", " |", @@ -2975,7 +2975,7 @@ impl<'a> Parser<'a> { && (self.expected_token_types.contains(TokenType::Gt) || matches!(self.token.kind, token::Literal(..))) { - err.span_suggestion( + err.span_suggestion_verbose( maybe_lt.span, "remove the `<` to write an exclusive range", "", diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 92e8f5eefadb2..a3dea980e67c2 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1699,7 +1699,12 @@ impl<'a> Parser<'a> { // directly adjacent (i.e. '=<') if maybe_eq_tok == TokenKind::Eq && maybe_eq_tok.span.hi() == lt_span.lo() { let eq_lt = maybe_eq_tok.span.to(lt_span); - err.span_suggestion(eq_lt, "did you mean", "<=", Applicability::Unspecified); + err.span_suggestion_verbose( + eq_lt, + "did you mean", + "<=", + Applicability::Unspecified, + ); } err })?; @@ -2755,7 +2760,7 @@ impl<'a> Parser<'a> { && let maybe_let = self.look_ahead(1, |t| t.clone()) && maybe_let.is_keyword(kw::Let) { - err.span_suggestion( + err.span_suggestion_verbose( self.prev_token.span, "consider removing this semicolon to parse the `let` as part of the same chain", "", @@ -2767,7 +2772,7 @@ impl<'a> Parser<'a> { } else { // Look for usages of '=>' where '>=' might be intended if maybe_fatarrow == token::FatArrow { - err.span_suggestion( + err.span_suggestion_verbose( maybe_fatarrow.span, "you might have meant to write a \"greater than or equal to\" comparison", ">=", @@ -3381,7 +3386,7 @@ impl<'a> Parser<'a> { if let Err(mut err) = this.expect(exp!(FatArrow)) { // We might have a `=>` -> `=` or `->` typo (issue #89396). if is_almost_fat_arrow { - err.span_suggestion( + err.span_suggestion_verbose( this.token.span, "use a fat arrow to start a match arm", "=>", diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 192cd7668f518..6de9240c64a91 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -601,7 +601,7 @@ impl<'a> Parser<'a> { && let [segment] = path.segments.as_slice() && edit_distance("macro_rules", &segment.ident.to_string(), 2).is_some() { - err.span_suggestion( + err.span_suggestion_verbose( path.span, "perhaps you meant to define a macro", "macro_rules", @@ -627,7 +627,7 @@ impl<'a> Parser<'a> { if end.is_doc_comment() { err.span_label(end.span, "this doc comment doesn't document anything"); } else if self.token == TokenKind::Semi { - err.span_suggestion_verbose( + err.span_suggestion( self.token.span, "consider removing this semicolon", "", @@ -2474,7 +2474,7 @@ impl<'a> Parser<'a> { .map_err(|err| err.cancel()) && self.token == TokenKind::Colon { - err.span_suggestion( + err.span_suggestion_verbose( removal_span, "remove this `let` keyword", String::new(), @@ -2632,7 +2632,7 @@ impl<'a> Parser<'a> { vec![(open, "{".to_string()), (close, '}'.to_string())], Applicability::MaybeIncorrect, ); - err.span_suggestion( + err.span_suggestion_verbose( span.with_neighbor(self.token.span).shrink_to_hi(), "add a semicolon", ';', @@ -3248,7 +3248,7 @@ impl<'a> Parser<'a> { .span_to_snippet(original_sp) .expect("Span extracted directly from keyword should always work"); - err.span_suggestion( + err.span_suggestion_verbose( self.token_uninterpolated_span(), format!("`{original_kw}` already used earlier, remove this one"), "", @@ -3263,7 +3263,7 @@ impl<'a> Parser<'a> { let misplaced_qual_sp = self.token_uninterpolated_span(); let misplaced_qual = self.span_to_snippet(misplaced_qual_sp).unwrap(); - err.span_suggestion( + err.span_suggestion_verbose( correct_pos_sp.to(misplaced_qual_sp), format!("`{misplaced_qual}` must come before `{current_qual}`"), format!("{misplaced_qual} {current_qual}"), @@ -3287,7 +3287,7 @@ impl<'a> Parser<'a> { // There was no explicit visibility if matches!(orig_vis.kind, VisibilityKind::Inherited) { - err.span_suggestion( + err.span_suggestion_verbose( sp_start.to(self.prev_token.span), format!("visibility `{vs}` must come before `{snippet}`"), format!("{vs} {snippet}"), @@ -3296,7 +3296,7 @@ impl<'a> Parser<'a> { } // There was an explicit visibility else { - err.span_suggestion( + err.span_suggestion_verbose( current_vis.span, "there is already a visibility modifier, remove one", "", diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 09ac1acb74f51..dff6afdc893a7 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -1805,7 +1805,7 @@ impl<'a> Parser<'a> { format!("the {kind_desc} was parsed as having {op_desc} binary expression"), ); - err.span_suggestion( + err.span_suggestion_verbose( lhs_end_span, format!("you may have meant to write a `;` to terminate the {kind_desc} earlier"), ";", diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 2dfcbccfe60ec..8ed2734b7de9c 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -817,13 +817,13 @@ impl<'a> Parser<'a> { .dcx() .struct_span_err(after_eq.to(before_next), "missing type to the right of `=`"); if matches!(self.token.kind, token::Comma | token::Gt) { - err.span_suggestion( + err.span_suggestion_verbose( self.psess.source_map().next_point(eq_span).to(before_next), "to constrain the associated type, add a type after `=`", " TheType", Applicability::HasPlaceholders, ); - err.span_suggestion( + err.span_suggestion_verbose( prev_token_span.shrink_to_hi().to(before_next), format!("remove the `=` if `{ident}` is a type"), "", diff --git a/tests/ui/async-await/in-trait/bad-signatures.stderr b/tests/ui/async-await/in-trait/bad-signatures.stderr index 127a343a93016..1f2f0537af3d1 100644 --- a/tests/ui/async-await/in-trait/bad-signatures.stderr +++ b/tests/ui/async-await/in-trait/bad-signatures.stderr @@ -8,10 +8,13 @@ error: expected one of `:`, `@`, or `|`, found keyword `self` --> $DIR/bad-signatures.rs:5:23 | LL | async fn bar(&abc self); - | -----^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - async fn bar(&abc self); +LL + async fn bar(: ); + | error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/no-async-const.stderr b/tests/ui/async-await/no-async-const.stderr index d692ba8f47375..be02ba17dbe67 100644 --- a/tests/ui/async-await/no-async-const.stderr +++ b/tests/ui/async-await/no-async-const.stderr @@ -2,12 +2,14 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/no-async-const.rs:4:11 | LL | pub async const fn x() {} - | ------^^^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` must come before `async`: `const async` + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async` + | +LL - pub async const fn x() {} +LL + pub const async fn x() {} + | error: functions cannot be both `const` and `async` --> $DIR/no-async-const.rs:4:5 diff --git a/tests/ui/async-await/no-unsafe-async.stderr b/tests/ui/async-await/no-unsafe-async.stderr index 49b112f9313d4..8db98f3c75493 100644 --- a/tests/ui/async-await/no-unsafe-async.stderr +++ b/tests/ui/async-await/no-unsafe-async.stderr @@ -2,23 +2,27 @@ error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/no-unsafe-async.rs:7:12 | LL | unsafe async fn g() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL - unsafe async fn g() {} +LL + async unsafe fn g() {} + | error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/no-unsafe-async.rs:11:8 | LL | unsafe async fn f() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL - unsafe async fn f() {} +LL + async unsafe fn f() {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/attribute/attr-with-a-semicolon.stderr b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr index b77f30fdb5934..0431d3e524fe4 100644 --- a/tests/ui/parser/attribute/attr-with-a-semicolon.stderr +++ b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr @@ -2,13 +2,7 @@ error: expected item after attributes --> $DIR/attr-with-a-semicolon.rs:1:1 | LL | #[derive(Debug, Clone)]; - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -help: consider removing this semicolon - | -LL - #[derive(Debug, Clone)]; -LL + #[derive(Debug, Clone)] - | + | ^^^^^^^^^^^^^^^^^^^^^^^- help: consider removing this semicolon error: aborting due to 1 previous error diff --git a/tests/ui/parser/duplicate-visibility.stderr b/tests/ui/parser/duplicate-visibility.stderr index e00ebe6a8cf6d..a7d5a36c58bfd 100644 --- a/tests/ui/parser/duplicate-visibility.stderr +++ b/tests/ui/parser/duplicate-visibility.stderr @@ -4,10 +4,7 @@ error: expected one of `(`, `async`, `const`, `default`, `extern`, `final`, `fn` LL | extern "C" { | - while parsing this item list starting here LL | pub pub fn foo(); - | ^^^ - | | - | expected one of 10 possible tokens - | help: there is already a visibility modifier, remove one + | ^^^ expected one of 10 possible tokens ... LL | } | - the item list ends here @@ -17,6 +14,11 @@ note: explicit visibility first seen here | LL | pub pub fn foo(); | ^^^ +help: there is already a visibility modifier, remove one + | +LL - pub pub fn foo(); +LL + pub fn foo(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/eq-less-to-less-eq.stderr b/tests/ui/parser/eq-less-to-less-eq.stderr index 4717d8287ff7b..b365aa9769470 100644 --- a/tests/ui/parser/eq-less-to-less-eq.stderr +++ b/tests/ui/parser/eq-less-to-less-eq.stderr @@ -2,9 +2,13 @@ error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:4:15 | LL | if a =< b { - | -- ^ expected one of 7 possible tokens - | | - | help: did you mean: `<=` + | ^ expected one of 7 possible tokens + | +help: did you mean + | +LL - if a =< b { +LL + if a <= b { + | error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:12:15 diff --git a/tests/ui/parser/inverted-parameters.stderr b/tests/ui/parser/inverted-parameters.stderr index 93b95a756087d..8eea01b19ccba 100644 --- a/tests/ui/parser/inverted-parameters.stderr +++ b/tests/ui/parser/inverted-parameters.stderr @@ -2,19 +2,25 @@ error: expected one of `:`, `@`, or `|`, found `bar` --> $DIR/inverted-parameters.rs:6:24 | LL | fn foo(&self, &str bar) {} - | -----^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - fn foo(&self, &str bar) {} +LL + fn foo(&self, : ) {} + | error: expected one of `:`, `@`, or `|`, found `quux` --> $DIR/inverted-parameters.rs:12:10 | LL | fn baz(S quux, xyzzy: i32) {} - | --^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - fn baz(S quux, xyzzy: i32) {} +LL + fn baz(: , xyzzy: i32) {} + | error: expected one of `:`, `@`, or `|`, found `a` --> $DIR/inverted-parameters.rs:17:12 @@ -47,10 +53,13 @@ error: expected one of `:`, `@`, or `|`, found `S` --> $DIR/inverted-parameters.rs:28:23 | LL | fn missing_colon(quux S) {} - | -----^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - fn missing_colon(quux S) {} +LL + fn missing_colon(: ) {} + | error: aborting due to 6 previous errors diff --git a/tests/ui/parser/issues/issue-113342.stderr b/tests/ui/parser/issues/issue-113342.stderr index 6d9f22f6a7ce8..bc7aad3c03fbe 100644 --- a/tests/ui/parser/issues/issue-113342.stderr +++ b/tests/ui/parser/issues/issue-113342.stderr @@ -2,10 +2,13 @@ error: expected `fn`, found keyword `pub` --> $DIR/issue-113342.rs:7:12 | LL | extern "C" pub fn id(x: i32) -> i32 { x } - | -----------^^^ - | | | - | | expected `fn` - | help: visibility `pub` must come before `extern "C"`: `pub extern "C"` + | ^^^ expected `fn` + | +help: visibility `pub` must come before `extern "C"` + | +LL - extern "C" pub fn id(x: i32) -> i32 { x } +LL + pub extern "C" fn id(x: i32) -> i32 { x } + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-19398.stderr b/tests/ui/parser/issues/issue-19398.stderr index 2b97ec50c9172..3fd8bb40a0b8e 100644 --- a/tests/ui/parser/issues/issue-19398.stderr +++ b/tests/ui/parser/issues/issue-19398.stderr @@ -2,12 +2,14 @@ error: expected `fn`, found keyword `unsafe` --> $DIR/issue-19398.rs:2:19 | LL | extern "Rust" unsafe fn foo(); - | --------------^^^^^^ - | | | - | | expected `fn` - | help: `unsafe` must come before `extern "Rust"`: `unsafe extern "Rust"` + | ^^^^^^ expected `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `unsafe` must come before `extern "Rust"` + | +LL - extern "Rust" unsafe fn foo(); +LL + unsafe extern "Rust" fn foo(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-async.stderr b/tests/ui/parser/issues/issue-76437-async.stderr index 483599135f566..4a02c045c7cf2 100644 --- a/tests/ui/parser/issues/issue-76437-async.stderr +++ b/tests/ui/parser/issues/issue-76437-async.stderr @@ -2,10 +2,13 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `pub` --> $DIR/issue-76437-async.rs:4:11 | LL | async pub fn t() {} - | ------^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `async`: `pub async` + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `async` + | +LL - async pub fn t() {} +LL + pub async fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr b/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr index a703fc4e8a452..b296add2beb0a 100644 --- a/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr @@ -2,10 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-const-async-unsafe.rs:4:24 | LL | const async unsafe pub fn t() {} - | -------------------^^^ - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub` must come before `const async unsafe`: `pub const async unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub` must come before `const async unsafe` + | +LL - const async unsafe pub fn t() {} +LL + pub const async unsafe fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const-async.stderr b/tests/ui/parser/issues/issue-76437-const-async.stderr index 81fa8a5f557e0..3d1fc4dc4fdd8 100644 --- a/tests/ui/parser/issues/issue-76437-const-async.stderr +++ b/tests/ui/parser/issues/issue-76437-const-async.stderr @@ -2,10 +2,13 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `pub` --> $DIR/issue-76437-const-async.rs:4:17 | LL | const async pub fn t() {} - | ------------^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const async`: `pub const async` + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const async` + | +LL - const async pub fn t() {} +LL + pub const async fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const.stderr b/tests/ui/parser/issues/issue-76437-const.stderr index 005a27b7c2498..2ebf2042ebd67 100644 --- a/tests/ui/parser/issues/issue-76437-const.stderr +++ b/tests/ui/parser/issues/issue-76437-const.stderr @@ -2,10 +2,13 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-76437-const.rs:4:11 | LL | const pub fn t() {} - | ------^^^ - | | | - | | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const`: `pub const` + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const` + | +LL - const pub fn t() {} +LL + pub const fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr b/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr index 4ea76179be3f6..1cae371ae57ea 100644 --- a/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr @@ -2,10 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-pub-crate-unsafe.rs:4:12 | LL | unsafe pub(crate) fn t() {} - | -------^^^------- - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub(crate)` must come before `unsafe`: `pub(crate) unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub(crate)` must come before `unsafe` + | +LL - unsafe pub(crate) fn t() {} +LL + pub(crate) unsafe fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-unsafe.stderr b/tests/ui/parser/issues/issue-76437-unsafe.stderr index 69f7927750bf0..fb3abb7e9a669 100644 --- a/tests/ui/parser/issues/issue-76437-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-unsafe.stderr @@ -2,10 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-unsafe.rs:4:12 | LL | unsafe pub fn t() {} - | -------^^^ - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub` must come before `unsafe`: `pub unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub` must come before `unsafe` + | +LL - unsafe pub fn t() {} +LL + pub unsafe fn t() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr index ed2e4d8154929..692fbc0350953 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr @@ -2,16 +2,18 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/const-async-const.rs:5:13 | LL | const async const fn test() {} - | ^^^^^ - | | - | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` already used earlier, remove this one + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | note: `const` first seen here --> $DIR/const-async-const.rs:5:1 | LL | const async const fn test() {} | ^^^^^ +help: `const` already used earlier, remove this one + | +LL - const async const fn test() {} +LL + const async fn test() {} + | error: functions cannot be both `const` and `async` --> $DIR/const-async-const.rs:5:1 diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr index 3f504a9ebfc49..a1b3a29c2dd27 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr @@ -2,27 +2,31 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/recovery.rs:6:12 | LL | unsafe const fn from_u32(val: u32) {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `unsafe`: `const unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `unsafe` + | +LL - unsafe const fn from_u32(val: u32) {} +LL + const unsafe fn from_u32(val: u32) {} + | error: expected one of `extern` or `fn`, found keyword `unsafe` --> $DIR/recovery.rs:14:12 | LL | unsafe unsafe fn from_u32(val: u32) {} - | ^^^^^^ - | | - | expected one of `extern` or `fn` - | help: `unsafe` already used earlier, remove this one + | ^^^^^^ expected one of `extern` or `fn` | note: `unsafe` first seen here --> $DIR/recovery.rs:14:5 | LL | unsafe unsafe fn from_u32(val: u32) {} | ^^^^^^ +help: `unsafe` already used earlier, remove this one + | +LL - unsafe unsafe fn from_u32(val: u32) {} +LL + unsafe fn from_u32(val: u32) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr index 489e8eefb052e..ccab054540691 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr @@ -2,12 +2,14 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/several-kw-jump.rs:9:14 | LL | async unsafe const fn test() {} - | -------------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `async unsafe`: `const async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async unsafe` + | +LL - async unsafe const fn test() {} +LL + const async unsafe fn test() {} + | error: functions cannot be both `const` and `async` --> $DIR/several-kw-jump.rs:9:1 diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr index 74989502e7f5d..5423f72fc786b 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr @@ -2,12 +2,14 @@ error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/wrong-async.rs:9:8 | LL | unsafe async fn test() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL - unsafe async fn test() {} +LL + async unsafe fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr index 5958f0c7d2ddd..9d68538ec804f 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr @@ -2,12 +2,14 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/wrong-const.rs:9:8 | LL | unsafe const fn test() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `unsafe`: `const unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `unsafe` + | +LL - unsafe const fn test() {} +LL + const unsafe fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe-abi.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe-abi.stderr index 8ed037869c829..eee9b0b8b8270 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe-abi.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe-abi.stderr @@ -2,12 +2,14 @@ error: expected `fn`, found keyword `unsafe` --> $DIR/wrong-unsafe-abi.rs:9:12 | LL | extern "C" unsafe fn test() {} - | -----------^^^^^^ - | | | - | | expected `fn` - | help: `unsafe` must come before `extern "C"`: `unsafe extern "C"` + | ^^^^^^ expected `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `unsafe` must come before `extern "C"` + | +LL - extern "C" unsafe fn test() {} +LL + unsafe extern "C" fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr index 232da9acef309..e6ea40f15ae8a 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr @@ -2,12 +2,14 @@ error: expected `fn`, found keyword `unsafe` --> $DIR/wrong-unsafe.rs:10:8 | LL | extern unsafe fn test() {} - | -------^^^^^^ - | | | - | | expected `fn` - | help: `unsafe` must come before `extern`: `unsafe extern` + | ^^^^^^ expected `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `unsafe` must come before `extern` + | +LL - extern unsafe fn test() {} +LL + unsafe extern fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr index dd75f32f68ff2..50d58ffb2fb35 100644 --- a/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr +++ b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr @@ -2,16 +2,18 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-87694-duplicated-pub.rs:1:11 | LL | pub const pub fn test() {} - | ^^^ - | | - | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: there is already a visibility modifier, remove one + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` | note: explicit visibility first seen here --> $DIR/issue-87694-duplicated-pub.rs:1:1 | LL | pub const pub fn test() {} | ^^^ +help: there is already a visibility modifier, remove one + | +LL - pub const pub fn test() {} +LL + pub const fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr index d35e09dceaf7f..fcdd07a91182c 100644 --- a/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr +++ b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr @@ -2,10 +2,13 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-87694-misplaced-pub.rs:1:7 | LL | const pub fn test() {} - | ------^^^ - | | | - | | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const`: `pub const` + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const` + | +LL - const pub fn test() {} +LL + pub const fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-89396.stderr b/tests/ui/parser/issues/issue-89396.stderr index 41ce07050746a..8773a7516ff88 100644 --- a/tests/ui/parser/issues/issue-89396.stderr +++ b/tests/ui/parser/issues/issue-89396.stderr @@ -2,19 +2,24 @@ error: expected one of `=>`, `if`, or `|`, found `=` --> $DIR/issue-89396.rs:9:17 | LL | Some(_) = true, - | ^ - | | - | expected one of `=>`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^ expected one of `=>`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL | Some(_) => true, + | + error: expected one of `=>`, `@`, `if`, or `|`, found `->` --> $DIR/issue-89396.rs:12:14 | LL | None -> false, - | ^^ - | | - | expected one of `=>`, `@`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^^ expected one of `=>`, `@`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL - None -> false, +LL + None => false, + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr index 997d080f1deed..2a8c78a776b9e 100644 --- a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr +++ b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr @@ -2,10 +2,13 @@ error: expected one of `...`, `..=`, `..`, `=>`, `if`, or `|`, found `>=` --> $DIR/recover-ge-as-fat-arrow.rs:4:11 | LL | 1 >= {} - | ^^ - | | - | expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^^ expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL - 1 >= {} +LL + 1 => {} + | error[E0308]: mismatched types --> $DIR/recover-ge-as-fat-arrow.rs:5:29 diff --git a/tests/ui/parser/macro/kw-in-item-pos-recovery-151238.stderr b/tests/ui/parser/macro/kw-in-item-pos-recovery-151238.stderr index 81151edaf0c0c..3a7e4779aadfb 100644 --- a/tests/ui/parser/macro/kw-in-item-pos-recovery-151238.stderr +++ b/tests/ui/parser/macro/kw-in-item-pos-recovery-151238.stderr @@ -8,10 +8,13 @@ error: expected one of `:`, `@`, or `|`, found keyword `self` --> $DIR/kw-in-item-pos-recovery-151238.rs:7:28 | LL | trait MyTrait { fn bar(c self) } - | --^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - trait MyTrait { fn bar(c self) } +LL + trait MyTrait { fn bar(: ) } + | error: expected one of `->`, `;`, `where`, or `{`, found `}` --> $DIR/kw-in-item-pos-recovery-151238.rs:7:34 diff --git a/tests/ui/parser/macro/misspelled-macro-rules.stderr b/tests/ui/parser/macro/misspelled-macro-rules.stderr index fc718d8556dfe..bf401caff318b 100644 --- a/tests/ui/parser/macro/misspelled-macro-rules.stderr +++ b/tests/ui/parser/macro/misspelled-macro-rules.stderr @@ -2,9 +2,13 @@ error: expected one of `(`, `[`, or `{`, found `thing` --> $DIR/misspelled-macro-rules.rs:7:14 | LL | marco_rules! thing { - | ----------- ^^^^^ expected one of `(`, `[`, or `{` - | | - | help: perhaps you meant to define a macro: `macro_rules` + | ^^^^^ expected one of `(`, `[`, or `{` + | +help: perhaps you meant to define a macro + | +LL - marco_rules! thing { +LL + macro_rules! thing { + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/range-exclusive-dotdotlt.stderr b/tests/ui/parser/range-exclusive-dotdotlt.stderr index af25e1df343de..9a38473b64403 100644 --- a/tests/ui/parser/range-exclusive-dotdotlt.stderr +++ b/tests/ui/parser/range-exclusive-dotdotlt.stderr @@ -2,17 +2,25 @@ error: expected type, found `10` --> $DIR/range-exclusive-dotdotlt.rs:2:17 | LL | let _ = 0..<10; - | -^^ expected type - | | - | help: remove the `<` to write an exclusive range + | ^^ expected type + | +help: remove the `<` to write an exclusive range + | +LL - let _ = 0..<10; +LL + let _ = 0..10; + | error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `;` --> $DIR/range-exclusive-dotdotlt.rs:8:20 | LL | let _ = 0.. $DIR/range-exclusive-dotdotlt.rs:14:18 @@ -24,17 +32,25 @@ error: expected type, found `1` --> $DIR/range-exclusive-dotdotlt.rs:19:26 | LL | let _ = [1, 2, 3][..<1]; - | -^ expected type - | | - | help: remove the `<` to write an exclusive range + | ^ expected type + | +help: remove the `<` to write an exclusive range + | +LL - let _ = [1, 2, 3][..<1]; +LL + let _ = [1, 2, 3][..1]; + | error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `]` --> $DIR/range-exclusive-dotdotlt.rs:25:29 | LL | let _ = [1, 2, 3][.. $DIR/range-exclusive-dotdotlt.rs:31:30 diff --git a/tests/ui/parser/raw/raw-byte-string-eof.stderr b/tests/ui/parser/raw/raw-byte-string-eof.stderr index 88fd53904c43f..96bc893a4d4cb 100644 --- a/tests/ui/parser/raw/raw-byte-string-eof.stderr +++ b/tests/ui/parser/raw/raw-byte-string-eof.stderr @@ -2,11 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-byte-string-eof.rs:2:5 | LL | br##"a"#; - | ^ - help: consider terminating the string here: `##` - | | - | unterminated raw string + | ^ unterminated raw string | = note: this raw string should be terminated with `"##` +help: consider terminating the string here + | +LL | br##"a"##; + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/raw/raw-str-unbalanced.stderr b/tests/ui/parser/raw/raw-str-unbalanced.stderr index eac8c06c1df5c..d957e555883b6 100644 --- a/tests/ui/parser/raw/raw-str-unbalanced.stderr +++ b/tests/ui/parser/raw/raw-str-unbalanced.stderr @@ -2,18 +2,30 @@ error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:2:10 | LL | r#""## - | -----^ help: remove the extra `#` + | -----^ | | | this raw string started with 1 `#` + | +help: remove the extra `#` + | +LL - r#""## +LL + r#""# + | error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:7:9 | LL | / r#" LL | | "#### - | | -^^^ help: remove the extra `#`s + | | -^^^ | |________| | this raw string started with 1 `#` + | +help: remove the extra `#`s + | +LL - "#### +LL + "# + | error: expected `;`, found `#` --> $DIR/raw-str-unbalanced.rs:10:28 @@ -28,9 +40,15 @@ error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:16:28 | LL | const B: &'static str = r""## - | ---^^ help: remove the extra `#`s + | ---^^ | | | this raw string started with 0 `#`s + | +help: remove the extra `#`s + | +LL - const B: &'static str = r""## +LL + const B: &'static str = r"" + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/raw/raw-string-2.stderr b/tests/ui/parser/raw/raw-string-2.stderr index 90dd9775e62e4..f390155904f69 100644 --- a/tests/ui/parser/raw/raw-string-2.stderr +++ b/tests/ui/parser/raw/raw-string-2.stderr @@ -2,9 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-string-2.rs:2:13 | LL | let x = r###"here's a long string"# "# "##; - | ^ unterminated raw string -- help: consider terminating the string here: `###` + | ^ unterminated raw string | = note: this raw string should be terminated with `"###` +help: consider terminating the string here + | +LL | let x = r###"here's a long string"# "# "###; + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/raw/raw-string.stderr b/tests/ui/parser/raw/raw-string.stderr index 6654ef7a75a42..07a664ef1aad3 100644 --- a/tests/ui/parser/raw/raw-string.stderr +++ b/tests/ui/parser/raw/raw-string.stderr @@ -2,11 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-string.rs:2:13 | LL | let x = r##"lol"#; - | ^ - help: consider terminating the string here: `##` - | | - | unterminated raw string + | ^ unterminated raw string | = note: this raw string should be terminated with `"##` +help: consider terminating the string here + | +LL | let x = r##"lol"##; + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr index fda0919b9b647..7a3561c205300 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr @@ -2,25 +2,29 @@ error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let-2.rs:2:5 | LL | let x: i32, - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let x: i32, +LL + x: i32, + | error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let-2.rs:4:5 | LL | let y: i32, - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let y: i32, +LL + y: i32, + | error[E0063]: missing fields `x` and `y` in initializer of `Foo` --> $DIR/removed-syntax-field-let-2.rs:9:13 diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr index 339d056e6360f..48e439c8c2c34 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr @@ -2,13 +2,15 @@ error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let.rs:2:5 | LL | let foo: (), - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let foo: (), +LL + foo: (), + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-add-self-issue-131084.stderr b/tests/ui/suggestions/suggest-add-self-issue-131084.stderr index 1af7eec726273..5a78b4daaefd5 100644 --- a/tests/ui/suggestions/suggest-add-self-issue-131084.stderr +++ b/tests/ui/suggestions/suggest-add-self-issue-131084.stderr @@ -41,10 +41,13 @@ error: expected one of `:`, `@`, or `|`, found `s` --> $DIR/suggest-add-self-issue-131084.rs:21:32 | LL | fn type_before_name(String s) { - | -------^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL - fn type_before_name(String s) { +LL + fn type_before_name(: ) { + | error[E0424]: expected value, found module `self` --> $DIR/suggest-add-self-issue-131084.rs:11:9 diff --git a/tests/ui/traits/const-traits/ice-120503-async-const-method.stderr b/tests/ui/traits/const-traits/ice-120503-async-const-method.stderr index d2eea3a805d99..6140de3974b00 100644 --- a/tests/ui/traits/const-traits/ice-120503-async-const-method.stderr +++ b/tests/ui/traits/const-traits/ice-120503-async-const-method.stderr @@ -2,12 +2,14 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/ice-120503-async-const-method.rs:6:11 | LL | async const fn bar(&self) { - | ------^^^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` must come before `async`: `const async` + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async` + | +LL - async const fn bar(&self) { +LL + const async fn bar(&self) { + | error[E0379]: functions in trait impls cannot be declared const --> $DIR/ice-120503-async-const-method.rs:6:11 From 1b7ae04e212b9a12b43fcf8c04c32e90d52dd581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Tue, 21 Jul 2026 16:11:09 +0000 Subject: [PATCH 12/33] Tweak code and diagnostic formatting and messages --- .../rustc_parse/src/parser/diagnostics.rs | 10 +++++- compiler/rustc_parse/src/parser/expr.rs | 2 +- compiler/rustc_parse/src/parser/item.rs | 35 ++++++++++++------- .../ui/attributes/attr-bad-crate-attr.stderr | 2 +- .../parser/attribute/attr-before-eof.stderr | 2 +- .../attribute/attr-dangling-in-mod.stderr | 2 +- .../attribute/attr-with-a-semicolon.stderr | 8 ++++- .../attribute/attrs-after-extern-mod.stderr | 2 +- tests/ui/parser/doc-before-attr.stderr | 2 +- tests/ui/parser/eq-less-to-less-eq.stderr | 2 +- tests/ui/parser/issues/issue-20711-2.stderr | 2 +- tests/ui/parser/issues/issue-20711.stderr | 2 +- .../removed-syntax-field-let-2.stderr | 4 +-- .../removed-syntax-field-let.stderr | 2 +- 14 files changed, 50 insertions(+), 27 deletions(-) diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 9ee4576e3483c..3064c0b22592d 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2062,7 +2062,15 @@ impl<'a> Parser<'a> { Applicability::MachineApplicable, ); } - err.span_suggestion_verbose(lo.shrink_to_lo(), format!("{prefix}you can still access the deprecated `try!()` macro using the \"raw identifier\" syntax"), "r#", Applicability::MachineApplicable); + err.span_suggestion_verbose( + lo.shrink_to_lo(), + format!( + "{prefix}you can still access the deprecated `try!()` macro using the \ + \"raw identifier\" syntax" + ), + "r#", + Applicability::MachineApplicable, + ); let guar = err.emit(); Ok(self.mk_expr_err(lo.to(hi), guar)) } else { diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index a3dea980e67c2..e09b7b5d1c513 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1701,7 +1701,7 @@ impl<'a> Parser<'a> { let eq_lt = maybe_eq_tok.span.to(lt_span); err.span_suggestion_verbose( eq_lt, - "did you mean", + "you might have meant to write a \"less than or equal to\" comparison", "<=", Applicability::Unspecified, ); diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 6de9240c64a91..1dc8823862507 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -626,13 +626,16 @@ impl<'a> Parser<'a> { let mut err = self.dcx().struct_span_err(end.span, msg); if end.is_doc_comment() { err.span_label(end.span, "this doc comment doesn't document anything"); - } else if self.token == TokenKind::Semi { - err.span_suggestion( - self.token.span, - "consider removing this semicolon", - "", - Applicability::MaybeIncorrect, - ); + } else { + err.span_label(end.span, "expected an item after this"); + if self.token == TokenKind::Semi { + err.span_suggestion_verbose( + self.token.span, + "remove the semicolon after the attribute", + "", + Applicability::MaybeIncorrect, + ); + } } if let [.., penultimate, _] = attrs { err.span_label(start.span.to(penultimate.span), "other attributes here"); @@ -2429,16 +2432,19 @@ impl<'a> Parser<'a> { &inherited_vis, Case::Insensitive, ) { - Ok(_) => { - self.dcx().struct_span_err( + Ok(_) => self + .dcx() + .struct_span_err( lo.to(self.prev_token.span), format!("functions are not allowed in {adt_ty} definitions"), ) .with_help( "unlike in C++, Java, and C#, functions are declared in `impl` blocks", ) - .with_help("see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information") - } + .with_help( + "see https://doc.rust-lang.org/book/ch05-03-method-syntax.html \ + for more information", + ), Err(err) => { err.cancel(); self.restore_snapshot(snapshot); @@ -2476,12 +2482,15 @@ impl<'a> Parser<'a> { { err.span_suggestion_verbose( removal_span, - "remove this `let` keyword", + "remove the `let` keyword", String::new(), Applicability::MachineApplicable, ); err.note("the `let` keyword is not allowed in `struct` fields"); - err.note("see for more information"); + err.note( + "see \ + for more information", + ); err.emit(); return Ok(ident); } else { diff --git a/tests/ui/attributes/attr-bad-crate-attr.stderr b/tests/ui/attributes/attr-bad-crate-attr.stderr index 22522896bd1a9..885afa445efbd 100644 --- a/tests/ui/attributes/attr-bad-crate-attr.stderr +++ b/tests/ui/attributes/attr-bad-crate-attr.stderr @@ -2,7 +2,7 @@ error: expected item after attributes --> $DIR/attr-bad-crate-attr.rs:7:1 | LL | #[attr = "val"] // Unterminated - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ expected an item after this error: aborting due to 1 previous error diff --git a/tests/ui/parser/attribute/attr-before-eof.stderr b/tests/ui/parser/attribute/attr-before-eof.stderr index 18a9d77bf719c..849d7881b4ed3 100644 --- a/tests/ui/parser/attribute/attr-before-eof.stderr +++ b/tests/ui/parser/attribute/attr-before-eof.stderr @@ -2,7 +2,7 @@ error: expected item after attributes --> $DIR/attr-before-eof.rs:3:1 | LL | #[derive(Debug)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ expected an item after this error: aborting due to 1 previous error diff --git a/tests/ui/parser/attribute/attr-dangling-in-mod.stderr b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr index 22cc092109d1d..6ab08317a6690 100644 --- a/tests/ui/parser/attribute/attr-dangling-in-mod.stderr +++ b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr @@ -2,7 +2,7 @@ error: expected item after attributes --> $DIR/attr-dangling-in-mod.rs:4:1 | LL | #[foo = "bar"] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ expected an item after this error: aborting due to 1 previous error diff --git a/tests/ui/parser/attribute/attr-with-a-semicolon.stderr b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr index 0431d3e524fe4..3edc60a3cba5c 100644 --- a/tests/ui/parser/attribute/attr-with-a-semicolon.stderr +++ b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr @@ -2,7 +2,13 @@ error: expected item after attributes --> $DIR/attr-with-a-semicolon.rs:1:1 | LL | #[derive(Debug, Clone)]; - | ^^^^^^^^^^^^^^^^^^^^^^^- help: consider removing this semicolon + | ^^^^^^^^^^^^^^^^^^^^^^^ expected an item after this + | +help: remove the semicolon after the attribute + | +LL - #[derive(Debug, Clone)]; +LL + #[derive(Debug, Clone)] + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/attribute/attrs-after-extern-mod.stderr b/tests/ui/parser/attribute/attrs-after-extern-mod.stderr index f2bafa54f8dfe..639c575438bf7 100644 --- a/tests/ui/parser/attribute/attrs-after-extern-mod.stderr +++ b/tests/ui/parser/attribute/attrs-after-extern-mod.stderr @@ -4,7 +4,7 @@ error: expected item after attributes LL | extern "C" { | - while parsing this item list starting here LL | #[cfg(stage37)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ expected an item after this LL | } | - the item list ends here diff --git a/tests/ui/parser/doc-before-attr.stderr b/tests/ui/parser/doc-before-attr.stderr index 0298b9b60d2f3..3111df9187d69 100644 --- a/tests/ui/parser/doc-before-attr.stderr +++ b/tests/ui/parser/doc-before-attr.stderr @@ -4,7 +4,7 @@ error: expected item after attributes LL | /// hi | ------ other attributes here LL | #[derive(Debug)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ expected an item after this error: aborting due to 1 previous error diff --git a/tests/ui/parser/eq-less-to-less-eq.stderr b/tests/ui/parser/eq-less-to-less-eq.stderr index b365aa9769470..efed3e2096f30 100644 --- a/tests/ui/parser/eq-less-to-less-eq.stderr +++ b/tests/ui/parser/eq-less-to-less-eq.stderr @@ -4,7 +4,7 @@ error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` LL | if a =< b { | ^ expected one of 7 possible tokens | -help: did you mean +help: you might have meant to write a "less than or equal to" comparison | LL - if a =< b { LL + if a <= b { diff --git a/tests/ui/parser/issues/issue-20711-2.stderr b/tests/ui/parser/issues/issue-20711-2.stderr index 9fb7298955b38..738675999144f 100644 --- a/tests/ui/parser/issues/issue-20711-2.stderr +++ b/tests/ui/parser/issues/issue-20711-2.stderr @@ -5,7 +5,7 @@ LL | impl Foo { | - while parsing this item list starting here ... LL | #[stable(feature = "rust1", since = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an item after this LL | LL | } | - the item list ends here diff --git a/tests/ui/parser/issues/issue-20711.stderr b/tests/ui/parser/issues/issue-20711.stderr index 256fb0ade7212..e5911c033ac9d 100644 --- a/tests/ui/parser/issues/issue-20711.stderr +++ b/tests/ui/parser/issues/issue-20711.stderr @@ -4,7 +4,7 @@ error: expected item after attributes LL | impl Foo { | - while parsing this item list starting here LL | #[stable(feature = "rust1", since = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an item after this LL | LL | } | - the item list ends here diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr index 7a3561c205300..e9d6630bd629f 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr @@ -6,7 +6,7 @@ LL | let x: i32, | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information -help: remove this `let` keyword +help: remove the `let` keyword | LL - let x: i32, LL + x: i32, @@ -20,7 +20,7 @@ LL | let y: i32, | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information -help: remove this `let` keyword +help: remove the `let` keyword | LL - let y: i32, LL + y: i32, diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr index 48e439c8c2c34..e470031207631 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr @@ -6,7 +6,7 @@ LL | let foo: (), | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information -help: remove this `let` keyword +help: remove the `let` keyword | LL - let foo: (), LL + foo: (), From 6860c6b379315cb765b126c3efec0c79d6bc21c4 Mon Sep 17 00:00:00 2001 From: Joao Roberto Date: Wed, 22 Jul 2026 13:07:05 -0300 Subject: [PATCH 13/33] Drop redundant canonical universe assumptions --- compiler/rustc_next_trait_solver/src/canonical/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/compiler/rustc_next_trait_solver/src/canonical/mod.rs b/compiler/rustc_next_trait_solver/src/canonical/mod.rs index 0b98f312481da..b2f6ac78040b6 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/mod.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/mod.rs @@ -160,13 +160,7 @@ where let prev_universe = delegate.universe(); let universes_created_in_query = response.max_universe.index(); for _ in 0..universes_created_in_query { - let new_universe = delegate.create_next_universe(); - if delegate.cx().assumptions_on_binders() { - delegate.insert_placeholder_assumptions( - new_universe, - Some(rustc_type_ir::region_constraint::Assumptions::empty()), - ); - } + delegate.create_next_universe(); } let var_values = response.value.var_values(); From 5871216e33c5ee8ce05b579f1ecf5521a9ada8a9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 22 Jul 2026 10:00:06 -0700 Subject: [PATCH 14/33] std: Implement futex on wasip3 targets, update target spec This commit is in preparation for eventual [tier 2 status] for the `wasm32-wasip3` target. Initially this target will not have support for threads but it's expected to come ~later this year. The first step in supporting this is switching internal `#[cfg]` in the standard library to "ok this target has threads", and this commit is the update for synchronization primitives. All synchronization primitives on the `wasm32-wasip3` now use a `futex`-based implementation, and the implementation of the futex itself is located in wasi-libc (see WebAssembly/wasi-libc/834). Other WASI targets can eventually all use this implementation as well, but `wasi-libc`'s implementation of these symbols will need to percolate, so those targets aren't changed yet. For `wasm32-wasip3`, however, any supporting `wasi-libc` will have these symbols. This then additionally fixes the target to actually build with a modern LLVM by passing a necessary flag to `wasm-ld`. This flag isn't supported until LLVM 23, but the `wasm32-wasip3` target isn't fully supported until LLVM 23 anyway (hence its Tier 3 status currently). [tier 2 status]: https://github.com/rust-lang/compiler-team/issues/1001 --- .../src/spec/targets/wasm32_wasip3.rs | 16 ++++- library/std/src/os/mod.rs | 2 +- library/std/src/sys/pal/wasi/mod.rs | 21 +++++- .../std/src/sys/pal/wasi/wasilibc_futex.rs | 68 +++++++++++++++++++ library/std/src/sys/sync/condvar/mod.rs | 1 + library/std/src/sys/sync/mutex/mod.rs | 1 + library/std/src/sys/sync/once/mod.rs | 1 + library/std/src/sys/sync/rwlock/mod.rs | 3 +- .../std/src/sys/sync/thread_parking/mod.rs | 1 + 9 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 library/std/src/sys/pal/wasi/wasilibc_futex.rs diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs index 3fb1d11ef60da..9e981cd73f5a7 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip3.rs @@ -8,7 +8,7 @@ //! all component-model-level imports anyway. Over time the imports of the //! standard library will change to WASIp3. -use crate::spec::{Env, Target}; +use crate::spec::{Cc, Env, LinkerFlavor, Target, add_link_args}; pub(crate) fn target() -> Target { // As of now WASIp3 is a lightly edited wasip2 target, so start with that @@ -22,5 +22,19 @@ pub(crate) fn target() -> Target { std: Some(true), }; target.options.env = Env::P3; + + // The `--cooperative-threading` flag to the linker dictates the ABI that's + // being used on this target which is to store the stack pointer in a + // component model intrinsic location, for example, rather than a wasm + // global. + // + // Note that this is only specified for `Cc::No`, because when `clang` is + // being used as a linker it'll already pass this. + add_link_args( + &mut target.pre_link_args, + LinkerFlavor::WasmLld(Cc::No), + &["--cooperative-threading"], + ); + target } diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index a7ffd87d84d93..8068f92bcc93c 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -54,7 +54,7 @@ cfg_select! { pub mod linux; } target_family = "wasm" => { - #[cfg(any(target_env = "p1", target_env = "p2"))] + #[cfg(any(target_env = "p1", target_env = "p2", target_env = "p3"))] pub mod wasi; #[cfg(target_env = "p2")] pub mod wasip2; diff --git a/library/std/src/sys/pal/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs index 8ea26faca7e70..9069d0f0064a7 100644 --- a/library/std/src/sys/pal/wasi/mod.rs +++ b/library/std/src/sys/pal/wasi/mod.rs @@ -7,13 +7,28 @@ use crate::io; pub mod conf; -#[allow(unused)] -#[path = "../wasm/atomics/futex.rs"] -pub mod futex; pub mod stack_overflow; #[path = "../unix/time.rs"] pub mod time; +// The wasi-libc based futex is new enough that it's not present in older +// wasi-libc builds. For now that means it's only required on wasip3 (which +// requires a newer wasi-libc anyway). In the future this'll probably switch to +// unconditionally using `wasilibc_futex` as the implementation for all WASI +// targets (and switching all synchronization primitives to the futex version). +cfg_select! { + target_env = "p3" => { + pub mod wasilibc_futex; + pub use wasilibc_futex as futex; + } + target_feature = "atomics" => { + #[allow(unused)] + #[path = "../wasm/atomics/futex.rs"] + pub mod futex; + } + _ => {} +} + #[cfg(not(target_env = "p1"))] mod cabi_realloc; diff --git a/library/std/src/sys/pal/wasi/wasilibc_futex.rs b/library/std/src/sys/pal/wasi/wasilibc_futex.rs new file mode 100644 index 0000000000000..b83e75acac3ae --- /dev/null +++ b/library/std/src/sys/pal/wasi/wasilibc_futex.rs @@ -0,0 +1,68 @@ +//! A futex implementation based on the primitives provided by `wasi-libc`. +//! +//! This is currently only used on wasip3 targets, but in the future once +//! `wasi-libc`'s implementation of these symbols have percolated further it'll +//! be possible to use this on all WASI targets. The `wasi-libc` implementation +//! of these symbols differs depending on the target and configuration: +//! +//! * `wasm32-wasip{1,2}` - this will abort if blocking actually happens +//! * `wasm32-wasip1-threads` - this uses wasm `memory.atomic.*` instructions +//! * `wasm32-wasip3` - depending on libc configuration (`ENABLE_COOP_THREADS`) +//! this either aborts (coop threads disables) on blocking or does the +//! coop-thread-thing to manage threads. +//! +//! Regardless this module is effectively delegating to `wasi-libc` to determine +//! how to do thread management. + +use libc::c_int; + +use crate::ptr; +use crate::sync::atomic::Atomic; +use crate::time::Duration; + +const __WASILIBC_FUTEX_WAKE_ALL: c_int = -1; + +unsafe extern "C" { + fn __wasilibc_futex_wait( + addr: *mut c_int, + val: c_int, + clock: libc::clockid_t, + at: *const libc::timespec, + flags: libc::c_uint, + ) -> c_int; + fn __wasilibc_futex_wake(addr: *const c_int, count: c_int, flags: libc::c_uint) -> c_int; +} + +pub type Futex = Atomic; +pub type Primitive = u32; + +pub type SmallFutex = Atomic; +pub type SmallPrimitive = u32; + +pub fn futex_wait(futex: &Atomic, expected: u32, timeout: Option) -> bool { + let timespec = timeout.and_then(|t| { + Some(libc::timespec { + tv_sec: t.as_secs().try_into().ok()?, + tv_nsec: t.subsec_nanos().try_into().ok()?, + }) + }); + unsafe { + __wasilibc_futex_wait( + futex.as_ptr().cast(), + expected.cast_signed(), + libc::CLOCK_REALTIME, + timespec.as_ref().map(ptr::from_ref).unwrap_or(ptr::null()), + 0, + ) == 0 + } +} + +pub fn futex_wake(futex: &Atomic) -> bool { + unsafe { __wasilibc_futex_wake(futex.as_ptr().cast(), 1, 0) == 1 } +} + +pub fn futex_wake_all(futex: &Atomic) { + unsafe { + __wasilibc_futex_wake(futex.as_ptr().cast(), __WASILIBC_FUTEX_WAKE_ALL, 0); + } +} diff --git a/library/std/src/sys/sync/condvar/mod.rs b/library/std/src/sys/sync/condvar/mod.rs index 83cf0ae629851..0e8a4ed9ece86 100644 --- a/library/std/src/sys/sync/condvar/mod.rs +++ b/library/std/src/sys/sync/condvar/mod.rs @@ -10,6 +10,7 @@ cfg_select! { target_os = "fuchsia", all(target_family = "wasm", target_feature = "atomics"), target_os = "hermit", + all(target_os = "wasi", target_env = "p3"), ) => { mod futex; pub use futex::Condvar; diff --git a/library/std/src/sys/sync/mutex/mod.rs b/library/std/src/sys/sync/mutex/mod.rs index e3d6ad1129c83..9ec251b7e4049 100644 --- a/library/std/src/sys/sync/mutex/mod.rs +++ b/library/std/src/sys/sync/mutex/mod.rs @@ -9,6 +9,7 @@ cfg_select! { target_os = "dragonfly", all(target_family = "wasm", target_feature = "atomics"), target_os = "hermit", + all(target_os = "wasi", target_env = "p3"), ) => { mod futex; pub use futex::Mutex; diff --git a/library/std/src/sys/sync/once/mod.rs b/library/std/src/sys/sync/once/mod.rs index 5796c6d207dba..3bdb6c9f85ebb 100644 --- a/library/std/src/sys/sync/once/mod.rs +++ b/library/std/src/sys/sync/once/mod.rs @@ -19,6 +19,7 @@ cfg_select! { target_os = "dragonfly", target_os = "fuchsia", target_os = "hermit", + all(target_os = "wasi", target_env = "p3"), ) => { mod futex; pub use futex::{Once, OnceState}; diff --git a/library/std/src/sys/sync/rwlock/mod.rs b/library/std/src/sys/sync/rwlock/mod.rs index 8603fca2da5b5..9991f290e46d1 100644 --- a/library/std/src/sys/sync/rwlock/mod.rs +++ b/library/std/src/sys/sync/rwlock/mod.rs @@ -9,7 +9,8 @@ cfg_select! { target_os = "fuchsia", all(target_family = "wasm", target_feature = "atomics"), target_os = "hermit", - target_os = "motor", + target_os = "motor", + all(target_os = "wasi", target_env = "p3"), ) => { mod futex; pub use futex::RwLock; diff --git a/library/std/src/sys/sync/thread_parking/mod.rs b/library/std/src/sys/sync/thread_parking/mod.rs index 9d5a0a996b115..fe4c830ce38bb 100644 --- a/library/std/src/sys/sync/thread_parking/mod.rs +++ b/library/std/src/sys/sync/thread_parking/mod.rs @@ -10,6 +10,7 @@ cfg_select! { target_os = "fuchsia", target_os = "motor", target_os = "hermit", + all(target_os = "wasi", target_env = "p3"), ) => { mod futex; pub use futex::Parker; From 0eb2348e8b6f80ad9867b9d3947234e609263027 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 22 Jul 2026 16:57:08 +0200 Subject: [PATCH 15/33] Keep cfg predicate in `CfgAttrTrace` so it can be used by rustdoc --- compiler/rustc_ast/src/ast.rs | 2 +- compiler/rustc_ast/src/attr/mod.rs | 4 ++-- compiler/rustc_ast_passes/src/ast_validation.rs | 2 +- compiler/rustc_ast_pretty/src/pprust/state.rs | 2 +- compiler/rustc_attr_parsing/src/synthetic.rs | 14 +++++++------- compiler/rustc_attr_parsing/src/validate_attr.rs | 2 +- compiler/rustc_expand/src/config.rs | 16 ++++++++++------ compiler/rustc_expand/src/expand.rs | 2 +- compiler/rustc_hir/src/attrs/data_structures.rs | 2 +- .../rustc_hir/src/attrs/encode_cross_crate.rs | 2 +- compiler/rustc_passes/src/check_attr.rs | 2 +- compiler/rustc_resolve/src/def_collector.rs | 2 +- 12 files changed, 28 insertions(+), 24 deletions(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index cdff6501ec1c4..4dc836f19fdd8 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -3514,7 +3514,7 @@ pub enum SyntheticAttr { /// because they are not needed. /// /// The attribute is used by some clippy lints. - CfgAttrTrace, + CfgAttrTrace(CfgEntry), } impl AttrItem { diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 39c4f403bf855..40a1b4bd32218 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -106,7 +106,7 @@ impl AttributeExt for Attribute { use SyntheticAttr::*; match &self.kind { AttrKind::Normal(normal) => normal.item.name(), - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => None, + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => None, AttrKind::DocComment(..) => None, } } @@ -117,7 +117,7 @@ impl AttributeExt for Attribute { AttrKind::Normal(normal) => { Some(normal.item.path.segments.iter().map(|i| i.ident.name).collect()) } - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => None, + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => None, AttrKind::DocComment(_, _) => None, } } diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index fe1da820cf74f..1ebddc1c57d3d 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -525,7 +525,7 @@ impl<'a> AstValidator<'a> { [sym::allow, sym::deny, sym::expect, sym::forbid, sym::splat, sym::warn]; !attr.has_any_name(&arr) && rustc_attr_parsing::is_builtin_attr(&normal.item) } - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => false, + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => false, AttrKind::DocComment(..) => true, }) .for_each(|attr| { diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 42d01a92eebbf..3b0c90264e32d 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -665,7 +665,7 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere fn print_attribute_inline(&mut self, attr: &ast::Attribute, is_inline: bool) -> bool { use ast::SyntheticAttr::*; match attr.kind { - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => { + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => { // These are internal synthetic attributes with no syntax, so avoid printing them // to keep the printed code reasonably parse-able. return false; diff --git a/compiler/rustc_attr_parsing/src/synthetic.rs b/compiler/rustc_attr_parsing/src/synthetic.rs index 5e633e6ee3685..290730aaee132 100644 --- a/compiler/rustc_attr_parsing/src/synthetic.rs +++ b/compiler/rustc_attr_parsing/src/synthetic.rs @@ -15,9 +15,7 @@ pub(crate) struct SyntheticAttrState { cfg_trace: ThinVec<(CfgEntry, Span)>, /// Attribute state for `SyntheticAttr::CfgAttrTrace` attributes. - /// The arguments of these attributes is no longer relevant for any later passes, only their - /// presence. So we discard the arguments here. - cfg_attr_trace: bool, + cfg_attr_trace: ThinVec<(CfgEntry, Span)>, } impl SyntheticAttrState { @@ -33,8 +31,10 @@ impl SyntheticAttrState { cfg.lower_spans(lower_span); self.cfg_trace.push((cfg, attr_span)); } - SyntheticAttr::CfgAttrTrace => { - self.cfg_attr_trace = true; + SyntheticAttr::CfgAttrTrace(cfg) => { + let mut cfg = cfg.clone(); + cfg.lower_spans(lower_span); + self.cfg_attr_trace.push((cfg, attr_span)); } } } @@ -43,8 +43,8 @@ impl SyntheticAttrState { if !self.cfg_trace.is_empty() { attributes.push(Attribute::Parsed(AttributeKind::CfgTrace(self.cfg_trace))); } - if self.cfg_attr_trace { - attributes.push(Attribute::Parsed(AttributeKind::CfgAttrTrace)); + if !self.cfg_attr_trace.is_empty() { + attributes.push(Attribute::Parsed(AttributeKind::CfgAttrTrace(self.cfg_attr_trace))); } } } diff --git a/compiler/rustc_attr_parsing/src/validate_attr.rs b/compiler/rustc_attr_parsing/src/validate_attr.rs index 90380c08fdba1..08c73352f27eb 100644 --- a/compiler/rustc_attr_parsing/src/validate_attr.rs +++ b/compiler/rustc_attr_parsing/src/validate_attr.rs @@ -24,7 +24,7 @@ pub fn check_attr(psess: &ParseSess, attr: &Attribute) { use ast::SyntheticAttr::*; match &attr.kind { AttrKind::Normal(_) => {} - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) | AttrKind::DocComment(..) => return, + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) | AttrKind::DocComment(..) => return, } let builtin_attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name)); diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 030fa96a9fa68..663c12f8c9ccf 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -248,17 +248,13 @@ impl<'a> StripUnconfigured<'a> { /// is in the original source file. Gives a compiler error if the syntax of /// the attribute is incorrect. pub(crate) fn expand_cfg_attr(&self, cfg_attr: &Attribute, recursive: bool) -> Vec { - // A synthetic trace attribute left in AST in place of the original `cfg_attr` attribute. - // It can later be used by lints or other diagnostics. - let trace_attr = cfg_attr.clone().convert_normal_to_synthetic(SyntheticAttr::CfgAttrTrace); - let Some((cfg_predicate, expanded_attrs)) = rustc_attr_parsing::parse_cfg_attr( cfg_attr, self.sess, self.features, self.lint_node_id, ) else { - return vec![trace_attr]; + return vec![]; }; // Lint on zero attributes in source. @@ -271,7 +267,15 @@ impl<'a> StripUnconfigured<'a> { ); } - if !attr::eval_config_entry(self.sess, &cfg_predicate).as_bool() { + let cfg_eval = attr::eval_config_entry(self.sess, &cfg_predicate).as_bool(); + + // A synthetic trace attribute left in AST in place of the original `cfg_attr` attribute. + // It can later be used by lints or other diagnostics. + let trace_attr = cfg_attr + .clone() + .convert_normal_to_synthetic(SyntheticAttr::CfgAttrTrace(cfg_predicate)); + + if !cfg_eval { return vec![trace_attr]; } diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index 8b897aa3c5f96..dacd7c47e91e7 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -2276,7 +2276,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { ); } AttrKind::Normal(_) => {} - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => {} + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => {} AttrKind::DocComment(..) => unreachable!(), // handled above } } diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index bbec92786f047..db492475a3aa4 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -1011,7 +1011,7 @@ pub enum AttributeKind { AutomaticallyDerived, /// Represents the trace attribute of `#[cfg_attr]` - CfgAttrTrace, + CfgAttrTrace(ThinVec<(CfgEntry, Span)>), /// Represents the trace attribute of `#[cfg]` CfgTrace(ThinVec<(CfgEntry, Span)>), diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index f703aebdbc6f1..1e634513fdce2 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -21,7 +21,7 @@ impl AttributeKind { AllowInternalUnsafe(..) => Yes, AllowInternalUnstable(..) => Yes, AutomaticallyDerived => Yes, - CfgAttrTrace => Yes, + CfgAttrTrace(..) => Yes, CfgTrace(..) => Yes, CfiEncoding { .. } => Yes, Cold => No, diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 032cbcbc1e794..f46c983c7c2d8 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -237,7 +237,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { // All of the following attributes have no specific checks. // tidy-alphabetical-start AttributeKind::AutomaticallyDerived => (), - AttributeKind::CfgAttrTrace => (), + AttributeKind::CfgAttrTrace(..) => (), AttributeKind::CfgTrace(..) => (), AttributeKind::CfiEncoding { .. } => (), AttributeKind::Cold => (), diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 1ef2414b0af49..0b54b265fcee7 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -565,7 +565,7 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> { .push((normal.item.path.segments[0].ident, self.parent_scope)); } } - AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace) => {} + AttrKind::Synthetic(CfgTrace(_) | CfgAttrTrace(_)) => {} AttrKind::DocComment(..) => {} } visit::walk_attribute(self, attr); From 9d0c58d90fded44187c28f5fee67740a313a3b32 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 22 Jul 2026 16:57:44 +0200 Subject: [PATCH 16/33] Retrieve `cfg_attr` information for derived impls for rustdoc `doc_cfg` feature --- src/librustdoc/passes/propagate_doc_cfg.rs | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/passes/propagate_doc_cfg.rs b/src/librustdoc/passes/propagate_doc_cfg.rs index 213b8060a8512..bd94a56ee247f 100644 --- a/src/librustdoc/passes/propagate_doc_cfg.rs +++ b/src/librustdoc/passes/propagate_doc_cfg.rs @@ -1,8 +1,8 @@ //! Propagates [`#[doc(cfg(...))]`](https://github.com/rust-lang/rust/issues/43781) to child items. use rustc_data_structures::fx::FxHashMap; -use rustc_hir::Attribute; use rustc_hir::attrs::{AttributeKind, DocAttribute}; +use rustc_hir::{Attribute, find_attr}; use crate::clean::inline::{load_attrs, merge_attrs}; use crate::clean::{CfgInfo, Crate, Item, ItemId, ItemKind}; @@ -133,8 +133,39 @@ impl DocFolder for CfgPropagator<'_, '_> { { self.cfg_info = cfg_info; } - if let ItemKind::PlaceholderImplItem = item.kind { + if let Some(impl_def_id) = item.item_id.as_def_id() { + let tcx = self.cx.tcx; + let attrs = load_attrs(tcx, impl_def_id); + // This impl block comes from a `derive` expansion, so we want to retrieve the + // `cfg_attr` if any. + if find_attr!(attrs, AutomaticallyDerived) + && let Some(self_ty_def_id) = tcx + .type_of(impl_def_id) + .instantiate_identity() + .skip_norm_wip() + .ty_adt_def() + .map(|adt| adt.did()) + && let self_ty_attrs = load_attrs(tcx, self_ty_def_id) + && let Some(cfgs_attr_trace) = + find_attr!(self_ty_attrs, CfgAttrTrace(cfgs) => cfgs) + { + // We retrieve the `cfg_attr` of the `derive` this `impl` comes from. + let derive_span = tcx.expn_that_defined(impl_def_id).expn_data().call_site; + let attrs_iter = Attribute::Parsed(AttributeKind::CfgTrace( + cfgs_attr_trace + .iter() + .filter(|(_, span)| span.contains(derive_span)) + .cloned() + .collect(), + )); + crate::clean::extract_cfg_from_attrs( + std::iter::once(&attrs_iter), + tcx, + &mut self.cfg_info, + ); + } + } // If we have a placeholder impl, we store the current `cfg` "context" to be used // on the actual impl later on (the impls are generated after we go through the whole // AST so they're stored in the `krate` object at the end). From 35c57b5638a9d8e9107d0c33bdb60da8a983607a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 22 Jul 2026 16:58:14 +0200 Subject: [PATCH 17/33] Add regression test for `doc_cfg` feature on derive impl blocks --- tests/rustdoc-html/doc-cfg/cfg-attr.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/rustdoc-html/doc-cfg/cfg-attr.rs diff --git a/tests/rustdoc-html/doc-cfg/cfg-attr.rs b/tests/rustdoc-html/doc-cfg/cfg-attr.rs new file mode 100644 index 0000000000000..96338d3c40c0e --- /dev/null +++ b/tests/rustdoc-html/doc-cfg/cfg-attr.rs @@ -0,0 +1,14 @@ +// This test ensures that the `cfg_attr` cfg predicates are correctly kept to be used +// by the `doc_cfg` feature. + +#![crate_name = "foo"] +#![feature(doc_cfg)] + +//@ has 'foo/struct.Test.html' +//@ has - '//*[@id="impl-Debug-for-Test"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on non-crate feature debug only.' +//@ has - '//*[@id="impl-Clone-for-Test"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on non-crate feature aa and non-crate feature bb only.' +#[cfg_attr(not(feature = "debug"), derive(Debug))] +#[cfg_attr(not(feature = "aa"), cfg_attr(not(feature = "bb"), derive(Clone)))] +pub struct Test; From ed30e03798dfee327c5ee87eb31f7aa5ab973ada Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 22 Jul 2026 17:04:18 +0200 Subject: [PATCH 18/33] Update `AttributeKind::CfgAttrTrace` variant usage in `clippy` --- .../clippy/clippy_lints/src/attrs/mixed_attributes_style.rs | 2 +- src/tools/clippy/clippy_lints/src/incompatible_msrv.rs | 2 +- src/tools/clippy/clippy_utils/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/clippy/clippy_lints/src/attrs/mixed_attributes_style.rs b/src/tools/clippy/clippy_lints/src/attrs/mixed_attributes_style.rs index 3e82ff4a69545..851d605c36be5 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/mixed_attributes_style.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/mixed_attributes_style.rs @@ -32,7 +32,7 @@ impl From<&AttrKind> for SimpleAttrKind { AttrKind::Synthetic(synthetic) => { match &**synthetic { SyntheticAttr::CfgTrace(_) => Self::CfgTrace, - SyntheticAttr::CfgAttrTrace => Self::CfgAttrTrace, + SyntheticAttr::CfgAttrTrace(_) => Self::CfgAttrTrace, } } AttrKind::DocComment(..) => Self::Doc, diff --git a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs index 99e7d202fe46f..cefb48046be47 100644 --- a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs +++ b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs @@ -270,5 +270,5 @@ impl<'tcx> LateLintPass<'tcx> for IncompatibleMsrv { fn is_under_cfg_attribute(cx: &LateContext<'_>, hir_id: HirId) -> bool { cx.tcx .hir_parent_id_iter(hir_id) - .any(|id| find_attr!(cx.tcx, id, CfgTrace(..) | CfgAttrTrace)) + .any(|id| find_attr!(cx.tcx, id, CfgTrace(..) | CfgAttrTrace(..))) } diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index 426102e149d3f..82752b3d73766 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -2344,7 +2344,7 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind && let Res::Def(_, def_id) = path.res { - return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace); + return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace(..)); } false } From b1342c92174f6c10795365e8b16633cfe7df59c5 Mon Sep 17 00:00:00 2001 From: Lars Schumann Date: Wed, 22 Jul 2026 22:14:58 +0000 Subject: [PATCH 19/33] constify vec![1, 2, 3] macro arm functions --- library/alloc/src/boxed.rs | 15 +- library/alloc/src/slice.rs | 3 +- library/alloctests/tests/lib.rs | 1 + library/alloctests/tests/vec.rs | 23 +++ .../min_const_fn/bad_const_fn_body_ice.rs | 7 - .../min_const_fn/bad_const_fn_body_ice.stderr | 21 --- tests/ui/statics/check-values-constraints.rs | 23 ++- .../statics/check-values-constraints.stderr | 148 ++---------------- 8 files changed, 57 insertions(+), 184 deletions(-) delete mode 100644 tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs delete mode 100644 tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 4ee41bc807243..58996703023ce 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -246,7 +246,8 @@ pub struct Box< #[rustc_no_mir_inline] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg(not(no_global_oom_handling))] -fn box_new_uninit(layout: Layout) -> *mut u8 { +#[rustc_const_unstable(feature = "const_heap", issue = "79597")] +const fn box_new_uninit(layout: Layout) -> *mut u8 { match Global.allocate(layout) { Ok(ptr) => ptr.as_mut_ptr(), Err(_) => handle_alloc_error(layout), @@ -258,10 +259,11 @@ fn box_new_uninit(layout: Layout) -> *mut u8 { /// This is unsafe, but has to be marked as safe or else we couldn't use it in `vec!`. #[doc(hidden)] #[unstable(feature = "liballoc_internals", issue = "none")] +#[rustc_const_unstable(feature = "const_heap", issue = "79597")] #[inline(always)] #[cfg(not(no_global_oom_handling))] #[rustc_diagnostic_item = "box_assume_init_into_vec_unsafe"] -pub fn box_assume_init_into_vec_unsafe( +pub const fn box_assume_init_into_vec_unsafe( b: Box>, ) -> crate::vec::Vec { unsafe { (b.assume_init() as Box<[T]>).into_vec() } @@ -307,10 +309,11 @@ impl Box { /// ``` #[cfg(not(no_global_oom_handling))] #[stable(feature = "new_uninit", since = "1.82.0")] + #[rustc_const_unstable(feature = "const_heap", issue = "79597")] #[must_use] #[inline(always)] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces - pub fn new_uninit() -> Box> { + pub const fn new_uninit() -> Box> { // This is the same as `Self::new_uninit_in(Global)`, but manually inlined (just like // `Box::new`). @@ -1197,8 +1200,9 @@ impl Box, A> { /// assert_eq!(*five, 5) /// ``` #[stable(feature = "new_uninit", since = "1.82.0")] + #[rustc_const_unstable(feature = "const_heap", issue = "79597")] #[inline(always)] - pub unsafe fn assume_init(self) -> Box { + pub const unsafe fn assume_init(self) -> Box { // This is used in the `vec!` macro, so we optimize for minimal IR generation // even in debug builds. // SAFETY: `Box` and `Box>` have the same layout. @@ -1668,8 +1672,9 @@ impl Box { /// [memory layout]: self#memory-layout #[must_use = "losing the pointer will leak memory"] #[unstable(feature = "allocator_api", issue = "32838")] + #[rustc_const_unstable(feature = "const_heap", issue = "79597")] #[inline] - pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + pub const fn into_raw_with_allocator(b: Self) -> (*mut T, A) { let mut b = mem::ManuallyDrop::new(b); // We carefully get the raw pointer out in a way that Miri's aliasing model understands what // is happening: using the primitive "deref" of `Box`. In case `A` is *not* `Global`, we diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 39e72e383eacb..da9b40c2c3ce0 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -476,8 +476,9 @@ impl [T] { /// ``` #[rustc_allow_incoherent_impl] #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_unstable(feature = "const_heap", issue = "79597")] #[inline] - pub fn into_vec(self: Box) -> Vec { + pub const fn into_vec(self: Box) -> Vec { unsafe { let len = self.len(); let (b, alloc) = Box::into_raw_with_allocator(self); diff --git a/library/alloctests/tests/lib.rs b/library/alloctests/tests/lib.rs index 96dcde71fc071..296d0708a5f0e 100644 --- a/library/alloctests/tests/lib.rs +++ b/library/alloctests/tests/lib.rs @@ -8,6 +8,7 @@ #![feature(binary_heap_pop_if)] #![feature(casefold)] #![feature(const_btree_len)] +#![feature(const_cmp)] #![feature(const_heap)] #![feature(const_trait_impl)] #![feature(core_intrinsics)] diff --git a/library/alloctests/tests/vec.rs b/library/alloctests/tests/vec.rs index fc58e4364fe66..4620a9f373d6c 100644 --- a/library/alloctests/tests/vec.rs +++ b/library/alloctests/tests/vec.rs @@ -2807,3 +2807,26 @@ fn const_make_global_empty_or_zst_regression() { assert_eq!(ZST_SLICE, &[(), (), ()]); } + +#[test] +fn const_heap_vec_macro() { + const X: &'static [u32] = { + let x: Vec = vec![]; + assert!(x == []); + x.const_make_global() + }; + + const Y: &'static [u32] = { + let y: Vec = vec![1, 2, 3]; + assert!(y == [1, 2, 3]); + y.const_make_global() + }; + + // This arm isn't const yet. + // const Z: &'static [u32] = { + // vec![4; 2].const_make_global() + // }; + + assert_eq!(X, []); + assert_eq!(Y, [1, 2, 3]); +} diff --git a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs deleted file mode 100644 index 74e0a36560b08..0000000000000 --- a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs +++ /dev/null @@ -1,7 +0,0 @@ -const fn foo(a: i32) -> Vec { - vec![1, 2, 3] - //~^ ERROR cannot call non-const - //~| ERROR cannot call non-const -} - -fn main() {} diff --git a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr b/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr deleted file mode 100644 index a7e8fdf37ae29..0000000000000 --- a/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new_uninit` in constant functions - --> $DIR/bad_const_fn_body_ice.rs:2:5 - | -LL | vec![1, 2, 3] - | ^^^^^^^^^^^^^ - | - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in constant functions - --> $DIR/bad_const_fn_body_ice.rs:2:5 - | -LL | vec![1, 2, 3] - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/statics/check-values-constraints.rs b/tests/ui/statics/check-values-constraints.rs index c62abd75a304b..6f1635b761b07 100644 --- a/tests/ui/statics/check-values-constraints.rs +++ b/tests/ui/statics/check-values-constraints.rs @@ -1,5 +1,6 @@ // Verifies all possible restrictions for statics values. +#![feature(const_heap)] #![allow(warnings)] use std::marker; @@ -79,8 +80,6 @@ static STATIC10: UnsafeStruct = UnsafeStruct; struct MyOwned; static STATIC11: Vec = vec![MyOwned]; -//~^ ERROR cannot call non-const function -//~| ERROR cannot call non-const static mut STATIC12: UnsafeStruct = UnsafeStruct; @@ -93,29 +92,25 @@ static mut STATIC14: SafeStruct = SafeStruct { }; static STATIC15: &'static [Vec] = &[ - vec![MyOwned], //~ ERROR cannot call non-const function - //~| ERROR cannot call non-const - vec![MyOwned], //~ ERROR cannot call non-const function - //~| ERROR cannot call non-const + vec![MyOwned], + vec![MyOwned], ]; static STATIC16: (&'static Vec, &'static Vec) = ( - &vec![MyOwned], //~ ERROR cannot call non-const function - //~| ERROR cannot call non-const - &vec![MyOwned], //~ ERROR cannot call non-const function - //~| ERROR cannot call non-const + &vec![MyOwned], + &vec![MyOwned], ); static mut STATIC17: SafeEnum = SafeEnum::Variant1; static STATIC19: Vec = vec![3]; -//~^ ERROR cannot call non-const function -//~| ERROR cannot call non-const +//~^ ERROR encountered `const_allocate` pointer in final value that was not made global + pub fn main() { let y = { - static x: Vec = vec![3]; //~ ERROR cannot call non-const function - //~| ERROR cannot call non-const + static x: Vec = vec![3]; + //~^ ERROR encountered `const_allocate` pointer in final value that was not made global x //~^ ERROR cannot move out of static }; diff --git a/tests/ui/statics/check-values-constraints.stderr b/tests/ui/statics/check-values-constraints.stderr index 94d2b8ce80641..a3d49400703be 100644 --- a/tests/ui/statics/check-values-constraints.stderr +++ b/tests/ui/statics/check-values-constraints.stderr @@ -1,5 +1,5 @@ error[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time - --> $DIR/check-values-constraints.rs:64:7 + --> $DIR/check-values-constraints.rs:65:7 | LL | ..SafeStruct { | _______^ @@ -11,28 +11,8 @@ LL | | } LL | }; | - value is dropped here -error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:81:33 - | -LL | static STATIC11: Vec = vec![MyOwned]; - | ^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:81:33 - | -LL | static STATIC11: Vec = vec![MyOwned]; - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - error[E0015]: cannot call non-const method `::to_string` in statics - --> $DIR/check-values-constraints.rs:92:38 + --> $DIR/check-values-constraints.rs:91:38 | LL | field2: SafeEnum::Variant4("str".to_string()), | ^^^^^^^^^^^ @@ -47,128 +27,24 @@ note: method `to_string` is not const because trait `ToString` is not const = note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` -error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:96:5 - | -LL | vec![MyOwned], - | ^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:96:5 - | -LL | vec![MyOwned], - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:98:5 - | -LL | vec![MyOwned], - | ^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:98:5 - | -LL | vec![MyOwned], - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:103:6 - | -LL | &vec![MyOwned], - | ^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:103:6 - | -LL | &vec![MyOwned], - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:105:6 - | -LL | &vec![MyOwned], - | ^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:105:6 - | -LL | &vec![MyOwned], - | ^^^^^^^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:111:31 +error: encountered `const_allocate` pointer in final value that was not made global + --> $DIR/check-values-constraints.rs:106:1 | LL | static STATIC19: Vec = vec![3]; - | ^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:111:31 - | -LL | static STATIC19: Vec = vec![3]; - | ^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` + = note: use `const_make_global` to turn allocated pointers into immutable globals before returning -error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new_uninit` in statics - --> $DIR/check-values-constraints.rs:117:32 +error: encountered `const_allocate` pointer in final value that was not made global + --> $DIR/check-values-constraints.rs:112:9 | LL | static x: Vec = vec![3]; - | ^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` - -error[E0015]: cannot call non-const function `std::boxed::box_assume_init_into_vec_unsafe::` in statics - --> $DIR/check-values-constraints.rs:117:32 - | -LL | static x: Vec = vec![3]; - | ^^^^^^^ - | -note: function `box_assume_init_into_vec_unsafe` is not const - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)` + = note: use `const_make_global` to turn allocated pointers into immutable globals before returning error[E0507]: cannot move out of static item `x` - --> $DIR/check-values-constraints.rs:119:9 + --> $DIR/check-values-constraints.rs:114:9 | LL | x | ^ move occurs because `x` has type `Vec`, which does not implement the `Copy` trait @@ -182,7 +58,7 @@ help: consider cloning the value if the performance cost is acceptable LL | x.clone() | ++++++++ -error: aborting due to 17 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0015, E0493, E0507. For more information about an error, try `rustc --explain E0015`. From 7f88868ce40a116d9fc2c00d868e81e92d6bd781 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 23 Jul 2026 00:20:33 +0200 Subject: [PATCH 20/33] Extend `cfg_attr` retrieval for all impls, including ones without the `automatically_derived` attribute --- src/librustdoc/passes/propagate_doc_cfg.rs | 19 +++++++-------- .../doc-cfg/auxiliary/cfg-attr-proc-macro.rs | 24 +++++++++++++++++++ .../doc-cfg/cfg-attr-proc-macro.rs | 14 +++++++++++ 3 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 tests/rustdoc-html/doc-cfg/auxiliary/cfg-attr-proc-macro.rs create mode 100644 tests/rustdoc-html/doc-cfg/cfg-attr-proc-macro.rs diff --git a/src/librustdoc/passes/propagate_doc_cfg.rs b/src/librustdoc/passes/propagate_doc_cfg.rs index bd94a56ee247f..ac1aae7fffe1d 100644 --- a/src/librustdoc/passes/propagate_doc_cfg.rs +++ b/src/librustdoc/passes/propagate_doc_cfg.rs @@ -136,19 +136,18 @@ impl DocFolder for CfgPropagator<'_, '_> { if let ItemKind::PlaceholderImplItem = item.kind { if let Some(impl_def_id) = item.item_id.as_def_id() { let tcx = self.cx.tcx; - let attrs = load_attrs(tcx, impl_def_id); - // This impl block comes from a `derive` expansion, so we want to retrieve the - // `cfg_attr` if any. - if find_attr!(attrs, AutomaticallyDerived) - && let Some(self_ty_def_id) = tcx - .type_of(impl_def_id) - .instantiate_identity() - .skip_norm_wip() - .ty_adt_def() - .map(|adt| adt.did()) + // This impl block likely comes from a `derive` expansion, so we want to retrieve + // the `cfg_attr` if any. + if let Some(self_ty_def_id) = tcx + .type_of(impl_def_id) + .instantiate_identity() + .skip_norm_wip() + .ty_adt_def() + .map(|adt| adt.did()) && let self_ty_attrs = load_attrs(tcx, self_ty_def_id) && let Some(cfgs_attr_trace) = find_attr!(self_ty_attrs, CfgAttrTrace(cfgs) => cfgs) + && !cfgs_attr_trace.is_empty() { // We retrieve the `cfg_attr` of the `derive` this `impl` comes from. let derive_span = tcx.expn_that_defined(impl_def_id).expn_data().call_site; diff --git a/tests/rustdoc-html/doc-cfg/auxiliary/cfg-attr-proc-macro.rs b/tests/rustdoc-html/doc-cfg/auxiliary/cfg-attr-proc-macro.rs new file mode 100644 index 0000000000000..21db277833e05 --- /dev/null +++ b/tests/rustdoc-html/doc-cfg/auxiliary/cfg-attr-proc-macro.rs @@ -0,0 +1,24 @@ +//@ no-prefer-dynamic +//@ edition: 2024 + +#![crate_type = "proc-macro"] + +extern crate proc_macro; + +use proc_macro::{TokenStream, TokenTree}; + +#[proc_macro_derive(Yop)] +pub fn derive_yop(input: TokenStream) -> TokenStream { + let mut iter = input.into_iter(); + + while let Some(token) = iter.next() { + if let TokenTree::Ident(ident) = token && + matches!(ident.to_string().as_str(), "struct" | "enum" | "union") + { + // Next token is the name. That's all we need! + let Some(TokenTree::Ident(ident)) = iter.next() else { panic!() }; + return format!("impl Trait for {ident} {{}}").parse().unwrap(); + } + } + panic!() +} diff --git a/tests/rustdoc-html/doc-cfg/cfg-attr-proc-macro.rs b/tests/rustdoc-html/doc-cfg/cfg-attr-proc-macro.rs new file mode 100644 index 0000000000000..d4f44a333bd25 --- /dev/null +++ b/tests/rustdoc-html/doc-cfg/cfg-attr-proc-macro.rs @@ -0,0 +1,14 @@ +//@ aux-build: cfg-attr-proc-macro.rs + +#![crate_name = "foo"] +#![feature(doc_cfg)] + +extern crate cfg_attr_proc_macro; + +pub trait Trait {} + +//@ has 'foo/struct.B.html' +//@ has - '//*[@id="impl-Trait-for-B"]/*[@class="item-info"]/*[@class="stab portability"]' \ +// 'Available on non-crate feature boop only.' +#[cfg_attr(not(feature = "boop"), derive(cfg_attr_proc_macro::Yop))] +pub struct B; From f9d9939467a5185a72f0ee8da778a0b71fc966ae Mon Sep 17 00:00:00 2001 From: jprochazk Date: Wed, 22 Jul 2026 15:18:28 +0200 Subject: [PATCH 21/33] make `DocLinkResMap` an `FxIndexMap` also add regression test for rmeta reproducibility when unrelated `rlib` are in the search path Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com> --- compiler/rustc_hir/src/def.rs | 6 ++-- .../client.rs | 5 ++++ .../rmeta-unrelated-search-path-files/foo.rs | 1 + .../foo_bar.rs | 1 + .../rmake.rs | 30 +++++++++++++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 tests/run-make/rmeta-unrelated-search-path-files/client.rs create mode 100644 tests/run-make/rmeta-unrelated-search-path-files/foo.rs create mode 100644 tests/run-make/rmeta-unrelated-search-path-files/foo_bar.rs create mode 100644 tests/run-make/rmeta-unrelated-search-path-files/rmake.rs diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 9d1cf7046f4b0..1481cb0726082 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -4,7 +4,7 @@ use std::fmt::Debug; use rustc_ast as ast; use rustc_ast::NodeId; -use rustc_data_structures::unord::UnordMap; +use rustc_data_structures::fx::FxIndexMap; use rustc_error_messages::{DiagArgValue, IntoDiagArg}; use rustc_macros::{Decodable, Encodable, StableHash}; use rustc_span::Symbol; @@ -962,4 +962,6 @@ pub enum LifetimeRes { ElidedAnchor { start: NodeId, end: NodeId }, } -pub type DocLinkResMap = UnordMap<(Symbol, Namespace), Option>>; +// FxIndexMap is necessary because its data ends up in .rmeta files, +// so its iteration order must be consistent. See #159677 for context. +pub type DocLinkResMap = FxIndexMap<(Symbol, Namespace), Option>>; diff --git a/tests/run-make/rmeta-unrelated-search-path-files/client.rs b/tests/run-make/rmeta-unrelated-search-path-files/client.rs new file mode 100644 index 0000000000000..a0fb04732fef1 --- /dev/null +++ b/tests/run-make/rmeta-unrelated-search-path-files/client.rs @@ -0,0 +1,5 @@ +//! [crate::Client] + +extern crate foo; + +pub struct Client; diff --git a/tests/run-make/rmeta-unrelated-search-path-files/foo.rs b/tests/run-make/rmeta-unrelated-search-path-files/foo.rs new file mode 100644 index 0000000000000..4a835673a596b --- /dev/null +++ b/tests/run-make/rmeta-unrelated-search-path-files/foo.rs @@ -0,0 +1 @@ +pub struct Foo; diff --git a/tests/run-make/rmeta-unrelated-search-path-files/foo_bar.rs b/tests/run-make/rmeta-unrelated-search-path-files/foo_bar.rs new file mode 100644 index 0000000000000..1c6a3b4c6cce8 --- /dev/null +++ b/tests/run-make/rmeta-unrelated-search-path-files/foo_bar.rs @@ -0,0 +1 @@ +pub struct FooBar; diff --git a/tests/run-make/rmeta-unrelated-search-path-files/rmake.rs b/tests/run-make/rmeta-unrelated-search-path-files/rmake.rs new file mode 100644 index 0000000000000..3bd402c5c6b79 --- /dev/null +++ b/tests/run-make/rmeta-unrelated-search-path-files/rmake.rs @@ -0,0 +1,30 @@ +//@ needs-target-std +// +// Regression test for . +// +// Ensures two builds of `client.rs` produce identical metadata +// even if there is an unrelated crate on the search path. + +use run_make_support::{rfs, rustc}; + +fn main() { + rustc().input("foo.rs").crate_type("rlib").run(); + rustc() + .input("client.rs") + .crate_type("rlib") + .emit("metadata") + .library_search_path(".") + .output("client1.rmeta") + .run(); + + rustc().input("foo_bar.rs").crate_type("rlib").run(); + rustc() + .input("client.rs") + .crate_type("rlib") + .emit("metadata") + .library_search_path(".") + .output("client2.rmeta") + .run(); + + assert_eq!(rfs::read("client1.rmeta"), rfs::read("client2.rmeta")); +} From 5c012f598c320ebfde4a280d93216541466ab0b9 Mon Sep 17 00:00:00 2001 From: E Shattow Date: Thu, 28 May 2026 14:23:28 -0700 Subject: [PATCH 22/33] Promote riscv64-unknown-linux-musl to tier 2 with host tools Implements MCP 982 via issue 156191 --- .../targets/riscv64gc_unknown_linux_musl.rs | 2 +- src/bootstrap/src/core/build_steps/llvm.rs | 1 + src/bootstrap/src/core/download.rs | 1 + src/ci/docker/README.md | 16 +++++++ .../Dockerfile | 2 +- .../riscv64-unknown-linux-gnu.defconfig | 0 .../dist-riscv64-linux-musl/Dockerfile | 39 ++++++++++++++++ .../riscv64-unknown-linux-musl.defconfig | 16 +++++++ src/ci/github-actions/jobs.yml | 5 +- src/doc/rustc/src/platform-support.md | 2 +- .../riscv64gc-unknown-linux-gnu.md | 15 +++--- .../riscv64gc-unknown-linux-musl.md | 46 +++++++++++-------- 12 files changed, 116 insertions(+), 29 deletions(-) rename src/ci/docker/host-x86_64/{dist-riscv64-linux => dist-riscv64-linux-gnu}/Dockerfile (92%) rename src/ci/docker/host-x86_64/{dist-riscv64-linux => dist-riscv64-linux-gnu}/riscv64-unknown-linux-gnu.defconfig (100%) create mode 100644 src/ci/docker/host-x86_64/dist-riscv64-linux-musl/Dockerfile create mode 100644 src/ci/docker/host-x86_64/dist-riscv64-linux-musl/riscv64-unknown-linux-musl.defconfig diff --git a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs index 8ed4e09adbbfe..088d4821042d8 100644 --- a/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs @@ -10,7 +10,7 @@ pub(crate) fn target() -> Target { metadata: TargetMetadata { description: Some("RISC-V Linux (kernel 4.20, musl 1.2.5)".into()), tier: Some(2), - host_tools: Some(false), + host_tools: Some(true), std: Some(true), }, pointer_width: 64, diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 572df47d3a62c..b13759cfdaa25 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -248,6 +248,7 @@ pub(crate) fn is_ci_llvm_available_for_target( ("powerpc64le-unknown-linux-gnu", false), ("powerpc64le-unknown-linux-musl", false), ("riscv64gc-unknown-linux-gnu", false), + ("riscv64gc-unknown-linux-musl", false), ("s390x-unknown-linux-gnu", false), ("x86_64-pc-windows-gnullvm", false), ("x86_64-unknown-freebsd", false), diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index 76fd2cb0bc14b..4058f1482a951 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -481,6 +481,7 @@ pub(crate) fn is_download_ci_available(target_triple: &str, llvm_assertions: boo "powerpc64le-unknown-linux-gnu", "powerpc64le-unknown-linux-musl", "riscv64gc-unknown-linux-gnu", + "riscv64gc-unknown-linux-musl", "s390x-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-gnu", diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md index 6e5a38a3c515a..b113adc2008cd 100644 --- a/src/ci/docker/README.md +++ b/src/ci/docker/README.md @@ -462,6 +462,22 @@ For targets: `riscv64-unknown-linux-gnu` - C compiler > gcc version = 8.5.0 - C compiler > C++ = ENABLE -- to cross compile LLVM +### `riscv64-unknown-linux-musl.defconfig` + +For targets: `riscv64-unknown-linux-musl` + +- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} +- Path and misc options > Use a mirror = ENABLE +- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc +- Target options > Target Architecture = riscv +- Target options > Bitness = 64-bit +- Operating System > Target OS = linux +- Operating System > Linux kernel version = 4.20.17 +- Binary utilities > Version of binutils = 2.40 +- C-library > musl version = 1.2.5 +- C compiler > gcc version = 8.5.0 +- C compiler > C++ = ENABLE -- to cross compile LLVM + ### `s390x-linux-gnu.defconfig` For targets: `s390x-unknown-linux-gnu` diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-riscv64-linux-gnu/Dockerfile similarity index 92% rename from src/ci/docker/host-x86_64/dist-riscv64-linux/Dockerfile rename to src/ci/docker/host-x86_64/dist-riscv64-linux-gnu/Dockerfile index 5186c99c4f430..57f3b68a96e3f 100644 --- a/src/ci/docker/host-x86_64/dist-riscv64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-riscv64-linux-gnu/Dockerfile @@ -12,7 +12,7 @@ RUN sh /scripts/rustbuild-setup.sh WORKDIR /tmp COPY scripts/crosstool-ng-build.sh /scripts/ -COPY host-x86_64/dist-riscv64-linux/riscv64-unknown-linux-gnu.defconfig /tmp/crosstool.defconfig +COPY host-x86_64/dist-riscv64-linux-gnu/riscv64-unknown-linux-gnu.defconfig /tmp/crosstool.defconfig RUN /scripts/crosstool-ng-build.sh COPY scripts/sccache.sh /scripts/ diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux/riscv64-unknown-linux-gnu.defconfig b/src/ci/docker/host-x86_64/dist-riscv64-linux-gnu/riscv64-unknown-linux-gnu.defconfig similarity index 100% rename from src/ci/docker/host-x86_64/dist-riscv64-linux/riscv64-unknown-linux-gnu.defconfig rename to src/ci/docker/host-x86_64/dist-riscv64-linux-gnu/riscv64-unknown-linux-gnu.defconfig diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/Dockerfile new file mode 100644 index 0000000000000..bb7537fc7d279 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:22.04 + +COPY scripts/cross-apt-packages.sh /scripts/ +RUN sh /scripts/cross-apt-packages.sh + +COPY scripts/crosstool-ng.sh /scripts/ +COPY scripts/crosstool-ng-sha256-20260705.diff /scripts/ +RUN sh /scripts/crosstool-ng.sh + +COPY scripts/rustbuild-setup.sh /scripts/ +RUN sh /scripts/rustbuild-setup.sh + +WORKDIR /tmp + +COPY scripts/crosstool-ng-build.sh /scripts/ +COPY host-x86_64/dist-riscv64-linux-musl/riscv64-unknown-linux-musl.defconfig /tmp/crosstool.defconfig +RUN /scripts/crosstool-ng-build.sh + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +ENV PATH=$PATH:/x-tools/riscv64-unknown-linux-musl/bin + +ENV CC_riscv64gc_unknown_linux_musl=riscv64-unknown-linux-musl-gcc \ + AR_riscv64gc_unknown_linux_musl=riscv64-unknown-linux-musl-ar \ + CXX_riscv64gc_unknown_linux_musl=riscv64-unknown-linux-musl-g++ + +ENV HOSTS=riscv64gc-unknown-linux-musl +ENV TARGETS=riscv64gc-unknown-linux-musl + +ENV RUST_CONFIGURE_ARGS="--enable-extended \ + --enable-full-tools \ + --enable-profiler \ + --enable-sanitizers \ + --disable-docs \ + --set target.riscv64gc-unknown-linux-musl.crt-static=false \ + --musl-root-riscv64gc=/x-tools/riscv64-unknown-linux-musl/riscv64-unknown-linux-musl/sysroot/usr" + +ENV SCRIPT="python3 ../x.py dist --target $TARGETS --host $HOSTS" diff --git a/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/riscv64-unknown-linux-musl.defconfig b/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/riscv64-unknown-linux-musl.defconfig new file mode 100644 index 0000000000000..435a2bea80d36 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-riscv64-linux-musl/riscv64-unknown-linux-musl.defconfig @@ -0,0 +1,16 @@ +CT_CONFIG_VERSION="4" +CT_PREFIX_DIR="/x-tools/${CT_TARGET}" +CT_USE_MIRROR=y +CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc" +CT_VERIFY_DOWNLOAD_DIGEST_SHA256=y +CT_ARCH_RISCV=y +CT_ARCH_USE_MMU=y +CT_ARCH_64=y +CT_ARCH_ARCH="rv64gc" +CT_KERNEL_LINUX=y +CT_LINUX_V_4_20=y +CT_LIBC_MUSL=y +CT_BINUTILS_V_2_40=y +CT_MUSL_V_1_2_5=y +CT_GCC_V_8=y +CT_CC_LANG_CXX=y diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index a236effaa9b40..c374888ac8909 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -270,7 +270,10 @@ auto: - name: dist-powerpc64le-linux-musl <<: *job-linux-4c - - name: dist-riscv64-linux + - name: dist-riscv64-linux-gnu + <<: *job-linux-4c + + - name: dist-riscv64-linux-musl <<: *job-linux-4c - name: dist-s390x-linux diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index ce4d55c2d2b00..c527911bc96a2 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -105,6 +105,7 @@ target | notes [`powerpc64le-unknown-linux-gnu`](platform-support/powerpc64le-unknown-linux-gnu.md) | PPC64LE Linux (kernel 3.10+, glibc 2.17) [`powerpc64le-unknown-linux-musl`](platform-support/powerpc64le-unknown-linux-musl.md) | PPC64LE Linux (kernel 4.19+, musl 1.2.5) [`riscv64gc-unknown-linux-gnu`](platform-support/riscv64gc-unknown-linux-gnu.md) | RISC-V Linux (kernel 4.20+, glibc 2.29) +[`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | RISC-V Linux (kernel 4.20+, musl 1.2.5) [`s390x-unknown-linux-gnu`](platform-support/s390x-unknown-linux-gnu.md) | S390x Linux (kernel 3.2+, glibc 2.17) [`x86_64-apple-darwin`](platform-support/apple-darwin.md) | 64-bit macOS (10.12+, Sierra+) [`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | 64-bit x86 MinGW (Windows 10+), LLVM ABI @@ -196,7 +197,6 @@ target | std | notes [`riscv32imafc-unknown-none-elf`](platform-support/riscv32-unknown-none-elf.md) | * | Bare RISC-V (RV32IMAFC ISA) [`riscv32imc-unknown-none-elf`](platform-support/riscv32-unknown-none-elf.md) | * | Bare RISC-V (RV32IMC ISA) [`riscv64a23-unknown-linux-gnu`](platform-support/riscv64a23-unknown-linux-gnu.md) | ✓ | RISC-V Linux (kernel 6.8.0+, glibc 2.39) -[`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | ✓ |RISC-V Linux (kernel 4.20+, musl 1.2.5) `riscv64gc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFDC ISA) [`riscv64im-unknown-none-elf`](platform-support/riscv64im-unknown-none-elf.md) | * | Bare RISC-V (RV64IM ISA) `riscv64imac-unknown-none-elf` | * | Bare RISC-V (RV64IMAC ISA) diff --git a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-gnu.md b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-gnu.md index d62a65b21904f..119c3053cda7e 100644 --- a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-gnu.md +++ b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-gnu.md @@ -2,7 +2,8 @@ **Tier: 2 (with Host Tools)** -RISC-V targets using the *RV64I* base instruction set with the *G* collection of extensions, as well as the *C* extension. +Linux GNU libc RISC-V target using the *RV64I* base instruction set with the +*G* collection of extensions, as well as the *C* extension. ## Target maintainers @@ -22,10 +23,10 @@ This target requires: ## Building the target -These targets are distributed through `rustup`, and otherwise require no +This target is distributed through `rustup`, and otherwise requires no special configuration. -If you need to build your own Rust for some reason though, the targets can be +If you need to build your own Rust for some reason though, the target can be enabled in `bootstrap.toml`. For example: ```toml @@ -37,10 +38,10 @@ target = ["riscv64gc-unknown-linux-gnu"] ## Building Rust programs -On a RISC-V host, the `riscv64gc-unknown-linux-gnu` target should be automatically -installed and used by default. +On a riscv64gc-unknown-linux-gnu host, the `riscv64gc-unknown-linux-gnu` +target should be automatically installed and used by default. -On a non-RISC-V host, add the target: +On all other hosts, add the target: ```bash rustup target add riscv64gc-unknown-linux-gnu @@ -55,7 +56,7 @@ cargo build --target riscv64gc-unknown-linux-gnu ## Testing -There are no special requirements for testing and running the targets. +There are no special requirements for testing and running the target. For testing cross builds on the host, please refer to the "Cross-compilation toolchains and C code" section below. diff --git a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md index 2e88b5aa813ff..4ac2a894117c1 100644 --- a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md +++ b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md @@ -1,8 +1,10 @@ # riscv64gc-unknown-linux-musl -**Tier: 2** +**Tier: 2 (with Host Tools)** + +Linux musl libc RISC-V target using the *RV64I* base instruction set with the +*G* collection of extensions, as well as the *C* extension. -Target for RISC-V Linux programs using musl libc. ## Target maintainers @@ -11,37 +13,45 @@ Target for RISC-V Linux programs using musl libc. ## Requirements -Building the target itself requires a RISC-V compiler that is supported by `cc-rs`. +This target requires: + +* Linux Kernel version 4.20 or later +* musl libc 1.2.5 or later + ## Building the target -The target can be built by enabling it for a `rustc` build. +This target is distributed through `rustup`, and otherwise requires no +special configuration. + +If you need to build your own Rust then the targets can be enabled in +`bootstrap.toml`. For example: ```toml [build] target = ["riscv64gc-unknown-linux-musl"] ``` -Make sure your C compiler is included in `$PATH`, then add it to the `bootstrap.toml`: - -```toml -[target.riscv64gc-unknown-linux-musl] -cc = "riscv64-linux-gnu-gcc" -cxx = "riscv64-linux-gnu-g++" -ar = "riscv64-linux-gnu-ar" -linker = "riscv64-linux-gnu-gcc" -``` ## Building Rust programs -This target are distributed through `rustup`, and otherwise require no -special configuration. -## Cross-compilation +On a riscv64gc-unknown-linux-musl host, the `riscv64gc-unknown-linux-musl` +target should be automatically installed and used by default. -This target can be cross-compiled from any host. +On all other hosts, add the target: + +```bash +rustup target add riscv64gc-unknown-linux-musl +``` + +Then cross compile crates with: + +```bash +cargo build --target riscv64gc-unknown-linux-musl +``` ## Testing -This target can be tested as normal with `x.py` on a RISC-V host or via QEMU +The target can be tested as normal with `x.py` on a RISC-V host or via QEMU emulation. From 3086aff340346d1ef047dd556298e66532eb4983 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:50:26 +0200 Subject: [PATCH 23/33] don't build riscv64gc-unknown-linux-musl twice --- .../docker/host-x86_64/dist-various-2/Dockerfile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index f07fb91edaf0b..12705809e4290 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -24,8 +24,7 @@ RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y --no # Needed for apt-key to work: dirmngr \ gpg-agent \ - g++-9-arm-linux-gnueabi \ - g++-11-riscv64-linux-gnu + g++-9-arm-linux-gnueabi ENV \ AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \ @@ -71,10 +70,6 @@ RUN env \ CC=arm-linux-gnueabi-gcc-9 CFLAGS="-march=armv7-a" \ CXX=arm-linux-gnueabi-g++-9 CXXFLAGS="-march=armv7-a" \ bash musl.sh armv7 && \ - env \ - CC=riscv64-linux-gnu-gcc-11 \ - CXX=riscv64-linux-gnu-g++-11 \ - bash musl.sh riscv64gc && \ rm -rf /build/* WORKDIR /tmp @@ -120,7 +115,6 @@ ENV TARGETS=$TARGETS,x86_64-unknown-none ENV TARGETS=$TARGETS,aarch64-unknown-uefi ENV TARGETS=$TARGETS,i686-unknown-uefi ENV TARGETS=$TARGETS,x86_64-unknown-uefi -ENV TARGETS=$TARGETS,riscv64gc-unknown-linux-musl ENV TARGETS_SANITIZERS=x86_64-unknown-linux-gnuasan ENV TARGETS_SANITIZERS=$TARGETS_SANITIZERS,x86_64-unknown-linux-gnumsan @@ -132,11 +126,7 @@ ENV TARGETS_SANITIZERS=$TARGETS_SANITIZERS,x86_64-unknown-linux-gnutsan # Luckily one of the folders is /usr/local/include so symlink /usr/include/x86_64-linux-gnu/asm there RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/include/asm -# musl-gcc can't find libgcc_s.so.1 since it doesn't use the standard search paths. -RUN ln -s /usr/riscv64-linux-gnu/lib/libgcc_s.so.1 /usr/lib/gcc-cross/riscv64-linux-gnu/11/ - ENV RUST_CONFIGURE_ARGS="--enable-extended --enable-lld --enable-llvm-bitcode-linker --disable-docs \ - --musl-root-armv7=/musl-armv7 \ - --musl-root-riscv64gc=/musl-riscv64gc" + --musl-root-armv7=/musl-armv7" ENV SCRIPT="python3 ../x.py dist --host= --target $TARGETS && python3 ../x.py dist --host= --set build.sanitizers=true --target $TARGETS_SANITIZERS" From 2af4af2fb1abcdd12eb116c3f5c451e20b8b82f1 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:13:59 +0200 Subject: [PATCH 24/33] update download-ci-llvm-stamp --- src/bootstrap/download-ci-llvm-stamp | 2 +- .../rustc/src/platform-support/riscv64gc-unknown-linux-musl.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp index b61c7b18bad01..ba6dcfc761c5a 100644 --- a/src/bootstrap/download-ci-llvm-stamp +++ b/src/bootstrap/download-ci-llvm-stamp @@ -1,4 +1,4 @@ Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. -Last change is for: https://github.com/rust-lang/rust/pull/157385 +Last change is for: https://github.com/rust-lang/rust/pull/158766 diff --git a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md index 4ac2a894117c1..12872b74b6820 100644 --- a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md +++ b/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md @@ -35,7 +35,6 @@ target = ["riscv64gc-unknown-linux-musl"] ## Building Rust programs - On a riscv64gc-unknown-linux-musl host, the `riscv64gc-unknown-linux-musl` target should be automatically installed and used by default. From 219d6bb9358b9da1a166b21ad5f4008514a4c258 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 23 Jul 2026 11:18:56 +0200 Subject: [PATCH 25/33] Filter derive impls earlier on --- src/librustdoc/passes/propagate_doc_cfg.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/librustdoc/passes/propagate_doc_cfg.rs b/src/librustdoc/passes/propagate_doc_cfg.rs index ac1aae7fffe1d..e15bb657b7867 100644 --- a/src/librustdoc/passes/propagate_doc_cfg.rs +++ b/src/librustdoc/passes/propagate_doc_cfg.rs @@ -3,6 +3,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_hir::attrs::{AttributeKind, DocAttribute}; use rustc_hir::{Attribute, find_attr}; +use rustc_span::{ExpnKind, MacroKind}; use crate::clean::inline::{load_attrs, merge_attrs}; use crate::clean::{CfgInfo, Crate, Item, ItemId, ItemKind}; @@ -136,21 +137,23 @@ impl DocFolder for CfgPropagator<'_, '_> { if let ItemKind::PlaceholderImplItem = item.kind { if let Some(impl_def_id) = item.item_id.as_def_id() { let tcx = self.cx.tcx; - // This impl block likely comes from a `derive` expansion, so we want to retrieve - // the `cfg_attr` if any. - if let Some(self_ty_def_id) = tcx - .type_of(impl_def_id) - .instantiate_identity() - .skip_norm_wip() - .ty_adt_def() - .map(|adt| adt.did()) + let expn_data = tcx.expn_that_defined(impl_def_id).expn_data(); + if matches!(expn_data.kind, ExpnKind::Macro(MacroKind::Derive, _)) + // This impl block comes from a `derive` expansion, so we want to retrieve + // the `cfg_attr` if any. + && let Some(self_ty_def_id) = tcx + .type_of(impl_def_id) + .instantiate_identity() + .skip_norm_wip() + .ty_adt_def() + .map(|adt| adt.did()) && let self_ty_attrs = load_attrs(tcx, self_ty_def_id) && let Some(cfgs_attr_trace) = find_attr!(self_ty_attrs, CfgAttrTrace(cfgs) => cfgs) && !cfgs_attr_trace.is_empty() { // We retrieve the `cfg_attr` of the `derive` this `impl` comes from. - let derive_span = tcx.expn_that_defined(impl_def_id).expn_data().call_site; + let derive_span = expn_data.call_site; let attrs_iter = Attribute::Parsed(AttributeKind::CfgTrace( cfgs_attr_trace .iter() From 7e294a52065dba577fc9b8b952eceb0a2cea2114 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 23 Jul 2026 11:56:10 +0200 Subject: [PATCH 26/33] Fix `tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs` test --- compiler/rustc_expand/src/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 663c12f8c9ccf..29f78ff5769a5 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -2,6 +2,7 @@ use std::iter; +use rustc_ast::attr::data_structures::CfgEntry; use rustc_ast::token::{Delimiter, Token, TokenKind}; use rustc_ast::tokenstream::{ AttrTokenStream, AttrTokenTree, LazyAttrTokenStream, Spacing, TokenTree, WithTokens, @@ -254,7 +255,10 @@ impl<'a> StripUnconfigured<'a> { self.features, self.lint_node_id, ) else { - return vec![]; + let trace_attr = cfg_attr.clone().convert_normal_to_synthetic( + SyntheticAttr::CfgAttrTrace(CfgEntry::Bool(true, cfg_attr.span)), + ); + return vec![trace_attr]; }; // Lint on zero attributes in source. From 220fbca724f7ba31be3f0926fd9227324940d83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 23 Jul 2026 12:36:44 +0200 Subject: [PATCH 27/33] Avoid spurious rebuilds of JSON docs in bootstrap --- src/bootstrap/src/core/build_steps/doc.rs | 67 ++++++++++++++++------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index df3fb001e5bc5..99e2c61e442ff 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -721,7 +721,7 @@ impl Step for Std { DocumentationFormat::Html => { vec!["--markdown-css", "rust.css", "--markdown-no-toc", "--index-page", &index_page] } - DocumentationFormat::Json => vec!["--output-format", "json"], + DocumentationFormat::Json => vec![], }; if !builder.config.docs_minification { @@ -730,7 +730,47 @@ impl Step for Std { // For `--index-page` and `--output-format=json`. extra_args.push("-Zunstable-options"); - doc_std(builder, self.format, self.build_compiler, target, &out, &extra_args, &crates); + let target_doc_dir_name = + if self.format == DocumentationFormat::Json { "json-doc" } else { "doc" }; + let target_dir = builder + .stage_out(self.build_compiler, Mode::Std) + .join(target) + .join(target_doc_dir_name); + + // This is directory where the compiler will place the output of the command. + // We will then copy the files from this directory into the final `out` directory, the specified + // as a function parameter. + let out_dir = target_dir.join(target).join("doc"); + + let mut cargo = doc_std( + builder, + self.format, + self.build_compiler, + target, + &target_dir, + &extra_args, + &crates, + ); + match self.format { + DocumentationFormat::Html => {} + DocumentationFormat::Json => { + // We have to pass these directly to cargo, rather than through RUSTDOCFLAGS, + // otherwise Cargo will not detect freshness of the output correctly, and keep + // rebuilding the docs on every invocation. + cargo.args(["-Zunstable-options", "--output-format", "json"]); + } + } + + let description = + format!("library{} in {} format", crate_description(&crates), self.format.as_str()); + + { + let _guard = + builder.msg(Kind::Doc, description, Mode::Std, self.build_compiler, target); + + cargo.into_cmd().run(builder); + builder.cp_link_r(&out_dir, &out); + } // Open if the format is HTML if let DocumentationFormat::Html = self.format { @@ -787,25 +827,16 @@ impl DocumentationFormat { } } -/// Build the documentation for public standard library crates. +/// Prepare a Cargo command for building the documentation for public standard library crates. fn doc_std( builder: &Builder<'_>, format: DocumentationFormat, build_compiler: Compiler, target: TargetSelection, - out: &Path, + target_dir: &Path, extra_args: &[&str], requested_crates: &[String], -) { - let target_doc_dir_name = if format == DocumentationFormat::Json { "json-doc" } else { "doc" }; - let target_dir = - builder.stage_out(build_compiler, Mode::Std).join(target).join(target_doc_dir_name); - - // This is directory where the compiler will place the output of the command. - // We will then copy the files from this directory into the final `out` directory, the specified - // as a function parameter. - let out_dir = target_dir.join(target).join("doc"); - +) -> builder::Cargo { let mut cargo = builder::Cargo::new( builder, build_compiler, @@ -836,13 +867,7 @@ fn doc_std( if format == DocumentationFormat::Json || builder.config.library_docs_private_items { cargo.rustdocflag("--document-private-items").rustdocflag("--document-hidden-items"); } - - let description = - format!("library{} in {} format", crate_description(requested_crates), format.as_str()); - let _guard = builder.msg(Kind::Doc, description, Mode::Std, build_compiler, target); - - cargo.into_cmd().run(builder); - builder.cp_link_r(&out_dir, out); + cargo } /// Prepare a compiler that will be able to document something for `target` at `stage`. From fe37a8afad39e1734a43e92bff20c27102b9164a Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Thu, 23 Jul 2026 11:06:59 -0700 Subject: [PATCH 28/33] Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata The recent Cargo submodule update picked up However, bootstrap was still using the old name, resulting in: ``` Building stage1 library artifacts (stage1 -> stage1, arm64ec-pc-windows-msvc) error: unknown `-Z` flag specified: no-embed-metadata ``` Fix is to switch to the rename. I also removed the diff in the Cranelift setup script, since they must have already hit this issue and no longer need the workaround. --- .../scripts/setup_rust_fork.sh | 13 ------------- src/bootstrap/src/core/builder/cargo.rs | 7 ++++++- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh index c2b0e37a8eca7..ab31c43fb1b12 100644 --- a/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh +++ b/compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh @@ -62,19 +62,6 @@ index 2e16f2cf27..3ac3df99a8 100644 # Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation. # Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of # RUSTFLAGS, since that causes RUSTFLAGS_BOOTSTRAP to override RUSTFLAGS. -diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs -index 6de70c7d70c..d5035b581ce 100644 ---- a/src/bootstrap/src/core/builder/cargo.rs -+++ b/src/bootstrap/src/core/builder/cargo.rs -@@ -1197,7 +1197,7 @@ fn cargo( - cargo.env("RUSTC_BOOTSTRAP", "1"); - - if matches!(mode, Mode::Std) { -- cargo.arg("-Zno-embed-metadata"); -+ cargo.arg("-Zembed-metadata=no"); - } - - if self.config.dump_bootstrap_shims { diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index bc68bfe396..00143ef3ed 100644 --- a/src/bootstrap/src/core/config/config.rs diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 6de70c7d70cde..3a1e4299b5475 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -1197,7 +1197,12 @@ impl Builder<'_> { cargo.env("RUSTC_BOOTSTRAP", "1"); if matches!(mode, Mode::Std) { - cargo.arg("-Zno-embed-metadata"); + // The `-Zembed-metadata` flag was renamed from `-Zno-embed-metadata`. + if self.local_rebuild { + cargo.arg("-Zembed-metadata=no"); + } else { + cargo.arg("-Zno-embed-metadata"); + } } if self.config.dump_bootstrap_shims { From 2e2cdf9b812cc5e80ca4a0715689e5ca275e94a1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 Jul 2026 13:37:58 +1000 Subject: [PATCH 29/33] Improve consistency of attribute stability error messages These changes involve the error messages produced in `check_attribute_stability`, plus some related ones. The basic idea: - Use "the `foo` attribute" in `error` lines as much as possible, where `foo` is the attribute's path. - Point carets at just the attribute's path, to match the `error` line. --- .../src/attributes/crate_level.rs | 2 +- .../attributes/diagnostic/on_unimplemented.rs | 2 +- .../src/attributes/dummy.rs | 2 +- .../src/attributes/inline.rs | 6 ++-- .../src/attributes/rustc_dump.rs | 6 ++-- .../src/attributes/rustc_internal.rs | 16 +++++------ .../src/attributes/splat.rs | 3 +- compiler/rustc_attr_parsing/src/stability.rs | 24 ++++++++-------- tests/ui/attributes/malformed-attrs.rs | 2 +- tests/ui/attributes/malformed-attrs.stderr | 6 ++-- .../malformed-never-type-options.stderr | 6 ++-- tests/ui/attributes/unstable_removed.stderr | 12 ++------ tests/ui/comptime/feature-gate-test.stderr | 6 ++-- .../cfg-attr-crate-2.rs | 2 +- .../cfg-attr-crate-2.stderr | 2 +- .../cfg-attr-multi-invalid-1.rs | 2 +- .../cfg-attr-multi-invalid-1.stderr | 2 +- .../cfg-attr-multi-invalid-2.rs | 2 +- .../cfg-attr-multi-invalid-2.stderr | 2 +- tests/ui/consts/gate-do-not-const-check.rs | 4 +-- .../ui/consts/gate-do-not-const-check.stderr | 8 +++--- tests/ui/coroutine/gen_block.e2024.stderr | 12 ++++---- tests/ui/coroutine/gen_block.none.stderr | 12 ++++---- tests/ui/coroutine/gen_block.rs | 4 +-- .../coverage-attr/bad-attr-ice.nofeat.stderr | 6 ++-- tests/ui/coverage-attr/bad-attr-ice.rs | 6 ++-- .../feature-gate-allocator_internals.stderr | 6 ++-- ...gate-allow-internal-unsafe-nested-macro.rs | 2 +- ...-allow-internal-unsafe-nested-macro.stderr | 6 ++-- ...te-allow-internal-unstable-nested-macro.rs | 2 +- ...llow-internal-unstable-nested-macro.stderr | 6 ++-- ...ure-gate-allow-internal-unstable-struct.rs | 2 +- ...gate-allow-internal-unstable-struct.stderr | 6 ++-- .../feature-gate-allow-internal-unstable.rs | 2 +- ...eature-gate-allow-internal-unstable.stderr | 6 ++-- .../feature-gate-cfi_encoding.rs | 2 +- .../feature-gate-cfi_encoding.stderr | 6 ++-- ...ture-gate-check-nested-macro-invocation.rs | 2 +- ...-gate-check-nested-macro-invocation.stderr | 6 ++-- .../feature-gate-compiler-builtins.rs | 2 +- .../feature-gate-compiler-builtins.stderr | 6 ++-- .../feature-gate-coverage-attribute.rs | 2 +- .../feature-gate-coverage-attribute.stderr | 6 ++-- .../feature-gates/feature-gate-custom_mir.rs | 2 +- .../feature-gate-custom_mir.stderr | 6 ++-- ...feature-gate-custom_test_frameworks.stderr | 8 +++--- ...e-effective-target-features.default.stderr | 6 ++-- .../feature-gate-effective-target-features.rs | 2 +- .../feature-gate-export_stable.rs | 2 +- .../feature-gate-export_stable.stderr | 6 ++-- .../feature-gates/feature-gate-ffi_const.rs | 2 +- .../feature-gate-ffi_const.stderr | 6 ++-- .../ui/feature-gates/feature-gate-ffi_pure.rs | 2 +- .../feature-gate-ffi_pure.stderr | 6 ++-- .../ui/feature-gates/feature-gate-fn_align.rs | 4 +-- .../feature-gate-fn_align.stderr | 12 ++++---- .../feature-gates/feature-gate-fundamental.rs | 2 +- .../feature-gate-fundamental.stderr | 6 ++-- .../feature-gate-instrument-fn.stderr | 12 ++++---- .../feature-gates/feature-gate-intrinsics.rs | 2 +- .../feature-gate-intrinsics.stderr | 6 ++-- .../feature-gate-lang-items.stderr | 4 +-- .../feature-gate-large-assignments.rs | 2 +- .../feature-gate-large-assignments.stderr | 6 ++-- .../feature-gates/feature-gate-linkage.stderr | 4 +-- .../feature-gates/feature-gate-loop-hints.rs | 2 +- .../feature-gate-loop-hints.stderr | 6 ++-- .../feature-gates/feature-gate-loop-match.rs | 6 ++-- .../feature-gate-loop-match.stderr | 18 ++++++------ .../feature-gate-marker_trait_attr.rs | 2 +- .../feature-gate-marker_trait_attr.stderr | 6 ++-- .../feature-gates/feature-gate-may-dangle.rs | 2 +- .../feature-gate-may-dangle.stderr | 6 ++-- .../feature-gate-needs-allocator.rs | 2 +- .../feature-gate-needs-allocator.stderr | 6 ++-- .../ui/feature-gates/feature-gate-no_core.rs | 2 +- .../feature-gates/feature-gate-no_core.stderr | 6 ++-- .../feature-gate-optimize_attribute.rs | 8 +++--- .../feature-gate-optimize_attribute.stderr | 24 ++++++++-------- .../feature-gate-patchable-function-entry.rs | 2 +- ...ature-gate-patchable-function-entry.stderr | 6 ++-- .../feature-gate-pattern-complexity-limit.rs | 4 +-- ...ature-gate-pattern-complexity-limit.stderr | 8 +++--- .../feature-gate-pin_ergonomics.rs | 2 +- .../feature-gate-pin_ergonomics.stderr | 6 ++-- .../feature-gate-prelude_import.rs | 2 +- .../feature-gate-prelude_import.stderr | 6 ++-- .../feature-gate-profiler-runtime.rs | 2 +- .../feature-gate-profiler-runtime.stderr | 6 ++-- .../feature-gate-register_tool.rs | 2 +- .../feature-gate-register_tool.stderr | 6 ++-- ...-gate-rustc-allow-const-fn-unstable.stderr | 6 ++-- .../feature-gate-rustc-attrs-1.rs | 8 +++--- .../feature-gate-rustc-attrs-1.stderr | 16 +++++------ .../feature-gates/feature-gate-rustc-attrs.rs | 4 +-- .../feature-gate-rustc-attrs.stderr | 8 +++--- .../feature-gate-rustc_const_unstable.stderr | 4 +-- .../ui/feature-gates/feature-gate-sanitize.rs | 2 +- .../feature-gate-sanitize.stderr | 6 ++-- tests/ui/feature-gates/feature-gate-splat.rs | 2 +- .../feature-gates/feature-gate-splat.stderr | 8 +++--- .../feature-gate-staged_api.stderr | 8 +++--- .../feature-gate-static_align-thread_local.rs | 2 +- .../feature-gate-static_align.rs | 4 +-- .../feature-gate-static_align.stderr | 12 ++++---- .../feature-gate-thread_local.rs | 2 +- .../feature-gate-thread_local.stderr | 6 ++-- .../feature-gated-feature-in-macro-arg.rs | 2 +- .../feature-gated-feature-in-macro-arg.stderr | 6 ++-- ...sue-43106-gating-of-builtin-attrs-error.rs | 4 +-- ...43106-gating-of-builtin-attrs-error.stderr | 8 +++--- .../issue-43106-gating-of-stable.stderr | 28 +++++++++---------- .../issue-43106-gating-of-unstable.stderr | 28 +++++++++---------- tests/ui/force-inlining/gate.rs | 8 +++--- tests/ui/force-inlining/gate.stderr | 16 +++++------ .../incorrect-read_via_copy-defn.rs | 2 +- .../incorrect-read_via_copy-defn.stderr | 6 ++-- tests/ui/intrinsics/incorrect-transmute.rs | 2 +- .../ui/intrinsics/incorrect-transmute.stderr | 6 ++-- tests/ui/lang-items/issue-83471.stderr | 16 +++++------ tests/ui/linkage-attr/linkage4.stderr | 4 +-- .../feature-gate-must_not_suspend.rs | 2 +- .../feature-gate-must_not_suspend.stderr | 6 ++-- .../feature-gate-on-unimplemented.rs | 4 +-- .../feature-gate-on-unimplemented.stderr | 8 +++--- tests/ui/panic-runtime/needs-gate.stderr | 12 ++++---- .../pattern-matching.normal.stderr | 12 ++++---- tests/ui/pin-ergonomics/pattern-matching.rs | 4 +-- .../ui/rustdoc/feature-gate-doc_primitive.rs | 4 +-- .../rustdoc/feature-gate-doc_primitive.stderr | 8 +++--- .../stability-attribute/issue-106589.stderr | 8 +++--- ...attribute-non-staged-force-unstable.stderr | 8 +++--- .../stability-attribute-non-staged.stderr | 8 +++--- tests/ui/thread-local/no-unstable.rs | 8 ++---- tests/ui/thread-local/no-unstable.stderr | 26 +++++++---------- tests/ui/tool-attributes/diagnostic_item.rs | 4 +-- .../ui/tool-attributes/diagnostic_item.stderr | 8 +++--- .../const-traits/partial/attr-gate.stderr | 8 +++--- .../rustc_must_implement_one_of_gated.rs | 4 +-- .../rustc_must_implement_one_of_gated.stderr | 8 +++--- .../unstable_feature_bound_staged_api.stderr | 4 +-- 141 files changed, 428 insertions(+), 443 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/crate_level.rs b/compiler/rustc_attr_parsing/src/attributes/crate_level.rs index 03012941cb1c9..4e10a2060b812 100644 --- a/compiler/rustc_attr_parsing/src/attributes/crate_level.rs +++ b/compiler/rustc_attr_parsing/src/attributes/crate_level.rs @@ -127,7 +127,7 @@ impl SingleAttributeParser for PatternComplexityLimitParser { const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Crate)]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[pattern_complexity_limit]` attribute is used for rustc unit tests" + "the `pattern_complexity_limit` attribute is used for rustc unit tests" ); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs index 057d243c6d123..bd82a532c1c3c 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unimplemented.rs @@ -38,7 +38,7 @@ impl AttributeParser for OnUnimplementedParser { template!(List: &[r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#]), unstable!( rustc_attrs, - "see `#[diagnostic::on_unimplemented]` for the stable equivalent of this attribute" + "see the `diagnostic::on_unimplemented` attribute for the stable equivalent of this attribute" ), |this, cx, args| { this.parse(cx, args, Mode::RustcOnUnimplemented); diff --git a/compiler/rustc_attr_parsing/src/attributes/dummy.rs b/compiler/rustc_attr_parsing/src/attributes/dummy.rs index 83984d48919b7..425637b694e98 100644 --- a/compiler/rustc_attr_parsing/src/attributes/dummy.rs +++ b/compiler/rustc_attr_parsing/src/attributes/dummy.rs @@ -15,7 +15,7 @@ impl SingleAttributeParser for RustcDummyParser { const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::ManuallyChecked; const TEMPLATE: AttributeTemplate = template!(Word); // Anything, really const STABILITY: AttributeStability = - unstable!(rustc_attrs, "the `#[rustc_dummy]` attribute is used for rustc unit tests"); + unstable!(rustc_attrs, "the `rustc_dummy` attribute is used for rustc unit tests"); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { args.ignore_args(); diff --git a/compiler/rustc_attr_parsing/src/attributes/inline.rs b/compiler/rustc_attr_parsing/src/attributes/inline.rs index 80328e1c8ef96..d3b632fae99d9 100644 --- a/compiler/rustc_attr_parsing/src/attributes/inline.rs +++ b/compiler/rustc_attr_parsing/src/attributes/inline.rs @@ -70,8 +70,10 @@ impl SingleAttributeParser for RustcForceInlineParser { Allow(Target::Fn), Allow(Target::Method(MethodKind::Inherent)), ]); - const STABILITY: AttributeStability = - unstable!(rustc_attrs, "`#[rustc_force_inline]` forces a free function to be inlined"); + const STABILITY: AttributeStability = unstable!( + rustc_attrs, + "the `rustc_force_inline` attribute forces a free function to be inlined" + ); const TEMPLATE: AttributeTemplate = template!(Word, List: &["reason"], NameValueStr: "reason"); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs index 0fd3d5d65e3a5..68d8160db14e1 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs @@ -261,10 +261,8 @@ impl NoArgsAttributeParser for RustcDumpVariancesParser { Allow(Target::Struct), Allow(Target::Union), ]); - const STABILITY: AttributeStability = unstable!( - rustc_attrs, - "the `#[rustc_dump_variances]` attribute is used for rustc unit tests" - ); + const STABILITY: AttributeStability = + unstable!(rustc_attrs, "the `rustc_dump_variances` attribute is used for rustc unit tests"); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpVariances; } diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index e1c15becc4d53..b040b712b3ee9 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -24,7 +24,7 @@ impl NoArgsAttributeParser for RustcMainParser { const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Fn)]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_main]` attribute is used internally to specify test entry point function" + "the `rustc_main` attribute is used internally to specify test entry point function" ); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcMain; } @@ -36,7 +36,7 @@ impl SingleAttributeParser for RustcMustImplementOneOfParser { const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Trait)]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization" + "the `rustc_must_implement_one_of` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization" ); const TEMPLATE: AttributeTemplate = template!(List: &["function1, function2, ..."]); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { @@ -734,7 +734,7 @@ impl NoArgsAttributeParser for RustcNonConstTraitMethodParser { ]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "`#[rustc_non_const_trait_method]` should only used by the standard library to mark trait methods as non-const to allow large traits an easier transition to const" + "the `rustc_non_const_trait_method` attribute should only be used by the standard library to mark trait methods as non-const to allow large traits an easier transition to const" ); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNonConstTraitMethod; } @@ -1018,7 +1018,7 @@ impl SingleAttributeParser for RustcDiagnosticItemParser { const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name"); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_diagnostic_item]` attribute allows the compiler to reference types from the standard library for diagnostic purposes" + "the `rustc_diagnostic_item` attribute allows the compiler to reference types from the standard library for diagnostic purposes" ); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { @@ -1041,7 +1041,7 @@ impl NoArgsAttributeParser for RustcDoNotConstCheckParser { ]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "`#[rustc_do_not_const_check]` skips const-check for this function's body" + "the `rustc_do_not_const_check` attribute skips const-check for this function's body" ); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDoNotConstCheck; } @@ -1053,7 +1053,7 @@ impl NoArgsAttributeParser for RustcNonnullOptimizationGuaranteedParser { const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Struct)]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in the standard library", + "the `rustc_nonnull_optimization_guaranteed` attribute is just used to document guaranteed niche optimizations in the standard library", "the compiler does not even check whether the type indeed is being non-null-optimized; it is your responsibility to ensure that the attribute is only used on types that are optimized" ); const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNonnullOptimizationGuaranteed; @@ -1108,7 +1108,7 @@ impl SingleAttributeParser for RustcDocPrimitiveParser { const TEMPLATE: AttributeTemplate = template!(NameValueStr: "primitive name"); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_doc_primitive]` attribute is used by the standard library to provide a way to generate documentation for primitive types" + "the `rustc_doc_primitive` attribute is used by the standard library to provide a way to generate documentation for primitive types" ); fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option { @@ -1154,7 +1154,7 @@ impl NoArgsAttributeParser for RustcCanonicalSymbolParser { AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]); const STABILITY: AttributeStability = unstable!( rustc_attrs, - "the `#[rustc_canonical_symbol]` attribute registers a function's symbol to be linted against \ + "the `rustc_canonical_symbol` attribute registers a function's symbol to be linted against \ by the `invalid_runtime_symbol_definitions` and `suspicious_runtime_symbol_definitions` \ lints" ); diff --git a/compiler/rustc_attr_parsing/src/attributes/splat.rs b/compiler/rustc_attr_parsing/src/attributes/splat.rs index ab34021ad7cdf..c620f8ab569d8 100644 --- a/compiler/rustc_attr_parsing/src/attributes/splat.rs +++ b/compiler/rustc_attr_parsing/src/attributes/splat.rs @@ -10,7 +10,6 @@ pub(crate) struct SplatParser; impl NoArgsAttributeParser for SplatParser { const PATH: &[Symbol] = &[sym::splat]; const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Param)]); - const STABILITY: AttributeStability = - unstable!(splat, "the `#[splat]` attribute is experimental"); + const STABILITY: AttributeStability = unstable!(splat, "the `splat` attribute is experimental"); const CREATE: fn(Span) -> AttributeKind = AttributeKind::Splat; } diff --git a/compiler/rustc_attr_parsing/src/stability.rs b/compiler/rustc_attr_parsing/src/stability.rs index c4cb5acd2426e..5fe86a4a3e569 100644 --- a/compiler/rustc_attr_parsing/src/stability.rs +++ b/compiler/rustc_attr_parsing/src/stability.rs @@ -38,25 +38,25 @@ impl<'sess> AttributeParser<'sess> { let (explain, default_notes): (String, &[String]) = match gate_name { sym::rustc_attrs => ("use of an internal attribute".to_string(), &[ - format!("the `#[{attr_path}]` attribute is an internal implementation detail that will never be stable" + format!("the `{attr_path}` attribute is an internal implementation detail that will never be stable" )]), sym::staged_api => ("stability attributes may not be used outside of the standard library".to_string(), &[]), - sym::custom_mir => ("the `#[custom_mir]` attribute is just used for the Rust test suite".to_string(), &[]), - sym::allow_internal_unsafe => ("allow_internal_unsafe side-steps the unsafe_code lint".to_string(), &[]), - sym::allow_internal_unstable => ("allow_internal_unstable side-steps feature gating and stability checks".to_string(), &[]), - sym::compiler_builtins => ("the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate which contains compiler-rt intrinsics and will never be stable".to_string(), &[]), + sym::custom_mir => ("the `custom_mir` attribute is just used for the Rust test suite".to_string(), &[]), + sym::allow_internal_unsafe => ("the `allow_internal_unsafe` attribute side-steps the `unsafe_code` lint".to_string(), &[]), + sym::allow_internal_unstable => ("the `allow_internal_unstable` attribute side-steps feature gating and stability checks".to_string(), &[]), + sym::compiler_builtins => ("the `compiler_builtins` attribute is used to identify the `compiler_builtins` crate which contains compiler-rt intrinsics and will never be stable".to_string(), &[]), sym::custom_test_frameworks => ("custom test frameworks are an unstable feature".to_string(), &[]), sym::linkage => ("the `linkage` attribute is experimental and not portable across platforms".to_string(), &[]), - sym::dropck_eyepatch => ("`may_dangle` has unstable semantics and may be removed in the future".to_string(), &[]), - sym::intrinsics => ("the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items".to_string(), &[]), + sym::dropck_eyepatch => ("the `may_dangle` attribute has unstable semantics and may be removed in the future".to_string(), &[]), + sym::intrinsics => ("the `rustc_intrinsic` attribute is used to declare intrinsics as function items".to_string(), &[]), sym::lang_items => ("lang items are subject to change".to_string(), &[]), - sym::prelude_import => ("`#[prelude_import]` is for use by rustc only".to_string(), &[]), - sym::profiler_runtime => ("the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate which contains the profiler runtime and will never be stable".to_string(), &[]), - sym::thread_local => ("`#[thread_local]` is an experimental feature, and does not currently handle destructors".to_string(), &[]), - _ => (format!("the `#[{attr_path}]` attribute is an experimental feature"), &[]), + sym::prelude_import => ("the `prelude_import` attribute is for use by rustc only".to_string(), &[]), + sym::profiler_runtime => ("the `profiler_runtime` attribute is used to identify the `profiler_builtins` crate which contains the profiler runtime and will never be stable".to_string(), &[]), + sym::thread_local => ("the `thread_local` attribute is an experimental feature, and does not currently handle destructors".to_string(), &[]), + _ => (format!("the `{attr_path}` attribute is an experimental feature"), &[]), }; - let mut diag = feature_err(self.sess, gate_name, attr_span, explain); + let mut diag = feature_err(self.sess, gate_name, attr_path.span, explain); // Remove the suggestion for `#![feature(staged_api)]` as these attributes are currently // not usable outside std. If we do ever expose `#[stable]` etc under a different feature diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs index 084697f3a5d88..332ed63aadbee 100644 --- a/tests/ui/attributes/malformed-attrs.rs +++ b/tests/ui/attributes/malformed-attrs.rs @@ -217,7 +217,7 @@ extern crate wloop; //~^ ERROR malformed #[allow_internal_unsafe = 1] //~^ ERROR malformed -//~| ERROR allow_internal_unsafe side-steps the unsafe_code lint +//~| ERROR the `allow_internal_unsafe` attribute side-steps the `unsafe_code` lint macro_rules! slump { () => {} } diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 96012d8df936b..bae7f4f295d6c 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -819,11 +819,11 @@ LL - #[macro_export = 18] LL + #[macro_export] | -error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint - --> $DIR/malformed-attrs.rs:218:1 +error[E0658]: the `allow_internal_unsafe` attribute side-steps the `unsafe_code` lint + --> $DIR/malformed-attrs.rs:218:3 | LL | #[allow_internal_unsafe = 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(allow_internal_unsafe)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/attributes/malformed-never-type-options.stderr b/tests/ui/attributes/malformed-never-type-options.stderr index 98870c8bddedc..0bf7f5cdf093b 100644 --- a/tests/ui/attributes/malformed-never-type-options.stderr +++ b/tests/ui/attributes/malformed-never-type-options.stderr @@ -1,11 +1,11 @@ error[E0658]: use of an internal attribute - --> $DIR/malformed-never-type-options.rs:4:1 + --> $DIR/malformed-never-type-options.rs:4:4 | LL | #![rustc_never_type_options(: Unsize = "hi")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_never_type_options]` attribute is an internal implementation detail that will never be stable + = note: the `rustc_never_type_options` attribute is an internal implementation detail that will never be stable = note: `rustc_never_type_options` is used to experiment with never type fallback and work on never type stabilization error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `:` diff --git a/tests/ui/attributes/unstable_removed.stderr b/tests/ui/attributes/unstable_removed.stderr index 588122b9775d8..ead242615c9fe 100644 --- a/tests/ui/attributes/unstable_removed.stderr +++ b/tests/ui/attributes/unstable_removed.stderr @@ -1,14 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/unstable_removed.rs:9:1 + --> $DIR/unstable_removed.rs:9:4 | -LL | / #![unstable_removed( -LL | | -LL | | feature = "old_feature", -LL | | reason = "a good one", -LL | | link = "https://github.com/rust-lang/rust/issues/141617", -LL | | since="1.92.0" -LL | | )] - | |__^ +LL | #![unstable_removed( + | ^^^^^^^^^^^^^^^^ error[E0557]: feature `old_feature` has been removed --> $DIR/unstable_removed.rs:3:12 diff --git a/tests/ui/comptime/feature-gate-test.stderr b/tests/ui/comptime/feature-gate-test.stderr index 0230a28af41cc..b65965c777221 100644 --- a/tests/ui/comptime/feature-gate-test.stderr +++ b/tests/ui/comptime/feature-gate-test.stderr @@ -1,11 +1,11 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-test.rs:1:1 + --> $DIR/feature-gate-test.rs:1:3 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_comptime]` attribute is an internal implementation detail that will never be stable + = note: the `rustc_comptime` attribute is an internal implementation detail that will never be stable error: aborting due to 1 previous error diff --git a/tests/ui/conditional-compilation/cfg-attr-crate-2.rs b/tests/ui/conditional-compilation/cfg-attr-crate-2.rs index 4b7d1c4523498..f524f80f4ff19 100644 --- a/tests/ui/conditional-compilation/cfg-attr-crate-2.rs +++ b/tests/ui/conditional-compilation/cfg-attr-crate-2.rs @@ -3,6 +3,6 @@ //@ compile-flags: --cfg broken --check-cfg=cfg(broken) #![crate_type = "lib"] -#![cfg_attr(broken, no_core)] //~ ERROR the `#[no_core]` attribute is an experimental feature +#![cfg_attr(broken, no_core)] //~ ERROR the `no_core` attribute is an experimental feature pub struct S {} diff --git a/tests/ui/conditional-compilation/cfg-attr-crate-2.stderr b/tests/ui/conditional-compilation/cfg-attr-crate-2.stderr index 742764fe0efdd..03646181702a8 100644 --- a/tests/ui/conditional-compilation/cfg-attr-crate-2.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-crate-2.stderr @@ -1,4 +1,4 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature +error[E0658]: the `no_core` attribute is an experimental feature --> $DIR/cfg-attr-crate-2.rs:6:21 | LL | #![cfg_attr(broken, no_core)] diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs index d881634abc347..3ee85326dab2d 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs +++ b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs @@ -2,6 +2,6 @@ #![crate_type = "lib"] #![cfg_attr(broken, no_core, no_std)] -//~^ ERROR the `#[no_core]` attribute is an experimental feature +//~^ ERROR the `no_core` attribute is an experimental feature pub struct S {} diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr index 7827552096c1f..0c4dccd52fa1b 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr @@ -1,4 +1,4 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature +error[E0658]: the `no_core` attribute is an experimental feature --> $DIR/cfg-attr-multi-invalid-1.rs:4:21 | LL | #![cfg_attr(broken, no_core, no_std)] diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs index 6cac52983b53b..5a6081bd14883 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs +++ b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs @@ -2,6 +2,6 @@ #![crate_type = "lib"] #![cfg_attr(broken, no_std, no_core)] -//~^ ERROR the `#[no_core]` attribute is an experimental feature +//~^ ERROR the `no_core` attribute is an experimental feature pub struct S {} diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr index d8768c3f31038..784304a366c2c 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr @@ -1,4 +1,4 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature +error[E0658]: the `no_core` attribute is an experimental feature --> $DIR/cfg-attr-multi-invalid-2.rs:4:29 | LL | #![cfg_attr(broken, no_std, no_core)] diff --git a/tests/ui/consts/gate-do-not-const-check.rs b/tests/ui/consts/gate-do-not-const-check.rs index 0ebb1e7c82e2b..e0247dc19e797 100644 --- a/tests/ui/consts/gate-do-not-const-check.rs +++ b/tests/ui/consts/gate-do-not-const-check.rs @@ -1,7 +1,7 @@ #[rustc_do_not_const_check] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_do_not_const_check]` attribute is an internal implementation detail that will never be stable -//~| NOTE `#[rustc_do_not_const_check]` skips const-check for this function's body +//~| NOTE the `rustc_do_not_const_check` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_do_not_const_check` attribute skips const-check for this function's body const fn foo() {} fn main() {} diff --git a/tests/ui/consts/gate-do-not-const-check.stderr b/tests/ui/consts/gate-do-not-const-check.stderr index 778ee50e71b6d..b9f223d4b4a7c 100644 --- a/tests/ui/consts/gate-do-not-const-check.stderr +++ b/tests/ui/consts/gate-do-not-const-check.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/gate-do-not-const-check.rs:1:1 + --> $DIR/gate-do-not-const-check.rs:1:3 | LL | #[rustc_do_not_const_check] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_do_not_const_check]` attribute is an internal implementation detail that will never be stable - = note: `#[rustc_do_not_const_check]` skips const-check for this function's body + = note: the `rustc_do_not_const_check` attribute is an internal implementation detail that will never be stable + = note: the `rustc_do_not_const_check` attribute skips const-check for this function's body error: aborting due to 1 previous error diff --git a/tests/ui/coroutine/gen_block.e2024.stderr b/tests/ui/coroutine/gen_block.e2024.stderr index 9590c143aa0d8..385e15f9e3903 100644 --- a/tests/ui/coroutine/gen_block.e2024.stderr +++ b/tests/ui/coroutine/gen_block.e2024.stderr @@ -9,21 +9,21 @@ help: use `#[coroutine]` to make this closure a coroutine LL | let _ = #[coroutine] || yield true; | ++++++++++++ -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:20:13 +error[E0658]: the `coroutine` attribute is an experimental feature + --> $DIR/gen_block.rs:20:15 | LL | let _ = #[coroutine] || yield true; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: see issue #43122 for more information = help: add `#![feature(coroutines)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:24:13 +error[E0658]: the `coroutine` attribute is an experimental feature + --> $DIR/gen_block.rs:24:15 | LL | let _ = #[coroutine] || {}; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: see issue #43122 for more information = help: add `#![feature(coroutines)]` to the crate attributes to enable diff --git a/tests/ui/coroutine/gen_block.none.stderr b/tests/ui/coroutine/gen_block.none.stderr index 2e8962ec066aa..96e4084d13046 100644 --- a/tests/ui/coroutine/gen_block.none.stderr +++ b/tests/ui/coroutine/gen_block.none.stderr @@ -65,11 +65,11 @@ help: use `#[coroutine]` to make this closure a coroutine LL | let _ = #[coroutine] || yield true; | ++++++++++++ -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:20:13 +error[E0658]: the `coroutine` attribute is an experimental feature + --> $DIR/gen_block.rs:20:15 | LL | let _ = #[coroutine] || yield true; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: see issue #43122 for more information = help: add `#![feature(coroutines)]` to the crate attributes to enable @@ -85,11 +85,11 @@ LL | let _ = #[coroutine] || yield true; = help: add `#![feature(yield_expr)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:24:13 +error[E0658]: the `coroutine` attribute is an experimental feature + --> $DIR/gen_block.rs:24:15 | LL | let _ = #[coroutine] || {}; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: see issue #43122 for more information = help: add `#![feature(coroutines)]` to the crate attributes to enable diff --git a/tests/ui/coroutine/gen_block.rs b/tests/ui/coroutine/gen_block.rs index e3734dd4cdf05..4e69e523fd268 100644 --- a/tests/ui/coroutine/gen_block.rs +++ b/tests/ui/coroutine/gen_block.rs @@ -18,9 +18,9 @@ fn main() { //~^^ ERROR `yield` can only be used in let _ = #[coroutine] || yield true; //[none]~ ERROR yield syntax is experimental - //~^ ERROR `#[coroutine]` attribute is an experimental feature + //~^ ERROR the `coroutine` attribute is an experimental feature //[none]~^^ ERROR yield syntax is experimental let _ = #[coroutine] || {}; - //~^ ERROR `#[coroutine]` attribute is an experimental feature + //~^ ERROR the `coroutine` attribute is an experimental feature } diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr index 7feef95a7930e..8a99e0f4fc63c 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[coverage]` attribute is an experimental feature - --> $DIR/bad-attr-ice.rs:11:1 +error[E0658]: the `coverage` attribute is an experimental feature + --> $DIR/bad-attr-ice.rs:11:3 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #84605 for more information = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable diff --git a/tests/ui/coverage-attr/bad-attr-ice.rs b/tests/ui/coverage-attr/bad-attr-ice.rs index aeb44075bb6b8..2626f47037dbd 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.rs +++ b/tests/ui/coverage-attr/bad-attr-ice.rs @@ -4,14 +4,14 @@ //@ needs-profiler-runtime //@ reference: attributes.coverage.syntax -// Malformed `#[coverage(..)]` attributes should not cause an ICE when built +// Malformed `coverage` attributes should not cause an ICE when built // with `-Cinstrument-coverage`. // Regression test for . #[coverage] //~^ ERROR malformed `coverage` attribute input -//[nofeat]~| ERROR the `#[coverage]` attribute is an experimental feature +//[nofeat]~| ERROR the `coverage` attribute is an experimental feature fn main() {} -// FIXME(#130766): When the `#[coverage(..)]` attribute is stabilized, +// FIXME(#130766): When the `coverage` attribute is stabilized, // get rid of the revisions and just make this a normal test. diff --git a/tests/ui/feature-gates/feature-gate-allocator_internals.stderr b/tests/ui/feature-gates/feature-gate-allocator_internals.stderr index 905c0252484bf..a2d8112730219 100644 --- a/tests/ui/feature-gates/feature-gate-allocator_internals.stderr +++ b/tests/ui/feature-gates/feature-gate-allocator_internals.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[default_lib_allocator]` attribute is an experimental feature - --> $DIR/feature-gate-allocator_internals.rs:1:1 +error[E0658]: the `default_lib_allocator` attribute is an experimental feature + --> $DIR/feature-gate-allocator_internals.rs:1:4 | LL | #![default_lib_allocator] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(allocator_internals)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs b/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs index 9f604aafdf87d..eb77f860c85bc 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs @@ -5,7 +5,7 @@ macro_rules! bar { () => { // more layers don't help: - #[allow_internal_unsafe] //~ ERROR allow_internal_unsafe side-steps + #[allow_internal_unsafe] //~ ERROR the `allow_internal_unsafe` attribute side-steps macro_rules! baz { () => {} } diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr b/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr index 7a0dcb0843590..ef50447434a5a 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr @@ -1,8 +1,8 @@ -error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint - --> $DIR/feature-gate-allow-internal-unsafe-nested-macro.rs:8:9 +error[E0658]: the `allow_internal_unsafe` attribute side-steps the `unsafe_code` lint + --> $DIR/feature-gate-allow-internal-unsafe-nested-macro.rs:8:11 | LL | #[allow_internal_unsafe] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ ... LL | bar!(); | ------ in this macro invocation diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs index ee48f9516299a..dc64b062ea915 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs @@ -5,7 +5,7 @@ macro_rules! bar { () => { // more layers don't help: - #[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps + #[allow_internal_unstable()] //~ ERROR the `allow_internal_unstable` attribute side-steps macro_rules! baz { () => {} } diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr index 4aacfebd6b1fa..823589c443334 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr @@ -1,8 +1,8 @@ -error[E0658]: allow_internal_unstable side-steps feature gating and stability checks - --> $DIR/feature-gate-allow-internal-unstable-nested-macro.rs:8:9 +error[E0658]: the `allow_internal_unstable` attribute side-steps feature gating and stability checks + --> $DIR/feature-gate-allow-internal-unstable-nested-macro.rs:8:11 | LL | #[allow_internal_unstable()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ ... LL | bar!(); | ------ in this macro invocation diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs index 91caba81cb6b8..1de09d7410c0a 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs @@ -3,7 +3,7 @@ // FIXME(jdonszelmann): empty attributes are currently ignored, since when its empty no actual // change is applied. This should be fixed when later moving this check to attribute parsing. -#[allow_internal_unstable(something)] //~ ERROR allow_internal_unstable side-steps +#[allow_internal_unstable(something)] //~ ERROR the `allow_internal_unstable` attribute side-steps //~| ERROR attribute cannot be used on struct S; diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr index d68affa955aa8..8a446d455a5b5 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr @@ -1,8 +1,8 @@ -error[E0658]: allow_internal_unstable side-steps feature gating and stability checks - --> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1 +error[E0658]: the `allow_internal_unstable` attribute side-steps feature gating and stability checks + --> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:3 | LL | #[allow_internal_unstable(something)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable.rs b/tests/ui/feature-gates/feature-gate-allow-internal-unstable.rs index 0a1b6acd9bff2..c5dc2aa832d15 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable.rs +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable.rs @@ -1,6 +1,6 @@ #![allow(unused_macros)] -#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps +#[allow_internal_unstable()] //~ ERROR the `allow_internal_unstable` attribute side-steps macro_rules! foo { () => {} } diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable.stderr b/tests/ui/feature-gates/feature-gate-allow-internal-unstable.stderr index 3e3ecc1e5bab1..dc824508c2dc6 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable.stderr +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable.stderr @@ -1,8 +1,8 @@ -error[E0658]: allow_internal_unstable side-steps feature gating and stability checks - --> $DIR/feature-gate-allow-internal-unstable.rs:3:1 +error[E0658]: the `allow_internal_unstable` attribute side-steps feature gating and stability checks + --> $DIR/feature-gate-allow-internal-unstable.rs:3:3 | LL | #[allow_internal_unstable()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-cfi_encoding.rs b/tests/ui/feature-gates/feature-gate-cfi_encoding.rs index b6312dd7817f9..7ebf0a1513b4c 100644 --- a/tests/ui/feature-gates/feature-gate-cfi_encoding.rs +++ b/tests/ui/feature-gates/feature-gate-cfi_encoding.rs @@ -1,4 +1,4 @@ #![crate_type = "lib"] -#[cfi_encoding = "3Bar"] //~ ERROR the `#[cfi_encoding]` attribute is an experimental feature [E0658] +#[cfi_encoding = "3Bar"] //~ ERROR the `cfi_encoding` attribute is an experimental feature [E0658] pub struct Foo(i32); diff --git a/tests/ui/feature-gates/feature-gate-cfi_encoding.stderr b/tests/ui/feature-gates/feature-gate-cfi_encoding.stderr index ae5efc0275f21..9ca065f505279 100644 --- a/tests/ui/feature-gates/feature-gate-cfi_encoding.stderr +++ b/tests/ui/feature-gates/feature-gate-cfi_encoding.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[cfi_encoding]` attribute is an experimental feature - --> $DIR/feature-gate-cfi_encoding.rs:3:1 +error[E0658]: the `cfi_encoding` attribute is an experimental feature + --> $DIR/feature-gate-cfi_encoding.rs:3:3 | LL | #[cfi_encoding = "3Bar"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | = note: see issue #89653 for more information = help: add `#![feature(cfi_encoding)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs index c81d2e538c7f3..66a038c4ad90f 100644 --- a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs +++ b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs @@ -6,7 +6,7 @@ macro_rules! bar ( macro_rules! foo ( () => ( #[allow_internal_unstable()] - //~^ ERROR allow_internal_unstable side-steps + //~^ ERROR the `allow_internal_unstable` attribute side-steps //~| ERROR `#[allow_internal_unstable]` attribute cannot be used on macro calls bar!(); ); diff --git a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr index 6d69fdfa229ee..aa8e105d0e36f 100644 --- a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr +++ b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr @@ -1,8 +1,8 @@ -error[E0658]: allow_internal_unstable side-steps feature gating and stability checks - --> $DIR/feature-gate-check-nested-macro-invocation.rs:8:9 +error[E0658]: the `allow_internal_unstable` attribute side-steps feature gating and stability checks + --> $DIR/feature-gate-check-nested-macro-invocation.rs:8:11 | LL | #[allow_internal_unstable()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ ... LL | foo!(); | ------ in this macro invocation diff --git a/tests/ui/feature-gates/feature-gate-compiler-builtins.rs b/tests/ui/feature-gates/feature-gate-compiler-builtins.rs index 0d64f1fdcf55e..619ba9e7e6b1a 100644 --- a/tests/ui/feature-gates/feature-gate-compiler-builtins.rs +++ b/tests/ui/feature-gates/feature-gate-compiler-builtins.rs @@ -1,3 +1,3 @@ -#![compiler_builtins] //~ ERROR the `#[compiler_builtins]` attribute is +#![compiler_builtins] //~ ERROR the `compiler_builtins` attribute is fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-compiler-builtins.stderr b/tests/ui/feature-gates/feature-gate-compiler-builtins.stderr index 65137a442b043..9003fe582448c 100644 --- a/tests/ui/feature-gates/feature-gate-compiler-builtins.stderr +++ b/tests/ui/feature-gates/feature-gate-compiler-builtins.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate which contains compiler-rt intrinsics and will never be stable - --> $DIR/feature-gate-compiler-builtins.rs:1:1 +error[E0658]: the `compiler_builtins` attribute is used to identify the `compiler_builtins` crate which contains compiler-rt intrinsics and will never be stable + --> $DIR/feature-gate-compiler-builtins.rs:1:4 | LL | #![compiler_builtins] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | = help: add `#![feature(compiler_builtins)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.rs b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs index 0a463755f1373..d7de509281101 100644 --- a/tests/ui/feature-gates/feature-gate-coverage-attribute.rs +++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.rs @@ -7,7 +7,7 @@ struct Foo { b: u32, } -#[coverage(off)] //~ ERROR the `#[coverage]` attribute is an experimental feature +#[coverage(off)] //~ ERROR the `coverage` attribute is an experimental feature fn requires_feature_coverage() -> bool { let bar = Foo { a: 0, b: 0 }; bar == Foo { a: 0, b: 0 } diff --git a/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr index 68d0d9bc3c31e..2115131078751 100644 --- a/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr +++ b/tests/ui/feature-gates/feature-gate-coverage-attribute.stderr @@ -7,11 +7,11 @@ LL | #![feature(no_coverage)] = note: removed in 1.74.0; see for more information = note: renamed to `coverage_attribute` -error[E0658]: the `#[coverage]` attribute is an experimental feature - --> $DIR/feature-gate-coverage-attribute.rs:10:1 +error[E0658]: the `coverage` attribute is an experimental feature + --> $DIR/feature-gate-coverage-attribute.rs:10:3 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #84605 for more information = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-custom_mir.rs b/tests/ui/feature-gates/feature-gate-custom_mir.rs index 4d713c524b335..eea8850216a3f 100644 --- a/tests/ui/feature-gates/feature-gate-custom_mir.rs +++ b/tests/ui/feature-gates/feature-gate-custom_mir.rs @@ -3,7 +3,7 @@ extern crate core; use core::intrinsics::mir::*; //~ ERROR custom_mir -#[custom_mir(dialect = "built")] //~ ERROR the `#[custom_mir]` attribute is just used for the Rust test suite +#[custom_mir(dialect = "built")] //~ ERROR the `custom_mir` attribute is just used for the Rust test suite pub fn foo(_x: i32) -> i32 { mir! { { diff --git a/tests/ui/feature-gates/feature-gate-custom_mir.stderr b/tests/ui/feature-gates/feature-gate-custom_mir.stderr index eeceb0355ee7b..cac2a7600ede7 100644 --- a/tests/ui/feature-gates/feature-gate-custom_mir.stderr +++ b/tests/ui/feature-gates/feature-gate-custom_mir.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[custom_mir]` attribute is just used for the Rust test suite - --> $DIR/feature-gate-custom_mir.rs:6:1 +error[E0658]: the `custom_mir` attribute is just used for the Rust test suite + --> $DIR/feature-gate-custom_mir.rs:6:3 | LL | #[custom_mir(dialect = "built")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = help: add `#![feature(custom_mir)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-custom_test_frameworks.stderr b/tests/ui/feature-gates/feature-gate-custom_test_frameworks.stderr index 3e60d33829fc5..8eff46892f4e4 100644 --- a/tests/ui/feature-gates/feature-gate-custom_test_frameworks.stderr +++ b/tests/ui/feature-gates/feature-gate-custom_test_frameworks.stderr @@ -9,20 +9,20 @@ LL | #[test_case] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: custom test frameworks are an unstable feature - --> $DIR/feature-gate-custom_test_frameworks.rs:1:1 + --> $DIR/feature-gate-custom_test_frameworks.rs:1:4 | LL | #![test_runner(main)] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = note: see issue #50297 for more information = help: add `#![feature(custom_test_frameworks)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: custom test frameworks are an unstable feature - --> $DIR/feature-gate-custom_test_frameworks.rs:2:1 + --> $DIR/feature-gate-custom_test_frameworks.rs:2:4 | LL | #![reexport_test_harness_main = "foo"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #50297 for more information = help: add `#![feature(custom_test_frameworks)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-effective-target-features.default.stderr b/tests/ui/feature-gates/feature-gate-effective-target-features.default.stderr index e699c5d77b42c..cb829beb054ec 100644 --- a/tests/ui/feature-gates/feature-gate-effective-target-features.default.stderr +++ b/tests/ui/feature-gates/feature-gate-effective-target-features.default.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[force_target_feature]` attribute is an experimental feature - --> $DIR/feature-gate-effective-target-features.rs:14:5 +error[E0658]: the `force_target_feature` attribute is an experimental feature + --> $DIR/feature-gate-effective-target-features.rs:14:14 | LL | #[unsafe(force_target_feature(enable = "avx2"))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #143352 for more information = help: add `#![feature(effective_target_features)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-effective-target-features.rs b/tests/ui/feature-gates/feature-gate-effective-target-features.rs index a8be61167aa2f..71cab611ec6a6 100644 --- a/tests/ui/feature-gates/feature-gate-effective-target-features.rs +++ b/tests/ui/feature-gates/feature-gate-effective-target-features.rs @@ -12,7 +12,7 @@ struct Bar; impl Foo for Bar { #[unsafe(force_target_feature(enable = "avx2"))] - //[default]~^ ERROR the `#[force_target_feature]` attribute is an experimental feature + //[default]~^ ERROR the `force_target_feature` attribute is an experimental feature fn foo(&self) {} } diff --git a/tests/ui/feature-gates/feature-gate-export_stable.rs b/tests/ui/feature-gates/feature-gate-export_stable.rs index 5d05fee059b82..325f43256e5bb 100644 --- a/tests/ui/feature-gates/feature-gate-export_stable.rs +++ b/tests/ui/feature-gates/feature-gate-export_stable.rs @@ -1,5 +1,5 @@ #![crate_type="lib"] #[export_stable] -//~^ ERROR the `#[export_stable]` attribute is an experimental feature +//~^ ERROR the `export_stable` attribute is an experimental feature pub mod a {} diff --git a/tests/ui/feature-gates/feature-gate-export_stable.stderr b/tests/ui/feature-gates/feature-gate-export_stable.stderr index 6beb52a77e5cc..ab77b5f58b01b 100644 --- a/tests/ui/feature-gates/feature-gate-export_stable.stderr +++ b/tests/ui/feature-gates/feature-gate-export_stable.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[export_stable]` attribute is an experimental feature - --> $DIR/feature-gate-export_stable.rs:3:1 +error[E0658]: the `export_stable` attribute is an experimental feature + --> $DIR/feature-gate-export_stable.rs:3:3 | LL | #[export_stable] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: see issue #139939 for more information = help: add `#![feature(export_stable)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-ffi_const.rs b/tests/ui/feature-gates/feature-gate-ffi_const.rs index 35f91b99a6f40..5593211eab1c1 100644 --- a/tests/ui/feature-gates/feature-gate-ffi_const.rs +++ b/tests/ui/feature-gates/feature-gate-ffi_const.rs @@ -1,6 +1,6 @@ #![crate_type = "lib"] extern "C" { - #[unsafe(ffi_const)] //~ ERROR the `#[ffi_const]` attribute is an experimental feature + #[unsafe(ffi_const)] //~ ERROR the `ffi_const` attribute is an experimental feature pub fn foo(); } diff --git a/tests/ui/feature-gates/feature-gate-ffi_const.stderr b/tests/ui/feature-gates/feature-gate-ffi_const.stderr index 7e8c941be07de..f93b23a487158 100644 --- a/tests/ui/feature-gates/feature-gate-ffi_const.stderr +++ b/tests/ui/feature-gates/feature-gate-ffi_const.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[ffi_const]` attribute is an experimental feature - --> $DIR/feature-gate-ffi_const.rs:4:5 +error[E0658]: the `ffi_const` attribute is an experimental feature + --> $DIR/feature-gate-ffi_const.rs:4:14 | LL | #[unsafe(ffi_const)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: see issue #58328 for more information = help: add `#![feature(ffi_const)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-ffi_pure.rs b/tests/ui/feature-gates/feature-gate-ffi_pure.rs index 0f1288b234e43..91002c1c51247 100644 --- a/tests/ui/feature-gates/feature-gate-ffi_pure.rs +++ b/tests/ui/feature-gates/feature-gate-ffi_pure.rs @@ -1,6 +1,6 @@ #![crate_type = "lib"] extern "C" { - #[unsafe(ffi_pure)] //~ ERROR the `#[ffi_pure]` attribute is an experimental feature + #[unsafe(ffi_pure)] //~ ERROR the `ffi_pure` attribute is an experimental feature pub fn foo(); } diff --git a/tests/ui/feature-gates/feature-gate-ffi_pure.stderr b/tests/ui/feature-gates/feature-gate-ffi_pure.stderr index cf923536d6c55..8eb64070249a2 100644 --- a/tests/ui/feature-gates/feature-gate-ffi_pure.stderr +++ b/tests/ui/feature-gates/feature-gate-ffi_pure.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[ffi_pure]` attribute is an experimental feature - --> $DIR/feature-gate-ffi_pure.rs:4:5 +error[E0658]: the `ffi_pure` attribute is an experimental feature + --> $DIR/feature-gate-ffi_pure.rs:4:14 | LL | #[unsafe(ffi_pure)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #58329 for more information = help: add `#![feature(ffi_pure)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-fn_align.rs b/tests/ui/feature-gates/feature-gate-fn_align.rs index 36e17c4a8dd15..c7226b46ae2ab 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.rs +++ b/tests/ui/feature-gates/feature-gate-fn_align.rs @@ -5,12 +5,12 @@ // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity #[rustc_align(16)] -//~^ ERROR the `#[rustc_align]` attribute is an experimental feature +//~^ ERROR the `rustc_align` attribute is an experimental feature fn requires_alignment() {} trait MyTrait { #[rustc_align] - //~^ ERROR the `#[rustc_align]` attribute is an experimental feature + //~^ ERROR the `rustc_align` attribute is an experimental feature //~| ERROR malformed `rustc_align` attribute input fn myfun(); } diff --git a/tests/ui/feature-gates/feature-gate-fn_align.stderr b/tests/ui/feature-gates/feature-gate-fn_align.stderr index 2497915117413..bd3540a70039d 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.stderr +++ b/tests/ui/feature-gates/feature-gate-fn_align.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[rustc_align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:7:1 +error[E0658]: the `rustc_align` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:7:3 | LL | #[rustc_align(16)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = note: see issue #82232 for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[rustc_align]` attribute is an experimental feature - --> $DIR/feature-gate-fn_align.rs:12:5 +error[E0658]: the `rustc_align` attribute is an experimental feature + --> $DIR/feature-gate-fn_align.rs:12:7 | LL | #[rustc_align] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = note: see issue #82232 for more information = help: add `#![feature(fn_align)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-fundamental.rs b/tests/ui/feature-gates/feature-gate-fundamental.rs index 70e0133929c62..5298f65218345 100644 --- a/tests/ui/feature-gates/feature-gate-fundamental.rs +++ b/tests/ui/feature-gates/feature-gate-fundamental.rs @@ -1,4 +1,4 @@ -#[fundamental] //~ ERROR the `#[fundamental]` attribute is an experimental feature +#[fundamental] //~ ERROR the `fundamental` attribute is an experimental feature struct Fundamental; fn main() { } diff --git a/tests/ui/feature-gates/feature-gate-fundamental.stderr b/tests/ui/feature-gates/feature-gate-fundamental.stderr index 61b30dfb29cd8..0857c22b12c96 100644 --- a/tests/ui/feature-gates/feature-gate-fundamental.stderr +++ b/tests/ui/feature-gates/feature-gate-fundamental.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[fundamental]` attribute is an experimental feature - --> $DIR/feature-gate-fundamental.rs:1:1 +error[E0658]: the `fundamental` attribute is an experimental feature + --> $DIR/feature-gate-fundamental.rs:1:3 | LL | #[fundamental] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = note: see issue #29635 for more information = help: add `#![feature(fundamental)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-instrument-fn.stderr b/tests/ui/feature-gates/feature-gate-instrument-fn.stderr index 71326b17eae18..98e96902b86c4 100644 --- a/tests/ui/feature-gates/feature-gate-instrument-fn.stderr +++ b/tests/ui/feature-gates/feature-gate-instrument-fn.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[instrument_fn]` attribute is an experimental feature - --> $DIR/feature-gate-instrument-fn.rs:9:1 +error[E0658]: the `instrument_fn` attribute is an experimental feature + --> $DIR/feature-gate-instrument-fn.rs:9:3 | LL | #[instrument_fn = "on"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: see issue #157081 for more information = help: add `#![feature(instrument_fn)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[instrument_fn]` attribute is an experimental feature - --> $DIR/feature-gate-instrument-fn.rs:12:1 +error[E0658]: the `instrument_fn` attribute is an experimental feature + --> $DIR/feature-gate-instrument-fn.rs:12:3 | LL | #[instrument_fn = "off"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: see issue #157081 for more information = help: add `#![feature(instrument_fn)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-intrinsics.rs b/tests/ui/feature-gates/feature-gate-intrinsics.rs index b7ebba672728d..d352d75702b22 100644 --- a/tests/ui/feature-gates/feature-gate-intrinsics.rs +++ b/tests/ui/feature-gates/feature-gate-intrinsics.rs @@ -1,5 +1,5 @@ #[rustc_intrinsic] -//~^ ERROR the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items +//~^ ERROR the `rustc_intrinsic` attribute is used to declare intrinsics as function items fn bar(); fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-intrinsics.stderr b/tests/ui/feature-gates/feature-gate-intrinsics.stderr index a7a725883a928..380777f9dc7db 100644 --- a/tests/ui/feature-gates/feature-gate-intrinsics.stderr +++ b/tests/ui/feature-gates/feature-gate-intrinsics.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items - --> $DIR/feature-gate-intrinsics.rs:1:1 +error[E0658]: the `rustc_intrinsic` attribute is used to declare intrinsics as function items + --> $DIR/feature-gate-intrinsics.rs:1:3 | LL | #[rustc_intrinsic] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: add `#![feature(intrinsics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-lang-items.stderr b/tests/ui/feature-gates/feature-gate-lang-items.stderr index c5caffbdc94dd..0003ed209eb0a 100644 --- a/tests/ui/feature-gates/feature-gate-lang-items.stderr +++ b/tests/ui/feature-gates/feature-gate-lang-items.stderr @@ -1,8 +1,8 @@ error[E0658]: lang items are subject to change - --> $DIR/feature-gate-lang-items.rs:1:1 + --> $DIR/feature-gate-lang-items.rs:1:3 | LL | #[lang = "foo"] - | ^^^^^^^^^^^^^^^ + | ^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-large-assignments.rs b/tests/ui/feature-gates/feature-gate-large-assignments.rs index c4125c557223e..3c284ca3cafbd 100644 --- a/tests/ui/feature-gates/feature-gate-large-assignments.rs +++ b/tests/ui/feature-gates/feature-gate-large-assignments.rs @@ -1,5 +1,5 @@ // check that `move_size_limit` is feature-gated -#![move_size_limit = "42"] //~ ERROR the `#[move_size_limit]` attribute is an experimental feature +#![move_size_limit = "42"] //~ ERROR the `move_size_limit` attribute is an experimental feature fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-large-assignments.stderr b/tests/ui/feature-gates/feature-gate-large-assignments.stderr index 7b0b4470c4e1e..350afcc0d63ad 100644 --- a/tests/ui/feature-gates/feature-gate-large-assignments.stderr +++ b/tests/ui/feature-gates/feature-gate-large-assignments.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[move_size_limit]` attribute is an experimental feature - --> $DIR/feature-gate-large-assignments.rs:3:1 +error[E0658]: the `move_size_limit` attribute is an experimental feature + --> $DIR/feature-gate-large-assignments.rs:3:4 | LL | #![move_size_limit = "42"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = note: see issue #83518 for more information = help: add `#![feature(large_assignments)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-linkage.stderr b/tests/ui/feature-gates/feature-gate-linkage.stderr index 2044b8a3c2470..04ecc87eff11b 100644 --- a/tests/ui/feature-gates/feature-gate-linkage.stderr +++ b/tests/ui/feature-gates/feature-gate-linkage.stderr @@ -1,8 +1,8 @@ error[E0658]: the `linkage` attribute is experimental and not portable across platforms - --> $DIR/feature-gate-linkage.rs:2:5 + --> $DIR/feature-gate-linkage.rs:2:7 | LL | #[linkage = "extern_weak"] static foo: *mut isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: see issue #29603 for more information = help: add `#![feature(linkage)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-loop-hints.rs b/tests/ui/feature-gates/feature-gate-loop-hints.rs index afb8b7d74af9d..85a1f10ab0a63 100644 --- a/tests/ui/feature-gates/feature-gate-loop-hints.rs +++ b/tests/ui/feature-gates/feature-gate-loop-hints.rs @@ -1,4 +1,4 @@ fn main() { - #[unroll] //~ ERROR the `#[unroll]` attribute is an experimental feature + #[unroll] //~ ERROR the `unroll` attribute is an experimental feature for _ in 0..10 {} } diff --git a/tests/ui/feature-gates/feature-gate-loop-hints.stderr b/tests/ui/feature-gates/feature-gate-loop-hints.stderr index df18fbafdd50c..98279fe144126 100644 --- a/tests/ui/feature-gates/feature-gate-loop-hints.stderr +++ b/tests/ui/feature-gates/feature-gate-loop-hints.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[unroll]` attribute is an experimental feature - --> $DIR/feature-gate-loop-hints.rs:2:5 +error[E0658]: the `unroll` attribute is an experimental feature + --> $DIR/feature-gate-loop-hints.rs:2:7 | LL | #[unroll] - | ^^^^^^^^^ + | ^^^^^^ | = note: see issue #156874 for more information = help: add `#![feature(loop_hints)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-loop-match.rs b/tests/ui/feature-gates/feature-gate-loop-match.rs index 399b20234f32e..d3b5956b452f0 100644 --- a/tests/ui/feature-gates/feature-gate-loop-match.rs +++ b/tests/ui/feature-gates/feature-gate-loop-match.rs @@ -9,18 +9,18 @@ enum State { fn main() { let mut state = State::A; - #[loop_match] //~ ERROR the `#[loop_match]` attribute is an experimental feature + #[loop_match] //~ ERROR the `loop_match` attribute is an experimental feature 'a: loop { state = 'blk: { match state { State::A => { #[const_continue] - //~^ ERROR the `#[const_continue]` attribute is an experimental feature + //~^ ERROR the `const_continue` attribute is an experimental feature break 'blk State::B; } State::B => { #[const_continue] - //~^ ERROR the `#[const_continue]` attribute is an experimental feature + //~^ ERROR the `const_continue` attribute is an experimental feature break 'blk State::C; } State::C => break 'a, diff --git a/tests/ui/feature-gates/feature-gate-loop-match.stderr b/tests/ui/feature-gates/feature-gate-loop-match.stderr index 9b12047cf4dde..8552618346b04 100644 --- a/tests/ui/feature-gates/feature-gate-loop-match.stderr +++ b/tests/ui/feature-gates/feature-gate-loop-match.stderr @@ -1,28 +1,28 @@ -error[E0658]: the `#[loop_match]` attribute is an experimental feature - --> $DIR/feature-gate-loop-match.rs:12:5 +error[E0658]: the `loop_match` attribute is an experimental feature + --> $DIR/feature-gate-loop-match.rs:12:7 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: see issue #132306 for more information = help: add `#![feature(loop_match)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[const_continue]` attribute is an experimental feature - --> $DIR/feature-gate-loop-match.rs:17:21 +error[E0658]: the `const_continue` attribute is an experimental feature + --> $DIR/feature-gate-loop-match.rs:17:23 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | = note: see issue #132306 for more information = help: add `#![feature(loop_match)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[const_continue]` attribute is an experimental feature - --> $DIR/feature-gate-loop-match.rs:22:21 +error[E0658]: the `const_continue` attribute is an experimental feature + --> $DIR/feature-gate-loop-match.rs:22:23 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | = note: see issue #132306 for more information = help: add `#![feature(loop_match)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-marker_trait_attr.rs b/tests/ui/feature-gates/feature-gate-marker_trait_attr.rs index 5050c4792b064..15b5a52cd3844 100644 --- a/tests/ui/feature-gates/feature-gate-marker_trait_attr.rs +++ b/tests/ui/feature-gates/feature-gate-marker_trait_attr.rs @@ -1,7 +1,7 @@ use std::fmt::{Debug, Display}; #[marker] trait ExplicitMarker {} -//~^ ERROR the `#[marker]` attribute is an experimental feature +//~^ ERROR the `marker` attribute is an experimental feature impl ExplicitMarker for T {} impl ExplicitMarker for T {} diff --git a/tests/ui/feature-gates/feature-gate-marker_trait_attr.stderr b/tests/ui/feature-gates/feature-gate-marker_trait_attr.stderr index 15888a38589cb..bea83308c6e87 100644 --- a/tests/ui/feature-gates/feature-gate-marker_trait_attr.stderr +++ b/tests/ui/feature-gates/feature-gate-marker_trait_attr.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[marker]` attribute is an experimental feature - --> $DIR/feature-gate-marker_trait_attr.rs:3:1 +error[E0658]: the `marker` attribute is an experimental feature + --> $DIR/feature-gate-marker_trait_attr.rs:3:3 | LL | #[marker] trait ExplicitMarker {} - | ^^^^^^^^^ + | ^^^^^^ | = note: see issue #29864 for more information = help: add `#![feature(marker_trait_attr)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-may-dangle.rs b/tests/ui/feature-gates/feature-gate-may-dangle.rs index 23db92c15df65..5a5cb46444c7c 100644 --- a/tests/ui/feature-gates/feature-gate-may-dangle.rs +++ b/tests/ui/feature-gates/feature-gate-may-dangle.rs @@ -4,7 +4,7 @@ struct Pt(A); unsafe impl<#[may_dangle] A> Drop for Pt { - //~^ ERROR `may_dangle` has unstable semantics and may be removed in the future + //~^ ERROR the `may_dangle` attribute has unstable semantics and may be removed in the future fn drop(&mut self) { } } diff --git a/tests/ui/feature-gates/feature-gate-may-dangle.stderr b/tests/ui/feature-gates/feature-gate-may-dangle.stderr index 67d00714d95c5..9579721ddc9bf 100644 --- a/tests/ui/feature-gates/feature-gate-may-dangle.stderr +++ b/tests/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 - --> $DIR/feature-gate-may-dangle.rs:6:13 +error[E0658]: the `may_dangle` attribute has unstable semantics and may be removed in the future + --> $DIR/feature-gate-may-dangle.rs:6:15 | LL | unsafe impl<#[may_dangle] A> Drop for Pt { - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: see issue #34761 for more information = help: add `#![feature(dropck_eyepatch)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-needs-allocator.rs b/tests/ui/feature-gates/feature-gate-needs-allocator.rs index 08954944bcde7..2629f81d89897 100644 --- a/tests/ui/feature-gates/feature-gate-needs-allocator.rs +++ b/tests/ui/feature-gates/feature-gate-needs-allocator.rs @@ -1,3 +1,3 @@ -#![needs_allocator] //~ ERROR the `#[needs_allocator]` attribute is +#![needs_allocator] //~ ERROR the `needs_allocator` attribute is fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-needs-allocator.stderr b/tests/ui/feature-gates/feature-gate-needs-allocator.stderr index f26243de25f38..f2b688f7792d1 100644 --- a/tests/ui/feature-gates/feature-gate-needs-allocator.stderr +++ b/tests/ui/feature-gates/feature-gate-needs-allocator.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[needs_allocator]` attribute is an experimental feature - --> $DIR/feature-gate-needs-allocator.rs:1:1 +error[E0658]: the `needs_allocator` attribute is an experimental feature + --> $DIR/feature-gate-needs-allocator.rs:1:4 | LL | #![needs_allocator] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: add `#![feature(allocator_internals)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-no_core.rs b/tests/ui/feature-gates/feature-gate-no_core.rs index 706efd7867211..e42a2baa8c4f1 100644 --- a/tests/ui/feature-gates/feature-gate-no_core.rs +++ b/tests/ui/feature-gates/feature-gate-no_core.rs @@ -1,5 +1,5 @@ #![crate_type = "rlib"] -#![no_core] //~ ERROR the `#[no_core]` attribute is an experimental feature +#![no_core] //~ ERROR the `no_core` attribute is an experimental feature pub struct S {} diff --git a/tests/ui/feature-gates/feature-gate-no_core.stderr b/tests/ui/feature-gates/feature-gate-no_core.stderr index f5f04c346aef7..efd60f8790072 100644 --- a/tests/ui/feature-gates/feature-gate-no_core.stderr +++ b/tests/ui/feature-gates/feature-gate-no_core.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature - --> $DIR/feature-gate-no_core.rs:3:1 +error[E0658]: the `no_core` attribute is an experimental feature + --> $DIR/feature-gate-no_core.rs:3:4 | LL | #![no_core] - | ^^^^^^^^^^^ + | ^^^^^^^ | = note: see issue #29639 for more information = help: add `#![feature(no_core)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-optimize_attribute.rs b/tests/ui/feature-gates/feature-gate-optimize_attribute.rs index ed5a11270f83e..b1da0dca9c85b 100644 --- a/tests/ui/feature-gates/feature-gate-optimize_attribute.rs +++ b/tests/ui/feature-gates/feature-gate-optimize_attribute.rs @@ -1,15 +1,15 @@ #![crate_type="rlib"] -#[optimize(size)] //~ ERROR the `#[optimize]` attribute is an experimental feature +#[optimize(size)] //~ ERROR the `optimize` attribute is an experimental feature fn size() {} -#[optimize(speed)] //~ ERROR the `#[optimize]` attribute is an experimental feature +#[optimize(speed)] //~ ERROR the `optimize` attribute is an experimental feature fn speed() {} -#[optimize(none)] //~ ERROR the `#[optimize]` attribute is an experimental feature +#[optimize(none)] //~ ERROR the `optimize` attribute is an experimental feature fn none() {} #[optimize(banana)] -//~^ ERROR the `#[optimize]` attribute is an experimental feature +//~^ ERROR the `optimize` attribute is an experimental feature //~| ERROR malformed `optimize` attribute input [E0539] fn not_known() {} diff --git a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr index 646abf8e4a16e..9187c0ae4b55a 100644 --- a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr +++ b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr @@ -1,38 +1,38 @@ -error[E0658]: the `#[optimize]` attribute is an experimental feature - --> $DIR/feature-gate-optimize_attribute.rs:3:1 +error[E0658]: the `optimize` attribute is an experimental feature + --> $DIR/feature-gate-optimize_attribute.rs:3:3 | LL | #[optimize(size)] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #54882 for more information = help: add `#![feature(optimize_attribute)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[optimize]` attribute is an experimental feature - --> $DIR/feature-gate-optimize_attribute.rs:6:1 +error[E0658]: the `optimize` attribute is an experimental feature + --> $DIR/feature-gate-optimize_attribute.rs:6:3 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #54882 for more information = help: add `#![feature(optimize_attribute)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[optimize]` attribute is an experimental feature - --> $DIR/feature-gate-optimize_attribute.rs:9:1 +error[E0658]: the `optimize` attribute is an experimental feature + --> $DIR/feature-gate-optimize_attribute.rs:9:3 | LL | #[optimize(none)] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #54882 for more information = help: add `#![feature(optimize_attribute)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[optimize]` attribute is an experimental feature - --> $DIR/feature-gate-optimize_attribute.rs:12:1 +error[E0658]: the `optimize` attribute is an experimental feature + --> $DIR/feature-gate-optimize_attribute.rs:12:3 | LL | #[optimize(banana)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #54882 for more information = help: add `#![feature(optimize_attribute)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs b/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs index b9642c7bfd4a6..660c7eab3ea00 100644 --- a/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs +++ b/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs @@ -1,3 +1,3 @@ #[patchable_function_entry(prefix_nops = 1, entry_nops = 1)] -//~^ ERROR: the `#[patchable_function_entry]` attribute is an experimental feature +//~^ ERROR: the `patchable_function_entry` attribute is an experimental feature fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-patchable-function-entry.stderr b/tests/ui/feature-gates/feature-gate-patchable-function-entry.stderr index 55fcdb4f7291e..46369e7955bf2 100644 --- a/tests/ui/feature-gates/feature-gate-patchable-function-entry.stderr +++ b/tests/ui/feature-gates/feature-gate-patchable-function-entry.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[patchable_function_entry]` attribute is an experimental feature - --> $DIR/feature-gate-patchable-function-entry.rs:1:1 +error[E0658]: the `patchable_function_entry` attribute is an experimental feature + --> $DIR/feature-gate-patchable-function-entry.rs:1:3 | LL | #[patchable_function_entry(prefix_nops = 1, entry_nops = 1)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #123115 for more information = help: add `#![feature(patchable_function_entry)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs index ffb444cd9aaf4..972312a497fa2 100644 --- a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs +++ b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs @@ -2,7 +2,7 @@ #![pattern_complexity_limit = "42"] //~^ ERROR: use of an internal attribute [E0658] -//~| NOTE the `#[pattern_complexity_limit]` attribute is an internal implementation detail that will never be stable -//~| NOTE: the `#[pattern_complexity_limit]` attribute is used for rustc unit tests +//~| NOTE the `pattern_complexity_limit` attribute is an internal implementation detail that will never be stable +//~| NOTE: the `pattern_complexity_limit` attribute is used for rustc unit tests fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.stderr b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.stderr index 9ddea866ea997..7faf38d842e7f 100644 --- a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.stderr +++ b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-pattern-complexity-limit.rs:3:1 + --> $DIR/feature-gate-pattern-complexity-limit.rs:3:4 | LL | #![pattern_complexity_limit = "42"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[pattern_complexity_limit]` attribute is an internal implementation detail that will never be stable - = note: the `#[pattern_complexity_limit]` attribute is used for rustc unit tests + = note: the `pattern_complexity_limit` attribute is an internal implementation detail that will never be stable + = note: the `pattern_complexity_limit` attribute is used for rustc unit tests error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs b/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs index e69797c0aa063..637a6eb6509fc 100644 --- a/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs +++ b/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs @@ -2,7 +2,7 @@ use std::pin::Pin; -#[pin_v2] //~ ERROR the `#[pin_v2]` attribute is an experimental feature +#[pin_v2] //~ ERROR the `pin_v2` attribute is an experimental feature struct Foo; impl Foo { diff --git a/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr b/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr index c4db06d499450..80212808cd511 100644 --- a/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr +++ b/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr @@ -298,11 +298,11 @@ LL | ref pin const w: i32, = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[pin_v2]` attribute is an experimental feature - --> $DIR/feature-gate-pin_ergonomics.rs:5:1 +error[E0658]: the `pin_v2` attribute is an experimental feature + --> $DIR/feature-gate-pin_ergonomics.rs:5:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-prelude_import.rs b/tests/ui/feature-gates/feature-gate-prelude_import.rs index a338bf973992c..26ca4af99cf6d 100644 --- a/tests/ui/feature-gates/feature-gate-prelude_import.rs +++ b/tests/ui/feature-gates/feature-gate-prelude_import.rs @@ -1,4 +1,4 @@ -#[prelude_import] //~ ERROR `#[prelude_import]` is for use by rustc only +#[prelude_import] //~ ERROR the `prelude_import` attribute is for use by rustc only use std::prelude::v1::*; fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-prelude_import.stderr b/tests/ui/feature-gates/feature-gate-prelude_import.stderr index 3b22c65cd1fcd..4582d6137c3cf 100644 --- a/tests/ui/feature-gates/feature-gate-prelude_import.stderr +++ b/tests/ui/feature-gates/feature-gate-prelude_import.stderr @@ -1,8 +1,8 @@ -error[E0658]: `#[prelude_import]` is for use by rustc only - --> $DIR/feature-gate-prelude_import.rs:1:1 +error[E0658]: the `prelude_import` attribute is for use by rustc only + --> $DIR/feature-gate-prelude_import.rs:1:3 | LL | #[prelude_import] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | = help: add `#![feature(prelude_import)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-profiler-runtime.rs b/tests/ui/feature-gates/feature-gate-profiler-runtime.rs index f8a70963481c5..430a1a6aa854c 100644 --- a/tests/ui/feature-gates/feature-gate-profiler-runtime.rs +++ b/tests/ui/feature-gates/feature-gate-profiler-runtime.rs @@ -1,3 +1,3 @@ -#![profiler_runtime] //~ ERROR the `#[profiler_runtime]` attribute is +#![profiler_runtime] //~ ERROR the `profiler_runtime` attribute is fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-profiler-runtime.stderr b/tests/ui/feature-gates/feature-gate-profiler-runtime.stderr index 23792fb09baf7..1eff91ab2d83d 100644 --- a/tests/ui/feature-gates/feature-gate-profiler-runtime.stderr +++ b/tests/ui/feature-gates/feature-gate-profiler-runtime.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate which contains the profiler runtime and will never be stable - --> $DIR/feature-gate-profiler-runtime.rs:1:1 +error[E0658]: the `profiler_runtime` attribute is used to identify the `profiler_builtins` crate which contains the profiler runtime and will never be stable + --> $DIR/feature-gate-profiler-runtime.rs:1:4 | LL | #![profiler_runtime] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | = help: add `#![feature(profiler_runtime)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-register_tool.rs b/tests/ui/feature-gates/feature-gate-register_tool.rs index e599593283b35..82f757a03af10 100644 --- a/tests/ui/feature-gates/feature-gate-register_tool.rs +++ b/tests/ui/feature-gates/feature-gate-register_tool.rs @@ -1,3 +1,3 @@ -#![register_tool(tool)] //~ ERROR the `#[register_tool]` attribute is an experimental feature +#![register_tool(tool)] //~ ERROR the `register_tool` attribute is an experimental feature fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-register_tool.stderr b/tests/ui/feature-gates/feature-gate-register_tool.stderr index a0db6ba744670..fdb556926f6f7 100644 --- a/tests/ui/feature-gates/feature-gate-register_tool.stderr +++ b/tests/ui/feature-gates/feature-gate-register_tool.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[register_tool]` attribute is an experimental feature - --> $DIR/feature-gate-register_tool.rs:1:1 +error[E0658]: the `register_tool` attribute is an experimental feature + --> $DIR/feature-gate-register_tool.rs:1:4 | LL | #![register_tool(tool)] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: see issue #66079 for more information = help: add `#![feature(register_tool)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr b/tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr index 42424abcc3cb6..4f8c2701c6980 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr @@ -1,11 +1,11 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-rustc-allow-const-fn-unstable.rs:3:1 + --> $DIR/feature-gate-rustc-allow-const-fn-unstable.rs:3:3 | LL | #[rustc_allow_const_fn_unstable()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_allow_const_fn_unstable]` attribute is an internal implementation detail that will never be stable + = note: the `rustc_allow_const_fn_unstable` attribute is an internal implementation detail that will never be stable = note: rustc_allow_const_fn_unstable side-steps feature gating and stability checks error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs index f9b097fdd2151..0d96841cf8e66 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.rs @@ -2,15 +2,15 @@ #[rustc_nonnull_optimization_guaranteed] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_nonnull_optimization_guaranteed]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in the standard library +//~| NOTE the `rustc_nonnull_optimization_guaranteed` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_nonnull_optimization_guaranteed` attribute is just used to document guaranteed niche optimizations in the standard library //~| NOTE the compiler does not even check whether the type indeed is being non-null-optimized; it is your responsibility to ensure that the attribute is only used on types that are optimized struct Foo {} #[rustc_dump_variances] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_dump_variances]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_dump_variances]` attribute is used for rustc unit tests +//~| NOTE the `rustc_dump_variances` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_dump_variances` attribute is used for rustc unit tests enum E {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr index 81d8a750b897a..ed53002a51439 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs-1.stderr @@ -1,23 +1,23 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-rustc-attrs-1.rs:3:1 + --> $DIR/feature-gate-rustc-attrs-1.rs:3:3 | LL | #[rustc_nonnull_optimization_guaranteed] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_nonnull_optimization_guaranteed]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to document guaranteed niche optimizations in the standard library + = note: the `rustc_nonnull_optimization_guaranteed` attribute is an internal implementation detail that will never be stable + = note: the `rustc_nonnull_optimization_guaranteed` attribute is just used to document guaranteed niche optimizations in the standard library = note: the compiler does not even check whether the type indeed is being non-null-optimized; it is your responsibility to ensure that the attribute is only used on types that are optimized error[E0658]: use of an internal attribute - --> $DIR/feature-gate-rustc-attrs-1.rs:10:1 + --> $DIR/feature-gate-rustc-attrs-1.rs:10:3 | LL | #[rustc_dump_variances] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_dump_variances]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_dump_variances]` attribute is used for rustc unit tests + = note: the `rustc_dump_variances` attribute is an internal implementation detail that will never be stable + = note: the `rustc_dump_variances` attribute is used for rustc unit tests error: aborting due to 2 previous errors diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs.rs b/tests/ui/feature-gates/feature-gate-rustc-attrs.rs index 6382af32efb2a..4391956e35d8f 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs.rs +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs.rs @@ -19,8 +19,8 @@ fn g() {} #[rustc_dummy] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_dummy]` attribute is used for rustc unit tests +//~| NOTE the `rustc_dummy` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_dummy` attribute is used for rustc unit tests #[rustc_unknown] //~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler //~| ERROR cannot find attribute `rustc_unknown` in this scope diff --git a/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr b/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr index bc0db8b81aefc..629d25ec4f01c 100644 --- a/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc-attrs.stderr @@ -35,14 +35,14 @@ LL | #[rustc_unknown] | ^^^^^^^^^^^^^ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-rustc-attrs.rs:20:1 + --> $DIR/feature-gate-rustc-attrs.rs:20:3 | LL | #[rustc_dummy] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_dummy]` attribute is used for rustc unit tests + = note: the `rustc_dummy` attribute is an internal implementation detail that will never be stable + = note: the `rustc_dummy` attribute is used for rustc unit tests error: aborting due to 7 previous errors diff --git a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr index 690e162abe686..25b9d5026b45e 100644 --- a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/feature-gate-rustc_const_unstable.rs:3:1 + --> $DIR/feature-gate-rustc_const_unstable.rs:3:3 | LL | #[rustc_const_unstable(feature="fzzzzzt")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error[E0547]: missing 'issue' --> $DIR/feature-gate-rustc_const_unstable.rs:3:1 diff --git a/tests/ui/feature-gates/feature-gate-sanitize.rs b/tests/ui/feature-gates/feature-gate-sanitize.rs index 768417cfae8a8..f9d72a8515521 100644 --- a/tests/ui/feature-gates/feature-gate-sanitize.rs +++ b/tests/ui/feature-gates/feature-gate-sanitize.rs @@ -1,6 +1,6 @@ #![feature(no_sanitize)] //~ ERROR feature has been removed #[sanitize(address = "on")] -//~^ ERROR the `#[sanitize]` attribute is an experimental feature +//~^ ERROR the `sanitize` attribute is an experimental feature fn main() { } diff --git a/tests/ui/feature-gates/feature-gate-sanitize.stderr b/tests/ui/feature-gates/feature-gate-sanitize.stderr index 59e8b69de2e3d..2bf52201670c9 100644 --- a/tests/ui/feature-gates/feature-gate-sanitize.stderr +++ b/tests/ui/feature-gates/feature-gate-sanitize.stderr @@ -7,11 +7,11 @@ LL | #![feature(no_sanitize)] = note: removed in 1.91.0; see for more information = note: renamed to sanitize(xyz = "on|off") -error[E0658]: the `#[sanitize]` attribute is an experimental feature - --> $DIR/feature-gate-sanitize.rs:3:1 +error[E0658]: the `sanitize` attribute is an experimental feature + --> $DIR/feature-gate-sanitize.rs:3:3 | LL | #[sanitize(address = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | = note: see issue #39699 for more information = help: add `#![feature(sanitize)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-splat.rs b/tests/ui/feature-gates/feature-gate-splat.rs index ebcfc0e5a1d9f..595d0be70ef44 100644 --- a/tests/ui/feature-gates/feature-gate-splat.rs +++ b/tests/ui/feature-gates/feature-gate-splat.rs @@ -1,6 +1,6 @@ #[rustfmt::skip] fn tuple_args( - #[splat] //~ ERROR the `#[splat]` attribute is an experimental feature + #[splat] //~ ERROR the `splat` attribute is an experimental feature (a, b, c): (u32, i8, char), ) { } diff --git a/tests/ui/feature-gates/feature-gate-splat.stderr b/tests/ui/feature-gates/feature-gate-splat.stderr index 11ddc2a3b82e7..113b310e655aa 100644 --- a/tests/ui/feature-gates/feature-gate-splat.stderr +++ b/tests/ui/feature-gates/feature-gate-splat.stderr @@ -1,13 +1,13 @@ -error[E0658]: the `#[splat]` attribute is an experimental feature - --> $DIR/feature-gate-splat.rs:3:5 +error[E0658]: the `splat` attribute is an experimental feature + --> $DIR/feature-gate-splat.rs:3:7 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | = note: see issue #153629 for more information = help: add `#![feature(splat)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = note: the `#[splat]` attribute is experimental + = note: the `splat` attribute is experimental error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-staged_api.stderr b/tests/ui/feature-gates/feature-gate-staged_api.stderr index c316e4c3b25de..bd3a3b580e3a0 100644 --- a/tests/ui/feature-gates/feature-gate-staged_api.stderr +++ b/tests/ui/feature-gates/feature-gate-staged_api.stderr @@ -1,14 +1,14 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/feature-gate-staged_api.rs:1:1 + --> $DIR/feature-gate-staged_api.rs:1:4 | LL | #![stable(feature = "a", since = "3.3.3")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/feature-gate-staged_api.rs:8:1 + --> $DIR/feature-gate-staged_api.rs:8:3 | LL | #[stable(feature = "a", since = "3.3.3")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs b/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs index 29d4facffce95..8afa00838aefb 100644 --- a/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs +++ b/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs @@ -5,7 +5,7 @@ #![crate_type = "lib"] thread_local! { - //~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature + //~^ ERROR the `rustc_align_static` attribute is an experimental feature #[rustc_align_static(16)] static THREAD_LOCAL: u16 = 0; } diff --git a/tests/ui/feature-gates/feature-gate-static_align.rs b/tests/ui/feature-gates/feature-gate-static_align.rs index 4d8f0e18d94cb..8ee4dcad88ec1 100644 --- a/tests/ui/feature-gates/feature-gate-static_align.rs +++ b/tests/ui/feature-gates/feature-gate-static_align.rs @@ -1,11 +1,11 @@ #![crate_type = "lib"] #[rustc_align_static(16)] -//~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature +//~^ ERROR the `rustc_align_static` attribute is an experimental feature static REQUIRES_ALIGNMENT: u64 = 0; extern "C" { #[rustc_align_static(16)] - //~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature + //~^ ERROR the `rustc_align_static` attribute is an experimental feature static FOREIGN_STATIC: u32; } diff --git a/tests/ui/feature-gates/feature-gate-static_align.stderr b/tests/ui/feature-gates/feature-gate-static_align.stderr index b45fcdefc9cdf..5c2fe4a05796c 100644 --- a/tests/ui/feature-gates/feature-gate-static_align.stderr +++ b/tests/ui/feature-gates/feature-gate-static_align.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[rustc_align_static]` attribute is an experimental feature - --> $DIR/feature-gate-static_align.rs:3:1 +error[E0658]: the `rustc_align_static` attribute is an experimental feature + --> $DIR/feature-gate-static_align.rs:3:3 | LL | #[rustc_align_static(16)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = note: see issue #146177 for more information = help: add `#![feature(static_align)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[rustc_align_static]` attribute is an experimental feature - --> $DIR/feature-gate-static_align.rs:8:5 +error[E0658]: the `rustc_align_static` attribute is an experimental feature + --> $DIR/feature-gate-static_align.rs:8:7 | LL | #[rustc_align_static(16)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = note: see issue #146177 for more information = help: add `#![feature(static_align)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gate-thread_local.rs b/tests/ui/feature-gates/feature-gate-thread_local.rs index 0efae1f6bc356..42d419a2eb201 100644 --- a/tests/ui/feature-gates/feature-gate-thread_local.rs +++ b/tests/ui/feature-gates/feature-gate-thread_local.rs @@ -5,7 +5,7 @@ // is given permission to expand into this unstable attribute even // when the surrounding context does not have permission to use it.) -#[thread_local] //~ ERROR `#[thread_local]` is an experimental feature +#[thread_local] //~ ERROR the `thread_local` attribute is an experimental feature static FOO: i32 = 3; pub fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-thread_local.stderr b/tests/ui/feature-gates/feature-gate-thread_local.stderr index de6debafb9d02..a59408c95a72c 100644 --- a/tests/ui/feature-gates/feature-gate-thread_local.stderr +++ b/tests/ui/feature-gates/feature-gate-thread_local.stderr @@ -1,8 +1,8 @@ -error[E0658]: `#[thread_local]` is an experimental feature, and does not currently handle destructors - --> $DIR/feature-gate-thread_local.rs:8:1 +error[E0658]: the `thread_local` attribute is an experimental feature, and does not currently handle destructors + --> $DIR/feature-gate-thread_local.rs:8:3 | LL | #[thread_local] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | = note: see issue #29594 for more information = help: add `#![feature(thread_local)]` to the crate attributes to enable diff --git a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs index 44c0f1130f05d..a477b298d1739 100644 --- a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs +++ b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs @@ -5,7 +5,7 @@ fn main() { let a = &[1, 2, 3]; println!("{}", { - #[rustc_intrinsic] //~ ERROR the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items + #[rustc_intrinsic] //~ ERROR the `rustc_intrinsic` attribute is used to declare intrinsics as function items unsafe fn atomic_fence(); atomic_fence(); //~ ERROR: is unsafe diff --git a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.stderr b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.stderr index fb05273b6ffc4..3db46b3143c07 100644 --- a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.stderr +++ b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items - --> $DIR/feature-gated-feature-in-macro-arg.rs:8:9 +error[E0658]: the `rustc_intrinsic` attribute is used to declare intrinsics as function items + --> $DIR/feature-gated-feature-in-macro-arg.rs:8:11 | LL | #[rustc_intrinsic] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: add `#![feature(intrinsics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs index d11326d994f23..ac954e31b82cc 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs @@ -11,8 +11,8 @@ #![rustc_main] //~^ ERROR: `#[rustc_main]` attribute cannot be used on crates //~| ERROR: use of an internal attribute [E0658] -//~| NOTE: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable -//~| NOTE: the `#[rustc_main]` attribute is used internally to specify test entry point function +//~| NOTE: the `rustc_main` attribute is an internal implementation detail that will never be stable +//~| NOTE: the `rustc_main` attribute is used internally to specify test entry point function #![repr()] //~^ ERROR: attribute cannot be used //~| WARN unused attribute diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr index 2570fcaf470c8..aaac5ddec51c1 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr @@ -7,14 +7,14 @@ LL | #![macro_export] = help: `#[macro_export]` can only be applied to macro defs error[E0658]: use of an internal attribute - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:1 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:4 | LL | #![rustc_main] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_main]` attribute is used internally to specify test entry point function + = note: the `rustc_main` attribute is an internal implementation detail that will never be stable + = note: the `rustc_main` attribute is used internally to specify test entry point function error: `#[rustc_main]` attribute cannot be used on crates --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:1 diff --git a/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr b/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr index 509b9f6c3b0ba..77922954cfd5a 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:7:1 + --> $DIR/issue-43106-gating-of-stable.rs:7:4 | LL | #![stable()] - | ^^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:7:1 @@ -17,10 +17,10 @@ LL | #![stable()] | ^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:12:1 + --> $DIR/issue-43106-gating-of-stable.rs:12:3 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:12:1 @@ -35,10 +35,10 @@ LL | #[stable()] | ^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:18:9 + --> $DIR/issue-43106-gating-of-stable.rs:18:12 | LL | #![stable()] - | ^^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:18:9 @@ -53,10 +53,10 @@ LL | #![stable()] | ^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:24:5 + --> $DIR/issue-43106-gating-of-stable.rs:24:7 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:24:5 @@ -71,10 +71,10 @@ LL | #[stable()] | ^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:30:5 + --> $DIR/issue-43106-gating-of-stable.rs:30:7 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:30:5 @@ -89,10 +89,10 @@ LL | #[stable()] | ^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:36:5 + --> $DIR/issue-43106-gating-of-stable.rs:36:7 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:36:5 @@ -107,10 +107,10 @@ LL | #[stable()] | ^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:42:5 + --> $DIR/issue-43106-gating-of-stable.rs:42:7 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:42:5 diff --git a/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr b/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr index b1774c933560e..e4985f5c79254 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:7:1 + --> $DIR/issue-43106-gating-of-unstable.rs:7:4 | LL | #![unstable()] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:7:1 @@ -17,10 +17,10 @@ LL | #![unstable()] | ^^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:12:1 + --> $DIR/issue-43106-gating-of-unstable.rs:12:3 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:12:1 @@ -35,10 +35,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:18:9 + --> $DIR/issue-43106-gating-of-unstable.rs:18:12 | LL | #![unstable()] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:18:9 @@ -53,10 +53,10 @@ LL | #![unstable()] | ^^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:24:5 + --> $DIR/issue-43106-gating-of-unstable.rs:24:7 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:24:5 @@ -71,10 +71,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:30:5 + --> $DIR/issue-43106-gating-of-unstable.rs:30:7 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:30:5 @@ -89,10 +89,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:36:5 + --> $DIR/issue-43106-gating-of-unstable.rs:36:7 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:36:5 @@ -107,10 +107,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:42:5 + --> $DIR/issue-43106-gating-of-unstable.rs:42:7 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:42:5 diff --git a/tests/ui/force-inlining/gate.rs b/tests/ui/force-inlining/gate.rs index 5918b0d497902..137bdc57217df 100644 --- a/tests/ui/force-inlining/gate.rs +++ b/tests/ui/force-inlining/gate.rs @@ -3,14 +3,14 @@ #[rustc_force_inline] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_force_inline]` attribute is an internal implementation detail that will never be stable -//~| NOTE `#[rustc_force_inline]` forces a free function to be inlined +//~| NOTE the `rustc_force_inline` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_force_inline` attribute forces a free function to be inlined pub fn bare() { } #[rustc_force_inline = "the test requires it"] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_force_inline]` attribute is an internal implementation detail that will never be stable -//~| NOTE `#[rustc_force_inline]` forces a free function to be inlined +//~| NOTE the `rustc_force_inline` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_force_inline` attribute forces a free function to be inlined pub fn justified() { } diff --git a/tests/ui/force-inlining/gate.stderr b/tests/ui/force-inlining/gate.stderr index 6c2df08b1a3f1..28382b0616754 100644 --- a/tests/ui/force-inlining/gate.stderr +++ b/tests/ui/force-inlining/gate.stderr @@ -1,22 +1,22 @@ error[E0658]: use of an internal attribute - --> $DIR/gate.rs:4:1 + --> $DIR/gate.rs:4:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_force_inline]` attribute is an internal implementation detail that will never be stable - = note: `#[rustc_force_inline]` forces a free function to be inlined + = note: the `rustc_force_inline` attribute is an internal implementation detail that will never be stable + = note: the `rustc_force_inline` attribute forces a free function to be inlined error[E0658]: use of an internal attribute - --> $DIR/gate.rs:11:1 + --> $DIR/gate.rs:11:3 | LL | #[rustc_force_inline = "the test requires it"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_force_inline]` attribute is an internal implementation detail that will never be stable - = note: `#[rustc_force_inline]` forces a free function to be inlined + = note: the `rustc_force_inline` attribute is an internal implementation detail that will never be stable + = note: the `rustc_force_inline` attribute forces a free function to be inlined error: aborting due to 2 previous errors diff --git a/tests/ui/intrinsics/incorrect-read_via_copy-defn.rs b/tests/ui/intrinsics/incorrect-read_via_copy-defn.rs index e9f9270de87f3..a17b6c9ae09fc 100644 --- a/tests/ui/intrinsics/incorrect-read_via_copy-defn.rs +++ b/tests/ui/intrinsics/incorrect-read_via_copy-defn.rs @@ -4,5 +4,5 @@ fn main() { } #[rustc_intrinsic] -//~^ ERROR the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items +//~^ ERROR the `rustc_intrinsic` attribute is used to declare intrinsics as function items unsafe fn read_via_copy() {} diff --git a/tests/ui/intrinsics/incorrect-read_via_copy-defn.stderr b/tests/ui/intrinsics/incorrect-read_via_copy-defn.stderr index 6711c77a11eb3..8622db6d98b83 100644 --- a/tests/ui/intrinsics/incorrect-read_via_copy-defn.stderr +++ b/tests/ui/intrinsics/incorrect-read_via_copy-defn.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items - --> $DIR/incorrect-read_via_copy-defn.rs:6:1 +error[E0658]: the `rustc_intrinsic` attribute is used to declare intrinsics as function items + --> $DIR/incorrect-read_via_copy-defn.rs:6:3 | LL | #[rustc_intrinsic] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: add `#![feature(intrinsics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/intrinsics/incorrect-transmute.rs b/tests/ui/intrinsics/incorrect-transmute.rs index 25fbc7a92ee7c..e024d313bdf4b 100644 --- a/tests/ui/intrinsics/incorrect-transmute.rs +++ b/tests/ui/intrinsics/incorrect-transmute.rs @@ -4,5 +4,5 @@ fn main() { } #[rustc_intrinsic] -//~^ ERROR the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items +//~^ ERROR the `rustc_intrinsic` attribute is used to declare intrinsics as function items unsafe fn transmute() {} diff --git a/tests/ui/intrinsics/incorrect-transmute.stderr b/tests/ui/intrinsics/incorrect-transmute.stderr index 6145a11c4ae0f..819d97717b208 100644 --- a/tests/ui/intrinsics/incorrect-transmute.stderr +++ b/tests/ui/intrinsics/incorrect-transmute.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[rustc_intrinsic]` attribute is used to declare intrinsics as function items - --> $DIR/incorrect-transmute.rs:6:1 +error[E0658]: the `rustc_intrinsic` attribute is used to declare intrinsics as function items + --> $DIR/incorrect-transmute.rs:6:3 | LL | #[rustc_intrinsic] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = help: add `#![feature(intrinsics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/lang-items/issue-83471.stderr b/tests/ui/lang-items/issue-83471.stderr index 47db25cc07880..ffc48accdd917 100644 --- a/tests/ui/lang-items/issue-83471.stderr +++ b/tests/ui/lang-items/issue-83471.stderr @@ -26,37 +26,37 @@ LL | trait Fn { | - this trait has 0 generic arguments error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:8:1 + --> $DIR/issue-83471.rs:8:3 | LL | #[lang = "pointee_sized"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:12:1 + --> $DIR/issue-83471.rs:12:3 | LL | #[lang = "meta_sized"] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:16:1 + --> $DIR/issue-83471.rs:16:3 | LL | #[lang = "sized"] - | ^^^^^^^^^^^^^^^^^ + | ^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: lang items are subject to change - --> $DIR/issue-83471.rs:20:1 + --> $DIR/issue-83471.rs:20:3 | LL | #[lang = "fn"] - | ^^^^^^^^^^^^^^ + | ^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/linkage-attr/linkage4.stderr b/tests/ui/linkage-attr/linkage4.stderr index 8fbcaf841b663..a5970d100581a 100644 --- a/tests/ui/linkage-attr/linkage4.stderr +++ b/tests/ui/linkage-attr/linkage4.stderr @@ -1,8 +1,8 @@ error[E0658]: the `linkage` attribute is experimental and not portable across platforms - --> $DIR/linkage4.rs:1:1 + --> $DIR/linkage4.rs:1:3 | LL | #[linkage = "external"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | = note: see issue #29603 for more information = help: add `#![feature(linkage)]` to the crate attributes to enable diff --git a/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs b/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs index d22a3ef70c82e..8951c677af00d 100644 --- a/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs +++ b/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs @@ -1,6 +1,6 @@ //@ edition:2018 -#[must_not_suspend = "You gotta use Umm's, ya know?"] //~ ERROR the `#[must_not_suspend]` +#[must_not_suspend = "You gotta use Umm's, ya know?"] //~ ERROR the `must_not_suspend` attribute struct Umm { _i: i64 } diff --git a/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.stderr b/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.stderr index e28ff2ec70340..f904b8b721a03 100644 --- a/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.stderr +++ b/tests/ui/lint/must_not_suspend/feature-gate-must_not_suspend.stderr @@ -1,8 +1,8 @@ -error[E0658]: the `#[must_not_suspend]` attribute is an experimental feature - --> $DIR/feature-gate-must_not_suspend.rs:3:1 +error[E0658]: the `must_not_suspend` attribute is an experimental feature + --> $DIR/feature-gate-must_not_suspend.rs:3:3 | LL | #[must_not_suspend = "You gotta use Umm's, ya know?"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | = note: see issue #83310 for more information = help: add `#![feature(must_not_suspend)]` to the crate attributes to enable diff --git a/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs index 1fdb1d2f2c0cb..6bb7ab0d1a56b 100644 --- a/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs +++ b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs @@ -2,8 +2,8 @@ #[rustc_on_unimplemented(label = "test error `{Self}` with `{Bar}`")] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_on_unimplemented]` attribute is an internal implementation detail that will never be stable -//~| NOTE see `#[diagnostic::on_unimplemented]` for the stable equivalent of this attribute +//~| NOTE the `rustc_on_unimplemented` attribute is an internal implementation detail that will never be stable +//~| NOTE see the `diagnostic::on_unimplemented` attribute for the stable equivalent of this attribute trait Foo {} fn main() {} diff --git a/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr index c6680666ece05..a971398222862 100644 --- a/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr +++ b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-on-unimplemented.rs:3:1 + --> $DIR/feature-gate-on-unimplemented.rs:3:3 | LL | #[rustc_on_unimplemented(label = "test error `{Self}` with `{Bar}`")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_on_unimplemented]` attribute is an internal implementation detail that will never be stable - = note: see `#[diagnostic::on_unimplemented]` for the stable equivalent of this attribute + = note: the `rustc_on_unimplemented` attribute is an internal implementation detail that will never be stable + = note: see the `diagnostic::on_unimplemented` attribute for the stable equivalent of this attribute error: aborting due to 1 previous error diff --git a/tests/ui/panic-runtime/needs-gate.stderr b/tests/ui/panic-runtime/needs-gate.stderr index 9f66f05bac98b..41d1aa655d1de 100644 --- a/tests/ui/panic-runtime/needs-gate.stderr +++ b/tests/ui/panic-runtime/needs-gate.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[panic_runtime]` attribute is an experimental feature - --> $DIR/needs-gate.rs:4:1 +error[E0658]: the `panic_runtime` attribute is an experimental feature + --> $DIR/needs-gate.rs:4:4 | LL | #![panic_runtime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: see issue #32837 for more information = help: add `#![feature(panic_runtime)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[needs_panic_runtime]` attribute is an experimental feature - --> $DIR/needs-gate.rs:5:1 +error[E0658]: the `needs_panic_runtime` attribute is an experimental feature + --> $DIR/needs-gate.rs:5:4 | LL | #![needs_panic_runtime] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | = note: see issue #32837 for more information = help: add `#![feature(needs_panic_runtime)]` to the crate attributes to enable diff --git a/tests/ui/pin-ergonomics/pattern-matching.normal.stderr b/tests/ui/pin-ergonomics/pattern-matching.normal.stderr index 409013c34024a..8e13d65def295 100644 --- a/tests/ui/pin-ergonomics/pattern-matching.normal.stderr +++ b/tests/ui/pin-ergonomics/pattern-matching.normal.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[pin_v2]` attribute is an experimental feature - --> $DIR/pattern-matching.rs:12:1 +error[E0658]: the `pin_v2` attribute is an experimental feature + --> $DIR/pattern-matching.rs:12:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[pin_v2]` attribute is an experimental feature - --> $DIR/pattern-matching.rs:18:1 +error[E0658]: the `pin_v2` attribute is an experimental feature + --> $DIR/pattern-matching.rs:18:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable diff --git a/tests/ui/pin-ergonomics/pattern-matching.rs b/tests/ui/pin-ergonomics/pattern-matching.rs index 68e8ca65ed963..a3858a9fa16db 100644 --- a/tests/ui/pin-ergonomics/pattern-matching.rs +++ b/tests/ui/pin-ergonomics/pattern-matching.rs @@ -9,13 +9,13 @@ use std::pin::Pin; // This test verifies that a `&pin mut T` can be projected to a pinned // reference field `&pin mut T.U` when `T` is marked with `#[pin_v2]`. -#[pin_v2] //[normal]~ ERROR the `#[pin_v2]` attribute is an experimental feature +#[pin_v2] //[normal]~ ERROR the `pin_v2` attribute is an experimental feature struct Foo { x: T, y: U, } -#[pin_v2] //[normal]~ ERROR the `#[pin_v2]` attribute is an experimental feature +#[pin_v2] //[normal]~ ERROR the `pin_v2` attribute is an experimental feature enum Bar { Foo(T, U), Bar { x: T, y: U }, diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.rs b/tests/ui/rustdoc/feature-gate-doc_primitive.rs index dbf92f19378af..0ff8ce8c24bca 100644 --- a/tests/ui/rustdoc/feature-gate-doc_primitive.rs +++ b/tests/ui/rustdoc/feature-gate-doc_primitive.rs @@ -1,7 +1,7 @@ #[rustc_doc_primitive = "usize"] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_doc_primitive]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_doc_primitive]` attribute is used by the standard library to provide a way to generate documentation for primitive types +//~| NOTE the `rustc_doc_primitive` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_doc_primitive` attribute is used by the standard library to provide a way to generate documentation for primitive types /// Some docs mod usize {} diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr index 0b1af78b50410..64a9483816886 100644 --- a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr +++ b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/feature-gate-doc_primitive.rs:1:1 + --> $DIR/feature-gate-doc_primitive.rs:1:3 | LL | #[rustc_doc_primitive = "usize"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_doc_primitive]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_doc_primitive]` attribute is used by the standard library to provide a way to generate documentation for primitive types + = note: the `rustc_doc_primitive` attribute is an internal implementation detail that will never be stable + = note: the `rustc_doc_primitive` attribute is used by the standard library to provide a way to generate documentation for primitive types error: aborting due to 1 previous error diff --git a/tests/ui/stability-attribute/issue-106589.stderr b/tests/ui/stability-attribute/issue-106589.stderr index e865365ed1f86..87ad6a113950d 100644 --- a/tests/ui/stability-attribute/issue-106589.stderr +++ b/tests/ui/stability-attribute/issue-106589.stderr @@ -1,14 +1,14 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-106589.rs:3:1 + --> $DIR/issue-106589.rs:3:4 | LL | #![stable(feature = "foo", since = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/issue-106589.rs:6:1 + --> $DIR/issue-106589.rs:6:3 | LL | #[unstable(feature = "foo", issue = "none")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr index a72656d7798c2..703136e76e5e6 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr +++ b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 + --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:3 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 @@ -17,10 +17,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1 + --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:3 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1 diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged.stderr b/tests/ui/stability-attribute/stability-attribute-non-staged.stderr index f69faebbbf83c..96e3627a13c2e 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged.stderr +++ b/tests/ui/stability-attribute/stability-attribute-non-staged.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged.rs:1:1 + --> $DIR/stability-attribute-non-staged.rs:1:3 | LL | #[unstable()] - | ^^^^^^^^^^^^^ + | ^^^^^^^^ error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged.rs:1:1 @@ -17,10 +17,10 @@ LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged.rs:5:1 + --> $DIR/stability-attribute-non-staged.rs:5:3 | LL | #[stable()] - | ^^^^^^^^^^^ + | ^^^^^^ error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged.rs:5:1 diff --git a/tests/ui/thread-local/no-unstable.rs b/tests/ui/thread-local/no-unstable.rs index 3de7985e62dbd..9d4c0d07aad7f 100644 --- a/tests/ui/thread-local/no-unstable.rs +++ b/tests/ui/thread-local/no-unstable.rs @@ -1,13 +1,11 @@ thread_local! { - //~^ ERROR: use of an internal attribute [E0658] - //~| ERROR: use of an internal attribute [E0658] - //~| ERROR: `#[used(linker)]` is currently unstable [E0658] + //~^ ERROR: `#[used(linker)]` is currently unstable [E0658] //~| ERROR: `#[used]` attribute cannot be used on constants - #[rustc_dummy = 17] + #[rustc_dummy = 17] //~ ERROR: use of an internal attribute [E0658] pub static FOO: () = (); - #[cfg_attr(true, rustc_dummy = 17)] + #[cfg_attr(true, rustc_dummy = 17)] //~ ERROR: use of an internal attribute [E0658] pub static BAR: () = (); #[used(linker)] diff --git a/tests/ui/thread-local/no-unstable.stderr b/tests/ui/thread-local/no-unstable.stderr index 438020d00b7dd..acecab47bdaf6 100644 --- a/tests/ui/thread-local/no-unstable.stderr +++ b/tests/ui/thread-local/no-unstable.stderr @@ -1,28 +1,22 @@ error[E0658]: use of an internal attribute - --> $DIR/no-unstable.rs:1:1 + --> $DIR/no-unstable.rs:5:7 | -LL | / thread_local! { -... | -LL | | pub static BAZ: () = (); -LL | | } - | |_^ +LL | #[rustc_dummy = 17] + | ^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_dummy]` attribute is used for rustc unit tests + = note: the `rustc_dummy` attribute is an internal implementation detail that will never be stable + = note: the `rustc_dummy` attribute is used for rustc unit tests error[E0658]: use of an internal attribute - --> $DIR/no-unstable.rs:1:1 + --> $DIR/no-unstable.rs:8:22 | -LL | / thread_local! { -... | -LL | | pub static BAZ: () = (); -LL | | } - | |_^ +LL | #[cfg_attr(true, rustc_dummy = 17)] + | ^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_dummy]` attribute is used for rustc unit tests + = note: the `rustc_dummy` attribute is an internal implementation detail that will never be stable + = note: the `rustc_dummy` attribute is used for rustc unit tests error[E0658]: `#[used(linker)]` is currently unstable --> $DIR/no-unstable.rs:1:1 diff --git a/tests/ui/tool-attributes/diagnostic_item.rs b/tests/ui/tool-attributes/diagnostic_item.rs index 60817ae31806f..2ae03b096eae9 100644 --- a/tests/ui/tool-attributes/diagnostic_item.rs +++ b/tests/ui/tool-attributes/diagnostic_item.rs @@ -1,6 +1,6 @@ #[rustc_diagnostic_item = "foomp"] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_diagnostic_item]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_diagnostic_item]` attribute allows the compiler to reference types from the standard library for diagnostic purposes +//~| NOTE the `rustc_diagnostic_item` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_diagnostic_item` attribute allows the compiler to reference types from the standard library for diagnostic purposes struct Foomp; fn main() {} diff --git a/tests/ui/tool-attributes/diagnostic_item.stderr b/tests/ui/tool-attributes/diagnostic_item.stderr index 35e00fd726c45..46e04daa5e3a4 100644 --- a/tests/ui/tool-attributes/diagnostic_item.stderr +++ b/tests/ui/tool-attributes/diagnostic_item.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/diagnostic_item.rs:1:1 + --> $DIR/diagnostic_item.rs:1:3 | LL | #[rustc_diagnostic_item = "foomp"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_diagnostic_item]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_diagnostic_item]` attribute allows the compiler to reference types from the standard library for diagnostic purposes + = note: the `rustc_diagnostic_item` attribute is an internal implementation detail that will never be stable + = note: the `rustc_diagnostic_item` attribute allows the compiler to reference types from the standard library for diagnostic purposes error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/partial/attr-gate.stderr b/tests/ui/traits/const-traits/partial/attr-gate.stderr index e46e35d036bed..46d8773155637 100644 --- a/tests/ui/traits/const-traits/partial/attr-gate.stderr +++ b/tests/ui/traits/const-traits/partial/attr-gate.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/attr-gate.rs:2:5 + --> $DIR/attr-gate.rs:2:7 | LL | #[rustc_non_const_trait_method] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_non_const_trait_method]` attribute is an internal implementation detail that will never be stable - = note: `#[rustc_non_const_trait_method]` should only used by the standard library to mark trait methods as non-const to allow large traits an easier transition to const + = note: the `rustc_non_const_trait_method` attribute is an internal implementation detail that will never be stable + = note: the `rustc_non_const_trait_method` attribute should only be used by the standard library to mark trait methods as non-const to allow large traits an easier transition to const error: aborting due to 1 previous error diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs index 47cc9f5f96056..2fc0563bc9e23 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs @@ -1,7 +1,7 @@ #[rustc_must_implement_one_of(eq, neq)] //~^ ERROR use of an internal attribute [E0658] -//~| NOTE the `#[rustc_must_implement_one_of]` attribute is an internal implementation detail that will never be stable -//~| NOTE the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization +//~| NOTE the `rustc_must_implement_one_of` attribute is an internal implementation detail that will never be stable +//~| NOTE the `rustc_must_implement_one_of` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization trait Equal { fn eq(&self, other: &Self) -> bool { !self.neq(other) diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr index 4d44ceff98a4e..3f213b30bbdae 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr @@ -1,12 +1,12 @@ error[E0658]: use of an internal attribute - --> $DIR/rustc_must_implement_one_of_gated.rs:1:1 + --> $DIR/rustc_must_implement_one_of_gated.rs:1:3 | LL | #[rustc_must_implement_one_of(eq, neq)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable - = note: the `#[rustc_must_implement_one_of]` attribute is an internal implementation detail that will never be stable - = note: the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization + = note: the `rustc_must_implement_one_of` attribute is an internal implementation detail that will never be stable + = note: the `rustc_must_implement_one_of` attribute is used to change minimal complete definition of a trait. Its syntax and semantics are highly experimental and will be subject to change before stabilization error: aborting due to 1 previous error diff --git a/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr b/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr index 521be360f243f..6280e4309b91c 100644 --- a/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr +++ b/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr @@ -1,8 +1,8 @@ error[E0658]: stability attributes may not be used outside of the standard library - --> $DIR/unstable_feature_bound_staged_api.rs:8:1 + --> $DIR/unstable_feature_bound_staged_api.rs:8:3 | LL | #[unstable_feature_bound(feat_bar)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error From 35b1187a65cf8d2c0acae45fa3bcd9163f6a9b1e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 Jul 2026 15:45:09 +1000 Subject: [PATCH 30/33] Improve consistency of `InvalidTarget` attribute error messages Mostly in a fashion similar to the previous commit. There is one exceptional case: for errors involving `repr` the argument is significant. For these, the argument is included in the error line and the caret highlighting, e.g. ``` error: the `repr(C)` attribute cannot be used on functions --> $DIR/naked-with-invalid-repr-attr.rs:10:3 | LL | #[repr(C)] | ^^^^^^^ | = help: the `repr(C)` attribute can only be applied to data types ``` Contrast this with a more typical argument-excluding case used everywhere else: ``` error: the `rustc_abi` attribute cannot be used on associated consts --> $DIR/debug.rs:46:7 | LL | #[rustc_abi(debug)] | ^^^^^^^^^ | = help: the `rustc_abi` attribute can be applied to functions and type aliases ``` --- .../src/session_diagnostics.rs | 7 +- .../rustc_attr_parsing/src/target_checking.rs | 15 +- tests/ui/abi/debug.generic.stderr | 16 +- tests/ui/abi/debug.loongarch64.stderr | 16 +- tests/ui/abi/debug.riscv64.stderr | 16 +- tests/ui/abi/debug.rs | 4 +- .../invalid-repr-simd-on-enum-148634.stderr | 8 +- tests/ui/asm/naked-invalid-attr.stderr | 48 +- .../asm/naked-with-invalid-repr-attr.stderr | 48 +- tests/ui/attributes/align-on-fields-143987.rs | 6 +- .../attributes/align-on-fields-143987.stderr | 24 +- tests/ui/attributes/attr-on-mac-call.stderr | 248 +++---- ...attribute-on-wrong-item-inline-repr.stderr | 24 +- tests/ui/attributes/attrs-on-params.stderr | 8 +- ...degen_attr_on_required_trait_method.stderr | 24 +- .../cold-attribute-application-54044.stderr | 16 +- .../attributes/collapse-debuginfo-invalid.rs | 44 +- .../collapse-debuginfo-invalid.stderr | 176 ++--- .../const-stability-on-macro.stderr | 16 +- ...nline-and-repr-at-invalid-positions.stderr | 16 +- tests/ui/attributes/empty-repr.stderr | 8 +- .../export/exportable.binary.stderr | 16 +- .../export/exportable.sdylib.stderr | 16 +- ...inline-attribute-enum-variant-error.stderr | 8 +- .../inline/attr-usage-inline.stderr | 32 +- tests/ui/attributes/instrument_fn.stderr | 64 +- .../invalid-debugger-visualizer-target.rs | 2 +- .../invalid-debugger-visualizer-target.stderr | 8 +- tests/ui/attributes/invalid-repr.stderr | 8 +- ...ssue-105594-invalid-attr-validation.stderr | 8 +- tests/ui/attributes/linkage.stderr | 48 +- tests/ui/attributes/lint_on_root.stderr | 8 +- tests/ui/attributes/malformed-attrs.stderr | 56 +- tests/ui/attributes/malformed-fn-align.stderr | 40 +- tests/ui/attributes/malformed-static-align.rs | 2 +- .../attributes/malformed-static-align.stderr | 16 +- tests/ui/attributes/may_dangle.stderr | 40 +- tests/ui/attributes/multiple-invalid.stderr | 16 +- tests/ui/attributes/no-mangle-closure.rs | 2 +- tests/ui/attributes/no-mangle-closure.stderr | 8 +- tests/ui/attributes/optimize.stderr | 40 +- tests/ui/attributes/pass-indirectly.rs | 2 +- tests/ui/attributes/pass-indirectly.stderr | 8 +- tests/ui/attributes/positions/used.stderr | 40 +- .../repr-align-in-trait-issue-132391.stderr | 8 +- tests/ui/attributes/rustc_confusables.stderr | 8 +- .../rustc_skip_during_method_dispatch.stderr | 8 +- tests/ui/comptime/comptime_closure.rs | 2 +- tests/ui/comptime/comptime_closure.stderr | 8 +- tests/ui/comptime/comptime_impl.stderr | 8 +- tests/ui/comptime/comptime_trait.rs | 6 +- tests/ui/comptime/comptime_trait.stderr | 24 +- tests/ui/comptime/trait_comptime.stderr | 24 +- .../cfg-attr-parsed-span-issue-154801.rs | 2 +- .../cfg-attr-parsed-span-issue-154801.stderr | 8 +- .../cfg_attr-attr-syntax-validation.stderr | 4 +- ...id-attributes-on-const-params-78957.stderr | 72 +- ...d-rustc_legacy_const_generics-arguments.rs | 6 +- ...stc_legacy_const_generics-arguments.stderr | 24 +- tests/ui/coroutine/invalid_attr_usage.stderr | 16 +- .../ui/coverage-attr/allowed-positions.stderr | 136 ++-- tests/ui/coverage-attr/name-value.stderr | 56 +- tests/ui/coverage-attr/word-only.stderr | 56 +- ...ems-before-lowering-ices.ice_155127.stderr | 8 +- .../hir-crate-items-before-lowering-ices.rs | 2 +- .../deprecated-expr-precedence.stderr | 8 +- .../ui/deprecation/deprecation-sanity.stderr | 8 +- .../incorrect-locations.current.stderr | 72 +- .../incorrect-locations.next.stderr | 72 +- .../on_const/misplaced_attr.stderr | 24 +- .../on_move/report_warning_on_non_adt.rs | 2 +- .../on_move/report_warning_on_non_adt.stderr | 14 +- .../report_warning_on_non_adt.stderr | 48 +- ...ons_of_the_internal_rustc_attribute.stderr | 8 +- ...t_fail_parsing_on_invalid_options_1.stderr | 8 +- .../on_unimplemented/on_impl_trait.stderr | 8 +- .../on_unknown/incorrect_locations.stderr | 88 +-- .../incorrect_unstable_positions.stderr | 8 +- .../report_warning_on_non_macro.stderr | 8 +- tests/ui/eii/track_caller_static_errors.rs | 2 +- .../ui/eii/track_caller_static_errors.stderr | 8 +- tests/ui/enum-discriminant/eval-error.stderr | 8 +- tests/ui/error-codes/E0718.rs | 2 +- tests/ui/error-codes/E0718.stderr | 8 +- tests/ui/extern/extern-no-mangle.stderr | 24 +- tests/ui/extern/issue-47725.stderr | 24 +- ...gate-allow-internal-unstable-struct.stderr | 8 +- ...ture-gate-check-nested-macro-invocation.rs | 2 +- ...-gate-check-nested-macro-invocation.stderr | 8 +- .../feature-gate-repr-simd.stderr | 16 +- ...sue-43106-gating-of-builtin-attrs-error.rs | 24 +- ...43106-gating-of-builtin-attrs-error.stderr | 312 ++++---- .../issue-43106-gating-of-builtin-attrs.rs | 12 +- ...issue-43106-gating-of-builtin-attrs.stderr | 672 +++++++++--------- .../issue-43106-gating-of-macro_escape.stderr | 8 +- .../issue-43106-gating-of-macro_use.stderr | 40 +- ...e-43106-gating-of-proc_macro_derive.stderr | 48 +- tests/ui/ffi-attrs/ffi_const.stderr | 24 +- tests/ui/ffi-attrs/ffi_pure.stderr | 24 +- tests/ui/force-inlining/invalid.stderr | 232 +++--- .../query_stability_incorrect.rs | 2 +- .../query_stability_incorrect.stderr | 8 +- tests/ui/internal/internal-unstable.stderr | 16 +- tests/ui/layout/debug.stderr | 16 +- .../layout/thaw-transmute-invalid-enum.stderr | 8 +- .../layout/thaw-validate-invalid-enum.stderr | 8 +- .../link-ordinal-not-foreign-fn.stderr | 24 +- tests/ui/lint/fn_must_use.stderr | 8 +- ...rop-unions-known-panics-lint-123710.stderr | 8 +- tests/ui/lint/inert-attr-macro.rs | 4 +- tests/ui/lint/inert-attr-macro.stderr | 16 +- .../inline-trait-and-foreign-items.stderr | 56 +- .../lint/must_not_suspend/other_items.stderr | 8 +- tests/ui/lint/must_not_suspend/return.stderr | 8 +- .../unused/unused-attr-macro-rules.stderr | 16 +- .../unused/unused_attributes-must_use.fixed | 2 +- .../lint/unused/unused_attributes-must_use.rs | 2 +- .../unused/unused_attributes-must_use.stderr | 176 ++--- ...warn-unused-inline-on-fn-prototypes.stderr | 16 +- tests/ui/loop-match/invalid-attribute.rs | 2 +- tests/ui/loop-match/invalid-attribute.stderr | 112 +-- tests/ui/macros/issue-68060.stderr | 8 +- .../ui/malformed/malformed-regressions.stderr | 16 +- .../marker-attribute-on-non-trait.stderr | 48 +- .../panic-handler-wrong-location.stderr | 8 +- tests/ui/pin-ergonomics/pin_v2-attr.rs | 76 +- tests/ui/pin-ergonomics/pin_v2-attr.stderr | 304 ++++---- .../proc-macro/ambiguous-builtin-attrs.stderr | 16 +- .../illegal-proc-macro-derive-use.stderr | 8 +- tests/ui/repr/attr-usage-repr.stderr | 40 +- .../repr/invalid-repr-on-structs-74082.stderr | 16 +- tests/ui/repr/issue-83505-repr-simd.stderr | 8 +- tests/ui/repr/repr-disallow-on-variant.stderr | 8 +- tests/ui/repr/repr-empty-packed.stderr | 8 +- .../repr/repr-transparent-other-items.stderr | 16 +- .../invalid-attribute.stderr | 16 +- .../macro-declaration.stderr | 8 +- .../rfc-2091-track-caller/only-for-fns.stderr | 8 +- .../param-attrs-builtin-attrs.stderr | 128 ++-- tests/ui/sanitize-attr/valid-sanitize.stderr | 136 ++-- tests/ui/scalable-vectors/invalid.rs | 66 +- tests/ui/scalable-vectors/invalid.stderr | 206 +++--- tests/ui/simd/repr-simd-on-enum.stderr | 8 +- tests/ui/splat/splat-non-fn-arg.rs | 22 +- tests/ui/splat/splat-non-fn-arg.stderr | 88 +-- .../target-feature/invalid-attribute.stderr | 120 ++-- tests/ui/thread-local/no-unstable.rs | 3 +- tests/ui/thread-local/no-unstable.stderr | 20 +- tests/ui/thread-local/non-static.rs | 8 +- tests/ui/thread-local/non-static.stderr | 32 +- tests/ui/traits/alias/not-a-marker.stderr | 8 +- .../rustc_must_implement_one_of_misuse.rs | 4 +- .../rustc_must_implement_one_of_misuse.stderr | 16 +- .../unstable_inherent_method.stderr | 16 +- .../unsupported_attribute.stderr | 80 +-- 155 files changed, 2871 insertions(+), 2862 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index a5f6e7afc3dcc..c6619c1e7196c 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -372,17 +372,18 @@ pub(crate) struct EmptyConfusables { } #[derive(Diagnostic)] -#[help("`#[{$name}{$attribute_args}]` can {$only}be applied to {$applied}")] -#[diag("`#[{$name}{$attribute_args}]` attribute cannot be used on {$target}")] +#[help("the `{$name}{$attribute_args}` attribute can {$only}be applied to {$applied}")] +#[diag("the `{$name}{$attribute_args}` attribute cannot be used on {$target}")] pub(crate) struct InvalidTarget { #[primary_span] + pub span: Span, #[suggestion( "remove the attribute", code = "", applicability = "machine-applicable", style = "tool-only" )] - pub span: Span, + pub attr_span: Span, pub name: AttrPath, pub target: &'static str, pub applied: DiagArgValue, diff --git a/compiler/rustc_attr_parsing/src/target_checking.rs b/compiler/rustc_attr_parsing/src/target_checking.rs index 636df0849290c..461820626f2ad 100644 --- a/compiler/rustc_attr_parsing/src/target_checking.rs +++ b/compiler/rustc_attr_parsing/src/target_checking.rs @@ -129,7 +129,20 @@ impl<'sess> AttributeParser<'sess> { let is_diagnostic_attr = cx.attr_path.segments[0] == sym::diagnostic; let diag = InvalidTarget { - span: cx.attr_span, + span: if attribute_args.is_empty() { + // Example: for the attribute `#[inline]`, name+attribute_args gives "inline", + // and the path span covers `inline` which is just what we want. + cx.attr_path.span + } else { + // Example 1: for the attribute `#[repr(C)]`, name+attribute_args gives + // "repr(C)", and the inner span covers `repr(C)` which is just what we want. + // + // Example 2: for the attribute `#[repr(C, packed)]`, name+attribute_args gives + // "repr(C)", and the inner span covers `repr(C, packed)` which doesn't match + // exactly but is as close as we can get. + cx.inner_span + }, + attr_span: cx.attr_span, name: cx.attr_path.clone(), target: cx.target.plural_name(), only: if only { "only " } else { "" }, diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index 7a4ead4fdac18..2ef0c1a9ab25a 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -1,18 +1,18 @@ -error: `#[rustc_abi]` attribute cannot be used on constants - --> $DIR/debug.rs:42:1 +error: the `rustc_abi` attribute cannot be used on constants + --> $DIR/debug.rs:42:3 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases -error: `#[rustc_abi]` attribute cannot be used on associated consts - --> $DIR/debug.rs:46:5 +error: the `rustc_abi` attribute cannot be used on associated consts + --> $DIR/debug.rs:46:7 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input --> $DIR/debug.rs:74:1 diff --git a/tests/ui/abi/debug.loongarch64.stderr b/tests/ui/abi/debug.loongarch64.stderr index 7a5397703286b..a624df31742f6 100644 --- a/tests/ui/abi/debug.loongarch64.stderr +++ b/tests/ui/abi/debug.loongarch64.stderr @@ -1,18 +1,18 @@ -error: `#[rustc_abi]` attribute cannot be used on constants - --> $DIR/debug.rs:42:1 +error: the `rustc_abi` attribute cannot be used on constants + --> $DIR/debug.rs:42:3 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases -error: `#[rustc_abi]` attribute cannot be used on associated consts - --> $DIR/debug.rs:46:5 +error: the `rustc_abi` attribute cannot be used on associated consts + --> $DIR/debug.rs:46:7 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input --> $DIR/debug.rs:74:1 diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index 7a5397703286b..a624df31742f6 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -1,18 +1,18 @@ -error: `#[rustc_abi]` attribute cannot be used on constants - --> $DIR/debug.rs:42:1 +error: the `rustc_abi` attribute cannot be used on constants + --> $DIR/debug.rs:42:3 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases -error: `#[rustc_abi]` attribute cannot be used on associated consts - --> $DIR/debug.rs:46:5 +error: the `rustc_abi` attribute cannot be used on associated consts + --> $DIR/debug.rs:46:7 | LL | #[rustc_abi(debug)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[rustc_abi]` can be applied to functions and type aliases + = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input --> $DIR/debug.rs:74:1 diff --git a/tests/ui/abi/debug.rs b/tests/ui/abi/debug.rs index 8282c8d4f8229..45755a93d74a9 100644 --- a/tests/ui/abi/debug.rs +++ b/tests/ui/abi/debug.rs @@ -39,11 +39,11 @@ type TestFnPtr = fn(bool) -> u8; //~ ERROR: fn_abi #[rustc_abi(debug)] fn test_generic(_x: *const T) {} //~ ERROR: fn_abi -#[rustc_abi(debug)] //~ ERROR: `#[rustc_abi]` attribute cannot be used on constants +#[rustc_abi(debug)] //~ ERROR: the `rustc_abi` attribute cannot be used on constants const C: () = (); //~ ERROR: `#[rustc_abi]` can only be applied to impl S { - #[rustc_abi(debug)] //~ ERROR: `#[rustc_abi]` attribute cannot be used on assoc + #[rustc_abi(debug)] //~ ERROR: the `rustc_abi` attribute cannot be used on assoc const C: () = (); //~ ERROR: `#[rustc_abi]` can only be applied to } diff --git a/tests/ui/asm/invalid-repr-simd-on-enum-148634.stderr b/tests/ui/asm/invalid-repr-simd-on-enum-148634.stderr index 29e30bd7c5078..dc4f03429ab45 100644 --- a/tests/ui/asm/invalid-repr-simd-on-enum-148634.stderr +++ b/tests/ui/asm/invalid-repr-simd-on-enum-148634.stderr @@ -1,10 +1,10 @@ -error: `#[repr(simd)]` attribute cannot be used on enums - --> $DIR/invalid-repr-simd-on-enum-148634.rs:6:1 +error: the `repr(simd)` attribute cannot be used on enums + --> $DIR/invalid-repr-simd-on-enum-148634.rs:6:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs error[E0084]: unsupported representation for zero-variant enum --> $DIR/invalid-repr-simd-on-enum-148634.rs:6:8 diff --git a/tests/ui/asm/naked-invalid-attr.stderr b/tests/ui/asm/naked-invalid-attr.stderr index 70c7168a8c960..0b55dbe0dbcf0 100644 --- a/tests/ui/asm/naked-invalid-attr.stderr +++ b/tests/ui/asm/naked-invalid-attr.stderr @@ -4,53 +4,53 @@ error[E0433]: cannot find module or crate `a` in the crate root LL | #[::a] | ^ use of unresolved module or unlinked crate `a` -error: `#[naked]` attribute cannot be used on crates - --> $DIR/naked-invalid-attr.rs:5:1 +error: the `naked` attribute cannot be used on crates + --> $DIR/naked-invalid-attr.rs:5:11 | LL | #![unsafe(naked)] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions + = help: the `naked` attribute can only be applied to functions -error: `#[naked]` attribute cannot be used on foreign functions - --> $DIR/naked-invalid-attr.rs:10:5 +error: the `naked` attribute cannot be used on foreign functions + --> $DIR/naked-invalid-attr.rs:10:14 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions with a body + = help: the `naked` attribute can only be applied to functions with a body -error: `#[naked]` attribute cannot be used on structs - --> $DIR/naked-invalid-attr.rs:14:1 +error: the `naked` attribute cannot be used on structs + --> $DIR/naked-invalid-attr.rs:14:10 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions + = help: the `naked` attribute can only be applied to functions -error: `#[naked]` attribute cannot be used on struct fields - --> $DIR/naked-invalid-attr.rs:17:5 +error: the `naked` attribute cannot be used on struct fields + --> $DIR/naked-invalid-attr.rs:17:14 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions + = help: the `naked` attribute can only be applied to functions -error: `#[naked]` attribute cannot be used on required trait methods - --> $DIR/naked-invalid-attr.rs:23:5 +error: the `naked` attribute cannot be used on required trait methods + --> $DIR/naked-invalid-attr.rs:23:14 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions with a body + = help: the `naked` attribute can only be applied to functions with a body -error: `#[naked]` attribute cannot be used on closures - --> $DIR/naked-invalid-attr.rs:52:5 +error: the `naked` attribute cannot be used on closures + --> $DIR/naked-invalid-attr.rs:52:14 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can be applied to functions and methods + = help: the `naked` attribute can be applied to functions and methods error[E0736]: attribute incompatible with `#[unsafe(naked)]` --> $DIR/naked-invalid-attr.rs:57:3 diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.stderr b/tests/ui/asm/naked-with-invalid-repr-attr.stderr index f98feb5e34b70..7f12510b8aad6 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.stderr +++ b/tests/ui/asm/naked-with-invalid-repr-attr.stderr @@ -1,50 +1,50 @@ -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:10:1 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:10:3 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(transparent)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:17:1 +error: the `repr(transparent)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:17:3 | LL | #[repr(transparent)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[repr(transparent)]` can only be applied to data types + = help: the `repr(transparent)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:24:1 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:24:3 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:33:1 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:33:3 | LL | #[repr(C, packed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(packed)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:33:1 +error: the `repr(packed)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:33:3 | LL | #[repr(C, packed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can only be applied to data types + = help: the `repr(packed)` attribute can only be applied to data types -error: `#[repr(u8)]` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:41:1 +error: the `repr(u8)` attribute cannot be used on functions + --> $DIR/naked-with-invalid-repr-attr.rs:41:3 | LL | #[repr(u8)] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[repr(u8)]` can only be applied to enums + = help: the `repr(u8)` attribute can only be applied to enums error: aborting due to 6 previous errors diff --git a/tests/ui/attributes/align-on-fields-143987.rs b/tests/ui/attributes/align-on-fields-143987.rs index 7abd61a264995..7f9edb2d9681d 100644 --- a/tests/ui/attributes/align-on-fields-143987.rs +++ b/tests/ui/attributes/align-on-fields-143987.rs @@ -7,19 +7,19 @@ #![feature(fn_align)] struct Data { - #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + #[rustc_align(8)] //~ ERROR the `rustc_align` attribute cannot be used on struct fields x: usize, } // Test with invalid type to match the original issue more closely struct DataInvalid { - #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + #[rustc_align(8)] //~ ERROR the `rustc_align` attribute cannot be used on struct fields x: usize8, //~ ERROR cannot find type `usize8` in this scope } // Test with tuple struct struct TupleData( - #[rustc_align(32)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + #[rustc_align(32)] //~ ERROR `rustc_align` attribute cannot be used on struct fields u32 ); diff --git a/tests/ui/attributes/align-on-fields-143987.stderr b/tests/ui/attributes/align-on-fields-143987.stderr index 1ffbf4a37cb93..a80dcf69a6f18 100644 --- a/tests/ui/attributes/align-on-fields-143987.stderr +++ b/tests/ui/attributes/align-on-fields-143987.stderr @@ -10,29 +10,29 @@ LL - x: usize8, LL + x: usize, | -error: `#[rustc_align]` attribute cannot be used on struct fields - --> $DIR/align-on-fields-143987.rs:10:5 +error: the `rustc_align` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:10:7 | LL | #[rustc_align(8)] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions -error: `#[rustc_align]` attribute cannot be used on struct fields - --> $DIR/align-on-fields-143987.rs:16:5 +error: the `rustc_align` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:16:7 | LL | #[rustc_align(8)] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions -error: `#[rustc_align]` attribute cannot be used on struct fields - --> $DIR/align-on-fields-143987.rs:22:5 +error: the `rustc_align` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:22:7 | LL | #[rustc_align(32)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions error: aborting due to 4 previous errors diff --git a/tests/ui/attributes/attr-on-mac-call.stderr b/tests/ui/attributes/attr-on-mac-call.stderr index 55d04165855d2..3454998af2922 100644 --- a/tests/ui/attributes/attr-on-mac-call.stderr +++ b/tests/ui/attributes/attr-on-mac-call.stderr @@ -1,10 +1,10 @@ -error: `#[sanitize]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:77:5 +error: the `sanitize` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:77:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute error[E0658]: SIMD types are experimental and possibly buggy @@ -17,13 +17,13 @@ LL | #[repr(simd)] = help: add `#![feature(repr_simd)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[repr(simd)]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:106:5 +error: the `repr(simd)` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:106:7 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![register_tool]` @@ -38,13 +38,13 @@ note: this attribute does not have an `!`, which means it is applied to this mac LL | unreachable!(); | ^^^^^^^^^^^^^^ -warning: `#[export_name]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:8:5 +warning: the `export_name` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:8:7 | LL | #[export_name = "x"] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute note: the lint level is defined here @@ -53,233 +53,233 @@ note: the lint level is defined here LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -warning: `#[naked]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:11:5 +warning: the `naked` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:11:14 | LL | #[unsafe(naked)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^ | - = help: `#[naked]` can only be applied to functions + = help: the `naked` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[track_caller]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:14:5 +warning: the `track_caller` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:14:7 | LL | #[track_caller] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[track_caller]` can only be applied to functions + = help: the `track_caller` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[used]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:17:5 +warning: the `used` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:17:7 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[target_feature]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:20:5 +warning: the `target_feature` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:20:7 | LL | #[target_feature(enable = "x")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[deprecated]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:23:5 +warning: the `deprecated` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:23:7 | LL | #[deprecated] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[inline]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:26:5 +warning: the `inline` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:26:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[link_name]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:29:5 +warning: the `link_name` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:29:7 | LL | #[link_name = "x"] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[link_section]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:32:5 +warning: the `link_section` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:32:7 | LL | #[link_section = "__TEXT,__text"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[link_ordinal]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:35:5 +warning: the `link_ordinal` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:35:7 | LL | #[link_ordinal(42)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_ordinal]` can be applied to foreign functions and foreign statics + = help: the `link_ordinal` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[non_exhaustive]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:38:5 +warning: the `non_exhaustive` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:38:7 | LL | #[non_exhaustive] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[non_exhaustive]` can be applied to data types and enum variants + = help: the `non_exhaustive` attribute can be applied to data types and enum variants = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[proc_macro]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:41:5 +warning: the `proc_macro` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:41:7 | LL | #[proc_macro] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[proc_macro]` can only be applied to functions + = help: the `proc_macro` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[cold]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:44:5 +warning: the `cold` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:44:7 | LL | #[cold] - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[no_mangle]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:47:5 +warning: the `no_mangle` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:47:7 | LL | #[no_mangle] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[deprecated]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:50:5 +warning: the `deprecated` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:50:7 | LL | #[deprecated] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[automatically_derived]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:53:5 +warning: the `automatically_derived` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:53:7 | LL | #[automatically_derived] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[macro_use]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:56:5 +warning: the `macro_use` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:56:7 | LL | #[macro_use] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[must_use]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:59:5 +warning: the `must_use` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:59:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[no_implicit_prelude]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:62:5 +warning: the `no_implicit_prelude` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:62:7 | LL | #[no_implicit_prelude] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[path]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:65:5 +warning: the `path` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:65:7 | LL | #[path = ""] - | ^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[ignore]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:68:5 +warning: the `ignore` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:68:7 | LL | #[ignore] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[should_panic]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:71:5 +warning: the `should_panic` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:71:7 | LL | #[should_panic] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[link_name]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:74:5 +warning: the `link_name` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:74:7 | LL | #[link_name = "x"] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[repr()]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:81:5 +warning: the `repr()` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:81:7 | LL | #[repr()] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[repr()]` can only be applied to data types + = help: the `repr()` attribute can only be applied to data types = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute @@ -291,53 +291,53 @@ LL | #[repr()] | = note: using `repr` with an empty list has no effect -warning: `#[repr(u8)]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:86:5 +warning: the `repr(u8)` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:86:7 | LL | #[repr(u8)] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[repr(u8)]` can only be applied to enums + = help: the `repr(u8)` attribute can only be applied to enums = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[repr(align(...))]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:90:5 +warning: the `repr(align(...))` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:90:7 | LL | #[repr(align(8))] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[repr(align(...))]` can only be applied to data types + = help: the `repr(align(...))` attribute can only be applied to data types = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[repr(packed)]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:94:5 +warning: the `repr(packed)` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:94:7 | LL | #[repr(packed)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can only be applied to data types + = help: the `repr(packed)` attribute can only be applied to data types = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[repr(C)]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:98:5 +warning: the `repr(C)` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:98:7 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: `#[repr(Rust)]` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:102:5 +warning: the `repr(Rust)` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:102:7 | LL | #[repr(Rust)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute diff --git a/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr b/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr index f9f17b1db10d7..d66f36a8bde39 100644 --- a/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr +++ b/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr @@ -1,10 +1,10 @@ -error: `#[inline]` attribute cannot be used on statements - --> $DIR/attribute-on-wrong-item-inline-repr.rs:7:5 +error: the `inline` attribute cannot be used on statements + --> $DIR/attribute-on-wrong-item-inline-repr.rs:7:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `inline` attribute input --> $DIR/attribute-on-wrong-item-inline-repr.rs:12:5 @@ -27,13 +27,13 @@ LL - #[inline(XYZ)] LL + #[inline] | -error: `#[inline]` attribute cannot be used on statements - --> $DIR/attribute-on-wrong-item-inline-repr.rs:12:5 +error: the `inline` attribute cannot be used on statements + --> $DIR/attribute-on-wrong-item-inline-repr.rs:12:7 | LL | #[inline(XYZ)] - | ^^^^^^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `repr` attribute input --> $DIR/attribute-on-wrong-item-inline-repr.rs:17:5 @@ -84,13 +84,13 @@ LL - #[inline(ABC)] LL + #[inline] | -error: `#[inline]` attribute cannot be used on expressions - --> $DIR/attribute-on-wrong-item-inline-repr.rs:33:5 +error: the `inline` attribute cannot be used on expressions + --> $DIR/attribute-on-wrong-item-inline-repr.rs:33:7 | LL | #[inline(ABC)] - | ^^^^^^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `repr` attribute input --> $DIR/attribute-on-wrong-item-inline-repr.rs:38:14 diff --git a/tests/ui/attributes/attrs-on-params.stderr b/tests/ui/attributes/attrs-on-params.stderr index 91f87a954c55d..b38c590a19a5c 100644 --- a/tests/ui/attributes/attrs-on-params.stderr +++ b/tests/ui/attributes/attrs-on-params.stderr @@ -4,13 +4,13 @@ error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed LL | fn function(#[inline] param: u32) { | ^^^^^^^^^ -error: `#[inline]` attribute cannot be used on function params - --> $DIR/attrs-on-params.rs:3:13 +error: the `inline` attribute cannot be used on function params + --> $DIR/attrs-on-params.rs:3:15 | LL | fn function(#[inline] param: u32) { - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/codegen_attr_on_required_trait_method.stderr b/tests/ui/attributes/codegen_attr_on_required_trait_method.stderr index 7f0b0f0327e4e..91772d0d7c154 100644 --- a/tests/ui/attributes/codegen_attr_on_required_trait_method.stderr +++ b/tests/ui/attributes/codegen_attr_on_required_trait_method.stderr @@ -1,10 +1,10 @@ -error: `#[cold]` attribute cannot be used on required trait methods - --> $DIR/codegen_attr_on_required_trait_method.rs:6:5 +error: the `cold` attribute cannot be used on required trait methods + --> $DIR/codegen_attr_on_required_trait_method.rs:6:7 | LL | #[cold] - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can be applied to foreign functions and functions with a body + = help: the `cold` attribute can be applied to foreign functions and functions with a body = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/codegen_attr_on_required_trait_method.rs:1:9 @@ -12,22 +12,22 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: `#[link_section]` attribute cannot be used on required trait methods - --> $DIR/codegen_attr_on_required_trait_method.rs:10:5 +error: the `link_section` attribute cannot be used on required trait methods + --> $DIR/codegen_attr_on_required_trait_method.rs:10:7 | LL | #[link_section = "__TEXT,__text"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions with a body and statics + = help: the `link_section` attribute can be applied to functions with a body and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[linkage]` attribute cannot be used on required trait methods - --> $DIR/codegen_attr_on_required_trait_method.rs:14:5 +error: the `linkage` attribute cannot be used on required trait methods + --> $DIR/codegen_attr_on_required_trait_method.rs:14:7 | LL | #[linkage = "common"] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign functions, foreign statics, functions with a body, and statics + = help: the `linkage` attribute can be applied to foreign functions, foreign statics, functions with a body, and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 3 previous errors diff --git a/tests/ui/attributes/cold-attribute-application-54044.stderr b/tests/ui/attributes/cold-attribute-application-54044.stderr index 02cf2790d048e..f73fd19425781 100644 --- a/tests/ui/attributes/cold-attribute-application-54044.stderr +++ b/tests/ui/attributes/cold-attribute-application-54044.stderr @@ -1,10 +1,10 @@ -error: `#[cold]` attribute cannot be used on structs - --> $DIR/cold-attribute-application-54044.rs:4:1 +error: the `cold` attribute cannot be used on structs + --> $DIR/cold-attribute-application-54044.rs:4:3 | LL | #[cold] - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/cold-attribute-application-54044.rs:2:9 @@ -12,13 +12,13 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: `#[cold]` attribute cannot be used on expressions - --> $DIR/cold-attribute-application-54044.rs:10:5 +error: the `cold` attribute cannot be used on expressions + --> $DIR/cold-attribute-application-54044.rs:10:7 | LL | #[cold] - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/collapse-debuginfo-invalid.rs b/tests/ui/attributes/collapse-debuginfo-invalid.rs index e467c72f52c0e..60dc2da64bafa 100644 --- a/tests/ui/attributes/collapse-debuginfo-invalid.rs +++ b/tests/ui/attributes/collapse-debuginfo-invalid.rs @@ -5,80 +5,80 @@ // Test that the `#[collapse_debuginfo]` attribute can only be used on macro definitions. #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on extern crate std; #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on use std::collections::HashMap; #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on static FOO: u32 = 3; #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on const BAR: u32 = 3; #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on fn foo() { let _ = #[collapse_debuginfo(yes)] || { }; - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on let _ = 3; let _ = #[collapse_debuginfo(yes)] 3; - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on match (3, 4) { #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on _ => (), } } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on mod bar { } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on type Map = HashMap; #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on enum Foo { #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on Variant, } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on struct Bar { #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on field: u32, } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on union Qux { a: u32, b: u16 } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on trait Foobar { #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on type Bar; } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on type AFoobar = impl Foobar; impl Foobar for Bar { @@ -91,14 +91,14 @@ fn constraining() -> AFoobar { } #[collapse_debuginfo(yes)] -//~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on +//~^ ERROR the `collapse_debuginfo` attribute cannot be used on impl Bar { #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on const FOO: u32 = 3; #[collapse_debuginfo(yes)] - //~^ ERROR `#[collapse_debuginfo]` attribute cannot be used on + //~^ ERROR the `collapse_debuginfo` attribute cannot be used on fn bar(&self) {} } diff --git a/tests/ui/attributes/collapse-debuginfo-invalid.stderr b/tests/ui/attributes/collapse-debuginfo-invalid.stderr index d66e334c993ca..e0b176f4ff141 100644 --- a/tests/ui/attributes/collapse-debuginfo-invalid.stderr +++ b/tests/ui/attributes/collapse-debuginfo-invalid.stderr @@ -1,178 +1,178 @@ -error: `#[collapse_debuginfo]` attribute cannot be used on extern crates - --> $DIR/collapse-debuginfo-invalid.rs:7:1 +error: the `collapse_debuginfo` attribute cannot be used on extern crates + --> $DIR/collapse-debuginfo-invalid.rs:7:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on use statements - --> $DIR/collapse-debuginfo-invalid.rs:11:1 +error: the `collapse_debuginfo` attribute cannot be used on use statements + --> $DIR/collapse-debuginfo-invalid.rs:11:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on statics - --> $DIR/collapse-debuginfo-invalid.rs:15:1 +error: the `collapse_debuginfo` attribute cannot be used on statics + --> $DIR/collapse-debuginfo-invalid.rs:15:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on constants - --> $DIR/collapse-debuginfo-invalid.rs:19:1 +error: the `collapse_debuginfo` attribute cannot be used on constants + --> $DIR/collapse-debuginfo-invalid.rs:19:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on functions - --> $DIR/collapse-debuginfo-invalid.rs:23:1 +error: the `collapse_debuginfo` attribute cannot be used on functions + --> $DIR/collapse-debuginfo-invalid.rs:23:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on closures - --> $DIR/collapse-debuginfo-invalid.rs:26:13 +error: the `collapse_debuginfo` attribute cannot be used on closures + --> $DIR/collapse-debuginfo-invalid.rs:26:15 | LL | let _ = #[collapse_debuginfo(yes)] || { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on statements - --> $DIR/collapse-debuginfo-invalid.rs:28:5 +error: the `collapse_debuginfo` attribute cannot be used on statements + --> $DIR/collapse-debuginfo-invalid.rs:28:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on expressions - --> $DIR/collapse-debuginfo-invalid.rs:31:13 +error: the `collapse_debuginfo` attribute cannot be used on expressions + --> $DIR/collapse-debuginfo-invalid.rs:31:15 | LL | let _ = #[collapse_debuginfo(yes)] 3; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on match arms - --> $DIR/collapse-debuginfo-invalid.rs:34:9 +error: the `collapse_debuginfo` attribute cannot be used on match arms + --> $DIR/collapse-debuginfo-invalid.rs:34:11 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on modules - --> $DIR/collapse-debuginfo-invalid.rs:40:1 +error: the `collapse_debuginfo` attribute cannot be used on modules + --> $DIR/collapse-debuginfo-invalid.rs:40:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on type aliases - --> $DIR/collapse-debuginfo-invalid.rs:45:1 +error: the `collapse_debuginfo` attribute cannot be used on type aliases + --> $DIR/collapse-debuginfo-invalid.rs:45:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on enums - --> $DIR/collapse-debuginfo-invalid.rs:49:1 +error: the `collapse_debuginfo` attribute cannot be used on enums + --> $DIR/collapse-debuginfo-invalid.rs:49:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on enum variants - --> $DIR/collapse-debuginfo-invalid.rs:52:5 +error: the `collapse_debuginfo` attribute cannot be used on enum variants + --> $DIR/collapse-debuginfo-invalid.rs:52:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on structs - --> $DIR/collapse-debuginfo-invalid.rs:57:1 +error: the `collapse_debuginfo` attribute cannot be used on structs + --> $DIR/collapse-debuginfo-invalid.rs:57:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on struct fields - --> $DIR/collapse-debuginfo-invalid.rs:60:5 +error: the `collapse_debuginfo` attribute cannot be used on struct fields + --> $DIR/collapse-debuginfo-invalid.rs:60:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on unions - --> $DIR/collapse-debuginfo-invalid.rs:65:1 +error: the `collapse_debuginfo` attribute cannot be used on unions + --> $DIR/collapse-debuginfo-invalid.rs:65:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on traits - --> $DIR/collapse-debuginfo-invalid.rs:72:1 +error: the `collapse_debuginfo` attribute cannot be used on traits + --> $DIR/collapse-debuginfo-invalid.rs:72:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on associated types - --> $DIR/collapse-debuginfo-invalid.rs:75:5 +error: the `collapse_debuginfo` attribute cannot be used on associated types + --> $DIR/collapse-debuginfo-invalid.rs:75:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on type aliases - --> $DIR/collapse-debuginfo-invalid.rs:80:1 +error: the `collapse_debuginfo` attribute cannot be used on type aliases + --> $DIR/collapse-debuginfo-invalid.rs:80:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on inherent impl blocks - --> $DIR/collapse-debuginfo-invalid.rs:93:1 +error: the `collapse_debuginfo` attribute cannot be used on inherent impl blocks + --> $DIR/collapse-debuginfo-invalid.rs:93:3 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on associated consts - --> $DIR/collapse-debuginfo-invalid.rs:96:5 +error: the `collapse_debuginfo` attribute cannot be used on associated consts + --> $DIR/collapse-debuginfo-invalid.rs:96:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs -error: `#[collapse_debuginfo]` attribute cannot be used on inherent methods - --> $DIR/collapse-debuginfo-invalid.rs:100:5 +error: the `collapse_debuginfo` attribute cannot be used on inherent methods + --> $DIR/collapse-debuginfo-invalid.rs:100:7 | LL | #[collapse_debuginfo(yes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[collapse_debuginfo]` can only be applied to macro defs + = help: the `collapse_debuginfo` attribute can only be applied to macro defs error: aborting due to 22 previous errors diff --git a/tests/ui/attributes/const-stability-on-macro.stderr b/tests/ui/attributes/const-stability-on-macro.stderr index a8b56edfa59d2..798fce7b0c7a6 100644 --- a/tests/ui/attributes/const-stability-on-macro.stderr +++ b/tests/ui/attributes/const-stability-on-macro.stderr @@ -1,18 +1,18 @@ -error: `#[rustc_const_stable]` attribute cannot be used on macro defs - --> $DIR/const-stability-on-macro.rs:4:1 +error: the `rustc_const_stable` attribute cannot be used on macro defs + --> $DIR/const-stability-on-macro.rs:4:3 | LL | #[rustc_const_stable(feature = "foo", since = "3.3.3")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_const_stable]` can be applied to associated consts, constants, crates, functions, impl blocks, statics, traits, and use statements + = help: the `rustc_const_stable` attribute can be applied to associated consts, constants, crates, functions, impl blocks, statics, traits, and use statements -error: `#[rustc_const_unstable]` attribute cannot be used on macro defs - --> $DIR/const-stability-on-macro.rs:10:1 +error: the `rustc_const_unstable` attribute cannot be used on macro defs + --> $DIR/const-stability-on-macro.rs:10:3 | LL | #[rustc_const_unstable(feature = "bar", issue = "none")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_const_unstable]` can be applied to associated consts, constants, crates, functions, impl blocks, statics, traits, and use statements + = help: the `rustc_const_unstable` attribute can be applied to associated consts, constants, crates, functions, impl blocks, statics, traits, and use statements error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/dont-allow-inline-and-repr-at-invalid-positions.stderr b/tests/ui/attributes/dont-allow-inline-and-repr-at-invalid-positions.stderr index 0f03232cd5cc6..9a8d12233e3ee 100644 --- a/tests/ui/attributes/dont-allow-inline-and-repr-at-invalid-positions.stderr +++ b/tests/ui/attributes/dont-allow-inline-and-repr-at-invalid-positions.stderr @@ -1,18 +1,18 @@ -error: `#[inline]` attribute cannot be used on structs - --> $DIR/dont-allow-inline-and-repr-at-invalid-positions.rs:3:5 +error: the `inline` attribute cannot be used on structs + --> $DIR/dont-allow-inline-and-repr-at-invalid-positions.rs:3:7 | LL | #[inline] struct Foo; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/dont-allow-inline-and-repr-at-invalid-positions.rs:4:5 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/dont-allow-inline-and-repr-at-invalid-positions.rs:4:7 | LL | #[repr(C)] fn foo() {} - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/empty-repr.stderr b/tests/ui/attributes/empty-repr.stderr index 5ef0f4c6d652c..332c065f55ace 100644 --- a/tests/ui/attributes/empty-repr.stderr +++ b/tests/ui/attributes/empty-repr.stderr @@ -1,10 +1,10 @@ -error: `#[repr()]` attribute cannot be used on where predicates - --> $DIR/empty-repr.rs:10:1 +error: the `repr()` attribute cannot be used on where predicates + --> $DIR/empty-repr.rs:10:3 | LL | #[repr()] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[repr()]` can only be applied to data types + = help: the `repr()` attribute can only be applied to data types error: unused attribute --> $DIR/empty-repr.rs:10:1 diff --git a/tests/ui/attributes/export/exportable.binary.stderr b/tests/ui/attributes/export/exportable.binary.stderr index da3b49b7db7a2..001be57c9e668 100644 --- a/tests/ui/attributes/export/exportable.binary.stderr +++ b/tests/ui/attributes/export/exportable.binary.stderr @@ -1,18 +1,18 @@ -error: `#[export_stable]` attribute cannot be used on traits - --> $DIR/exportable.rs:135:5 +error: the `export_stable` attribute cannot be used on traits + --> $DIR/exportable.rs:135:7 | LL | #[export_stable] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements + = help: the `export_stable` attribute can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements -error: `#[export_stable]` attribute cannot be used on constants - --> $DIR/exportable.rs:139:5 +error: the `export_stable` attribute cannot be used on constants + --> $DIR/exportable.rs:139:7 | LL | #[export_stable] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements + = help: the `export_stable` attribute can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/export/exportable.sdylib.stderr b/tests/ui/attributes/export/exportable.sdylib.stderr index be3440c25ea66..cbcda3da3782c 100644 --- a/tests/ui/attributes/export/exportable.sdylib.stderr +++ b/tests/ui/attributes/export/exportable.sdylib.stderr @@ -1,18 +1,18 @@ -error: `#[export_stable]` attribute cannot be used on traits - --> $DIR/exportable.rs:135:5 +error: the `export_stable` attribute cannot be used on traits + --> $DIR/exportable.rs:135:7 | LL | #[export_stable] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements + = help: the `export_stable` attribute can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements -error: `#[export_stable]` attribute cannot be used on constants - --> $DIR/exportable.rs:139:5 +error: the `export_stable` attribute cannot be used on constants + --> $DIR/exportable.rs:139:7 | LL | #[export_stable] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements + = help: the `export_stable` attribute can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements error: private items are not exportable --> $DIR/exportable.rs:15:5 diff --git a/tests/ui/attributes/inline-attribute-enum-variant-error.stderr b/tests/ui/attributes/inline-attribute-enum-variant-error.stderr index 03954388c2efa..cdbdee11171d5 100644 --- a/tests/ui/attributes/inline-attribute-enum-variant-error.stderr +++ b/tests/ui/attributes/inline-attribute-enum-variant-error.stderr @@ -1,10 +1,10 @@ -error: `#[inline]` attribute cannot be used on enum variants - --> $DIR/inline-attribute-enum-variant-error.rs:4:5 +error: the `inline` attribute cannot be used on enum variants + --> $DIR/inline-attribute-enum-variant-error.rs:4:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error: aborting due to 1 previous error diff --git a/tests/ui/attributes/inline/attr-usage-inline.stderr b/tests/ui/attributes/inline/attr-usage-inline.stderr index 1d4280e496f83..86eede74eeb99 100644 --- a/tests/ui/attributes/inline/attr-usage-inline.stderr +++ b/tests/ui/attributes/inline/attr-usage-inline.stderr @@ -1,10 +1,10 @@ -error: `#[inline]` attribute cannot be used on structs - --> $DIR/attr-usage-inline.rs:7:1 +error: the `inline` attribute cannot be used on structs + --> $DIR/attr-usage-inline.rs:7:3 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error[E0518]: attribute should be applied to function or closure --> $DIR/attr-usage-inline.rs:25:1 @@ -12,32 +12,32 @@ error[E0518]: attribute should be applied to function or closure LL | #[inline] | ^^^^^^^^^ not a function or closure -warning: `#[inline]` attribute cannot be used on struct fields - --> $DIR/attr-usage-inline.rs:11:5 +warning: the `inline` attribute cannot be used on struct fields + --> $DIR/attr-usage-inline.rs:11:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` -warning: `#[inline]` attribute cannot be used on macro defs - --> $DIR/attr-usage-inline.rs:18:1 +warning: the `inline` attribute cannot be used on macro defs + --> $DIR/attr-usage-inline.rs:18:3 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[inline]` attribute cannot be used on macro defs - --> $DIR/attr-usage-inline.rs:25:1 +warning: the `inline` attribute cannot be used on macro defs + --> $DIR/attr-usage-inline.rs:25:3 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 2 previous errors; 3 warnings emitted diff --git a/tests/ui/attributes/instrument_fn.stderr b/tests/ui/attributes/instrument_fn.stderr index 2f050de5ed0a5..bf33a205554e4 100644 --- a/tests/ui/attributes/instrument_fn.stderr +++ b/tests/ui/attributes/instrument_fn.stderr @@ -18,61 +18,61 @@ LL | let _x = #[instrument_fn = "on"] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[instrument_fn]` attribute cannot be used on crates - --> $DIR/instrument_fn.rs:2:1 +error: the `instrument_fn` attribute cannot be used on crates + --> $DIR/instrument_fn.rs:2:4 | LL | #![instrument_fn = "off"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on structs - --> $DIR/instrument_fn.rs:4:1 +error: the `instrument_fn` attribute cannot be used on structs + --> $DIR/instrument_fn.rs:4:3 | LL | #[instrument_fn = "on"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on modules - --> $DIR/instrument_fn.rs:7:1 +error: the `instrument_fn` attribute cannot be used on modules + --> $DIR/instrument_fn.rs:7:3 | LL | #[instrument_fn = "on"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on inherent impl blocks - --> $DIR/instrument_fn.rs:10:1 +error: the `instrument_fn` attribute cannot be used on inherent impl blocks + --> $DIR/instrument_fn.rs:10:3 | LL | #[instrument_fn = "on"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on expressions - --> $DIR/instrument_fn.rs:14:9 +error: the `instrument_fn` attribute cannot be used on expressions + --> $DIR/instrument_fn.rs:14:11 | LL | #[instrument_fn = "off"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on traits - --> $DIR/instrument_fn.rs:20:1 +error: the `instrument_fn` attribute cannot be used on traits + --> $DIR/instrument_fn.rs:20:3 | LL | #[instrument_fn = "off"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions + = help: the `instrument_fn` attribute can only be applied to functions -error: `#[instrument_fn]` attribute cannot be used on required trait methods - --> $DIR/instrument_fn.rs:22:5 +error: the `instrument_fn` attribute cannot be used on required trait methods + --> $DIR/instrument_fn.rs:22:7 | LL | #[instrument_fn = "off"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can only be applied to functions with a body + = help: the `instrument_fn` attribute can only be applied to functions with a body error[E0805]: malformed `instrument_fn` attribute input --> $DIR/instrument_fn.rs:37:1 @@ -113,13 +113,13 @@ LL - #[instrument_fn = 1] LL + #[instrument_fn = "on|off"] | -error: `#[instrument_fn]` attribute cannot be used on closures - --> $DIR/instrument_fn.rs:47:14 +error: the `instrument_fn` attribute cannot be used on closures + --> $DIR/instrument_fn.rs:47:16 | LL | let _x = #[instrument_fn = "on"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[instrument_fn]` can be applied to functions and methods + = help: the `instrument_fn` attribute can be applied to functions and methods error: aborting due to 13 previous errors diff --git a/tests/ui/attributes/invalid-debugger-visualizer-target.rs b/tests/ui/attributes/invalid-debugger-visualizer-target.rs index 48b041532140a..7ae28bea9f7a9 100644 --- a/tests/ui/attributes/invalid-debugger-visualizer-target.rs +++ b/tests/ui/attributes/invalid-debugger-visualizer-target.rs @@ -1,3 +1,3 @@ #[debugger_visualizer(natvis_file = "./foo.natvis.xml")] -//~^ ERROR `#[debugger_visualizer]` attribute cannot be used on functions +//~^ ERROR the `debugger_visualizer` attribute cannot be used on functions fn main() {} diff --git a/tests/ui/attributes/invalid-debugger-visualizer-target.stderr b/tests/ui/attributes/invalid-debugger-visualizer-target.stderr index c721e3dc10f59..7fca9819908bd 100644 --- a/tests/ui/attributes/invalid-debugger-visualizer-target.stderr +++ b/tests/ui/attributes/invalid-debugger-visualizer-target.stderr @@ -1,10 +1,10 @@ -error: `#[debugger_visualizer]` attribute cannot be used on functions - --> $DIR/invalid-debugger-visualizer-target.rs:1:1 +error: the `debugger_visualizer` attribute cannot be used on functions + --> $DIR/invalid-debugger-visualizer-target.rs:1:3 | LL | #[debugger_visualizer(natvis_file = "./foo.natvis.xml")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[debugger_visualizer]` can be applied to crates and modules + = help: the `debugger_visualizer` attribute can be applied to crates and modules error: aborting due to 1 previous error diff --git a/tests/ui/attributes/invalid-repr.stderr b/tests/ui/attributes/invalid-repr.stderr index 4eadc9cc16f87..ef442f1c1f65f 100644 --- a/tests/ui/attributes/invalid-repr.stderr +++ b/tests/ui/attributes/invalid-repr.stderr @@ -1,10 +1,10 @@ -error: `#[repr(align(...))]` attribute cannot be used on type aliases - --> $DIR/invalid-repr.rs:1:1 +error: the `repr(align(...))` attribute cannot be used on type aliases + --> $DIR/invalid-repr.rs:1:3 | LL | #[repr(align(16))] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | - = help: `#[repr(align(...))]` can only be applied to data types + = help: the `repr(align(...))` attribute can only be applied to data types error: aborting due to 1 previous error diff --git a/tests/ui/attributes/issue-105594-invalid-attr-validation.stderr b/tests/ui/attributes/issue-105594-invalid-attr-validation.stderr index 337d3808d28f6..2e6e7537bd625 100644 --- a/tests/ui/attributes/issue-105594-invalid-attr-validation.stderr +++ b/tests/ui/attributes/issue-105594-invalid-attr-validation.stderr @@ -1,10 +1,10 @@ -error: `#[track_caller]` attribute cannot be used on statics - --> $DIR/issue-105594-invalid-attr-validation.rs:6:1 +error: the `track_caller` attribute cannot be used on statics + --> $DIR/issue-105594-invalid-attr-validation.rs:6:3 | LL | #[track_caller] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[track_caller]` can only be applied to functions + = help: the `track_caller` attribute can only be applied to functions error: aborting due to 1 previous error diff --git a/tests/ui/attributes/linkage.stderr b/tests/ui/attributes/linkage.stderr index 167cdb0243a79..ca4eeda03a7b8 100644 --- a/tests/ui/attributes/linkage.stderr +++ b/tests/ui/attributes/linkage.stderr @@ -1,50 +1,50 @@ -error: `#[linkage]` attribute cannot be used on type aliases - --> $DIR/linkage.rs:6:1 +error: the `linkage` attribute cannot be used on type aliases + --> $DIR/linkage.rs:6:3 | LL | #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign statics, functions, and statics + = help: the `linkage` attribute can be applied to foreign statics, functions, and statics -error: `#[linkage]` attribute cannot be used on modules - --> $DIR/linkage.rs:9:1 +error: the `linkage` attribute cannot be used on modules + --> $DIR/linkage.rs:9:3 | LL | #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign statics, functions, and statics + = help: the `linkage` attribute can be applied to foreign statics, functions, and statics -error: `#[linkage]` attribute cannot be used on structs - --> $DIR/linkage.rs:12:1 +error: the `linkage` attribute cannot be used on structs + --> $DIR/linkage.rs:12:3 | LL | #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign statics, functions, and statics + = help: the `linkage` attribute can be applied to foreign statics, functions, and statics -error: `#[linkage]` attribute cannot be used on inherent impl blocks - --> $DIR/linkage.rs:15:1 +error: the `linkage` attribute cannot be used on inherent impl blocks + --> $DIR/linkage.rs:15:3 | LL | #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign statics, functions, and statics + = help: the `linkage` attribute can be applied to foreign statics, functions, and statics -error: `#[linkage]` attribute cannot be used on expressions - --> $DIR/linkage.rs:23:5 +error: the `linkage` attribute cannot be used on expressions + --> $DIR/linkage.rs:23:7 | LL | #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign statics, functions, and statics + = help: the `linkage` attribute can be applied to foreign statics, functions, and statics -error: `#[linkage]` attribute cannot be used on closures - --> $DIR/linkage.rs:39:13 +error: the `linkage` attribute cannot be used on closures + --> $DIR/linkage.rs:39:15 | LL | let _ = #[linkage = "weak"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[linkage]` can be applied to foreign functions, foreign statics, functions, methods, and statics + = help: the `linkage` attribute can be applied to foreign functions, foreign statics, functions, methods, and statics error: aborting due to 6 previous errors diff --git a/tests/ui/attributes/lint_on_root.stderr b/tests/ui/attributes/lint_on_root.stderr index 46b0b613a2f0b..f76e0e6c94a18 100644 --- a/tests/ui/attributes/lint_on_root.stderr +++ b/tests/ui/attributes/lint_on_root.stderr @@ -1,10 +1,10 @@ -error: `#[inline]` attribute cannot be used on crates - --> $DIR/lint_on_root.rs:3:1 +error: the `inline` attribute cannot be used on crates + --> $DIR/lint_on_root.rs:3:4 | LL | #![inline = ""] - | ^^^^^^^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error: valid forms for the attribute are `#![inline(always)]`, `#![inline(never)]`, and `#![inline]` --> $DIR/lint_on_root.rs:3:1 diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index bae7f4f295d6c..f6998a590f6c9 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -176,13 +176,13 @@ help: must be of the form LL | #[rustc_confusables("name1", "name2", ...)] | +++++++++++++++++++++++ -error: `#[rustc_confusables]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:36:1 +error: the `rustc_confusables` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:36:3 | LL | #[rustc_confusables] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_confusables]` can only be applied to inherent methods + = help: the `rustc_confusables` attribute can only be applied to inherent methods error[E0539]: malformed `deprecated` attribute input --> $DIR/malformed-attrs.rs:39:1 @@ -207,13 +207,13 @@ LL | #[rustc_macro_transparency = "semiopaque"] LL | #[rustc_macro_transparency = "transparent"] | +++++++++++++++ -error: `#[rustc_macro_transparency]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:43:1 +error: the `rustc_macro_transparency` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:43:3 | LL | #[rustc_macro_transparency] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_macro_transparency]` can only be applied to macro defs + = help: the `rustc_macro_transparency` attribute can only be applied to macro defs error[E0539]: malformed `repr` attribute input --> $DIR/malformed-attrs.rs:46:1 @@ -407,13 +407,13 @@ LL - #[used()] LL + #[used] | -error: `#[used]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:73:1 +error: the `used` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:73:3 | LL | #[used()] - | ^^^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics error[E0539]: malformed `crate_name` attribute input --> $DIR/malformed-attrs.rs:76:1 @@ -898,22 +898,22 @@ error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, ` LL | #[doc] | ^^^^^^ -warning: `#[link]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:85:1 +warning: the `link` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:85:3 | LL | #[link] - | ^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:89:1 +warning: the `link_name` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:89:3 | LL | #[link_name] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` @@ -925,13 +925,13 @@ LL | #[ignore()] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #57571 -warning: `#[no_implicit_prelude]` attribute cannot be used on functions - --> $DIR/malformed-attrs.rs:102:1 +warning: the `no_implicit_prelude` attribute cannot be used on functions + --> $DIR/malformed-attrs.rs:102:3 | LL | #[no_implicit_prelude = 23] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: missing options for `diagnostic::on_unimplemented` attribute @@ -957,13 +957,13 @@ warning: `#[diagnostic::do_not_recommend]` does not expect any arguments LL | #[diagnostic::do_not_recommend()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -warning: `#[automatically_derived]` attribute cannot be used on modules - --> $DIR/malformed-attrs.rs:191:1 +warning: the `automatically_derived` attribute cannot be used on modules + --> $DIR/malformed-attrs.rs:191:3 | LL | #[automatically_derived = 18] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` diff --git a/tests/ui/attributes/malformed-fn-align.stderr b/tests/ui/attributes/malformed-fn-align.stderr index 59cab345c9b7a..a6b3d1b196b68 100644 --- a/tests/ui/attributes/malformed-fn-align.stderr +++ b/tests/ui/attributes/malformed-fn-align.stderr @@ -49,13 +49,13 @@ error[E0589]: invalid alignment value: not a power of two LL | #[rustc_align(0)] | ^ -error: `#[repr(align(...))]` attribute cannot be used on functions - --> $DIR/malformed-fn-align.rs:26:1 +error: the `repr(align(...))` attribute cannot be used on functions + --> $DIR/malformed-fn-align.rs:26:3 | LL | #[repr(align(16))] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | - = help: `#[repr(align(...))]` can only be applied to data types + = help: the `repr(align(...))` attribute can only be applied to data types = help: use `#[rustc_align(...)]` instead error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression @@ -96,37 +96,37 @@ error[E0589]: invalid alignment value: not a power of two LL | #[rustc_align(3)] | ^ -error: `#[rustc_align]` attribute cannot be used on structs - --> $DIR/malformed-fn-align.rs:44:1 +error: the `rustc_align` attribute cannot be used on structs + --> $DIR/malformed-fn-align.rs:44:3 | LL | #[rustc_align(16)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions -error: `#[rustc_align]` attribute cannot be used on constants - --> $DIR/malformed-fn-align.rs:47:1 +error: the `rustc_align` attribute cannot be used on constants + --> $DIR/malformed-fn-align.rs:47:3 | LL | #[rustc_align(32)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions -error: `#[rustc_align]` attribute cannot be used on modules - --> $DIR/malformed-fn-align.rs:50:1 +error: the `rustc_align` attribute cannot be used on modules + --> $DIR/malformed-fn-align.rs:50:3 | LL | #[rustc_align(32)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions -error: `#[rustc_align]` attribute cannot be used on use statements - --> $DIR/malformed-fn-align.rs:53:1 +error: the `rustc_align` attribute cannot be used on use statements + --> $DIR/malformed-fn-align.rs:53:3 | LL | #[rustc_align(32)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[rustc_align]` can only be applied to functions + = help: the `rustc_align` attribute can only be applied to functions error: aborting due to 15 previous errors diff --git a/tests/ui/attributes/malformed-static-align.rs b/tests/ui/attributes/malformed-static-align.rs index 83fc8bae54fda..2f567ca94e7f7 100644 --- a/tests/ui/attributes/malformed-static-align.rs +++ b/tests/ui/attributes/malformed-static-align.rs @@ -13,5 +13,5 @@ static S3: () = (); #[repr(align(16))] //~ ERROR attribute cannot be used on static S4: () = (); -#[rustc_align_static(16)] //~ ERROR `#[rustc_align_static]` attribute cannot be used on structs +#[rustc_align_static(16)] //~ ERROR `rustc_align_static` attribute cannot be used on structs struct Struct1; diff --git a/tests/ui/attributes/malformed-static-align.stderr b/tests/ui/attributes/malformed-static-align.stderr index dd449f56ac005..d42c743493ab6 100644 --- a/tests/ui/attributes/malformed-static-align.stderr +++ b/tests/ui/attributes/malformed-static-align.stderr @@ -24,22 +24,22 @@ error[E0589]: invalid alignment value: not a power of two LL | #[rustc_align_static(0)] | ^ -error: `#[repr(align(...))]` attribute cannot be used on statics - --> $DIR/malformed-static-align.rs:13:1 +error: the `repr(align(...))` attribute cannot be used on statics + --> $DIR/malformed-static-align.rs:13:3 | LL | #[repr(align(16))] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | - = help: `#[repr(align(...))]` can only be applied to data types + = help: the `repr(align(...))` attribute can only be applied to data types = help: use `#[rustc_align_static(...)]` instead -error: `#[rustc_align_static]` attribute cannot be used on structs - --> $DIR/malformed-static-align.rs:16:1 +error: the `rustc_align_static` attribute cannot be used on structs + --> $DIR/malformed-static-align.rs:16:3 | LL | #[rustc_align_static(16)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_align_static]` can be applied to foreign statics and statics + = help: the `rustc_align_static` attribute can be applied to foreign statics and statics error: aborting due to 5 previous errors diff --git a/tests/ui/attributes/may_dangle.stderr b/tests/ui/attributes/may_dangle.stderr index 596c44aa958e1..5f560003a2238 100644 --- a/tests/ui/attributes/may_dangle.stderr +++ b/tests/ui/attributes/may_dangle.stderr @@ -1,42 +1,42 @@ -error: `#[may_dangle]` attribute cannot be used on const parameters - --> $DIR/may_dangle.rs:14:20 +error: the `may_dangle` attribute cannot be used on const parameters + --> $DIR/may_dangle.rs:14:22 | LL | unsafe impl<'a, T, #[may_dangle] const N: usize> Drop for Implee1<'a, T, N> { - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[may_dangle]` can be applied to lifetime parameters and type parameters + = help: the `may_dangle` attribute can be applied to lifetime parameters and type parameters -error: `#[may_dangle]` attribute cannot be used on structs - --> $DIR/may_dangle.rs:42:1 +error: the `may_dangle` attribute cannot be used on structs + --> $DIR/may_dangle.rs:42:3 | LL | #[may_dangle] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[may_dangle]` can be applied to lifetime parameters and type parameters + = help: the `may_dangle` attribute can be applied to lifetime parameters and type parameters -error: `#[may_dangle]` attribute cannot be used on trait impl blocks - --> $DIR/may_dangle.rs:45:1 +error: the `may_dangle` attribute cannot be used on trait impl blocks + --> $DIR/may_dangle.rs:45:3 | LL | #[may_dangle] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[may_dangle]` can be applied to lifetime parameters and type parameters + = help: the `may_dangle` attribute can be applied to lifetime parameters and type parameters -error: `#[may_dangle]` attribute cannot be used on functions - --> $DIR/may_dangle.rs:49:1 +error: the `may_dangle` attribute cannot be used on functions + --> $DIR/may_dangle.rs:49:3 | LL | #[may_dangle] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[may_dangle]` can be applied to lifetime parameters and type parameters + = help: the `may_dangle` attribute can be applied to lifetime parameters and type parameters -error: `#[may_dangle]` attribute cannot be used on statements - --> $DIR/may_dangle.rs:51:5 +error: the `may_dangle` attribute cannot be used on statements + --> $DIR/may_dangle.rs:51:7 | LL | #[may_dangle] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[may_dangle]` can be applied to lifetime parameters and type parameters + = help: the `may_dangle` attribute can be applied to lifetime parameters and type parameters error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl --> $DIR/may_dangle.rs:8:13 diff --git a/tests/ui/attributes/multiple-invalid.stderr b/tests/ui/attributes/multiple-invalid.stderr index 182d39b14bc53..4c5fa82727489 100644 --- a/tests/ui/attributes/multiple-invalid.stderr +++ b/tests/ui/attributes/multiple-invalid.stderr @@ -1,18 +1,18 @@ -error: `#[inline]` attribute cannot be used on constants - --> $DIR/multiple-invalid.rs:4:1 +error: the `inline` attribute cannot be used on constants + --> $DIR/multiple-invalid.rs:4:3 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on constants - --> $DIR/multiple-invalid.rs:6:1 +error: the `target_feature` attribute cannot be used on constants + --> $DIR/multiple-invalid.rs:6:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions error: aborting due to 2 previous errors diff --git a/tests/ui/attributes/no-mangle-closure.rs b/tests/ui/attributes/no-mangle-closure.rs index 05dcbf8e5bed7..694d2ef494781 100644 --- a/tests/ui/attributes/no-mangle-closure.rs +++ b/tests/ui/attributes/no-mangle-closure.rs @@ -7,5 +7,5 @@ pub struct S([usize; 8]); pub fn outer_function(x: S, y: S) -> usize { (#[no_mangle] || y.0[0])() - //~^ ERROR `#[no_mangle]` attribute cannot be used on closures + //~^ ERROR the `no_mangle` attribute cannot be used on closures } diff --git a/tests/ui/attributes/no-mangle-closure.stderr b/tests/ui/attributes/no-mangle-closure.stderr index f81e65d926752..ae1af60856773 100644 --- a/tests/ui/attributes/no-mangle-closure.stderr +++ b/tests/ui/attributes/no-mangle-closure.stderr @@ -1,10 +1,10 @@ -error: `#[no_mangle]` attribute cannot be used on closures - --> $DIR/no-mangle-closure.rs:9:6 +error: the `no_mangle` attribute cannot be used on closures + --> $DIR/no-mangle-closure.rs:9:8 | LL | (#[no_mangle] || y.0[0])() - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions, methods, and statics + = help: the `no_mangle` attribute can be applied to functions, methods, and statics error: aborting due to 1 previous error diff --git a/tests/ui/attributes/optimize.stderr b/tests/ui/attributes/optimize.stderr index c6555ce7589aa..db45f96d143c8 100644 --- a/tests/ui/attributes/optimize.stderr +++ b/tests/ui/attributes/optimize.stderr @@ -1,42 +1,42 @@ -error: `#[optimize]` attribute cannot be used on structs - --> $DIR/optimize.rs:8:1 +error: the `optimize` attribute cannot be used on structs + --> $DIR/optimize.rs:8:3 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[optimize]` can only be applied to functions + = help: the `optimize` attribute can only be applied to functions -error: `#[optimize]` attribute cannot be used on expressions - --> $DIR/optimize.rs:12:5 +error: the `optimize` attribute cannot be used on expressions + --> $DIR/optimize.rs:12:7 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[optimize]` can only be applied to functions + = help: the `optimize` attribute can only be applied to functions -error: `#[optimize]` attribute cannot be used on modules - --> $DIR/optimize.rs:21:1 +error: the `optimize` attribute cannot be used on modules + --> $DIR/optimize.rs:21:3 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[optimize]` can only be applied to functions + = help: the `optimize` attribute can only be applied to functions -error: `#[optimize]` attribute cannot be used on inherent impl blocks - --> $DIR/optimize.rs:24:1 +error: the `optimize` attribute cannot be used on inherent impl blocks + --> $DIR/optimize.rs:24:3 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[optimize]` can only be applied to functions + = help: the `optimize` attribute can only be applied to functions -error: `#[optimize]` attribute cannot be used on required trait methods - --> $DIR/optimize.rs:45:5 +error: the `optimize` attribute cannot be used on required trait methods + --> $DIR/optimize.rs:45:7 | LL | #[optimize(speed)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[optimize]` can only be applied to functions with a body + = help: the `optimize` attribute can only be applied to functions with a body error: multiple `optimize` attributes --> $DIR/optimize.rs:59:1 diff --git a/tests/ui/attributes/pass-indirectly.rs b/tests/ui/attributes/pass-indirectly.rs index 0eacffbf01fbe..b58dc3485b801 100644 --- a/tests/ui/attributes/pass-indirectly.rs +++ b/tests/ui/attributes/pass-indirectly.rs @@ -4,7 +4,7 @@ #![crate_type = "lib"] #[rustc_pass_indirectly_in_non_rustic_abis] -//~^ ERROR: `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute cannot be used on functions +//~^ ERROR: the `rustc_pass_indirectly_in_non_rustic_abis` attribute cannot be used on functions fn not_a_struct() {} #[repr(C)] diff --git a/tests/ui/attributes/pass-indirectly.stderr b/tests/ui/attributes/pass-indirectly.stderr index 2011f3d928f69..9b84bc3091cc3 100644 --- a/tests/ui/attributes/pass-indirectly.stderr +++ b/tests/ui/attributes/pass-indirectly.stderr @@ -1,10 +1,10 @@ -error: `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute cannot be used on functions - --> $DIR/pass-indirectly.rs:6:1 +error: the `rustc_pass_indirectly_in_non_rustic_abis` attribute cannot be used on functions + --> $DIR/pass-indirectly.rs:6:3 | LL | #[rustc_pass_indirectly_in_non_rustic_abis] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_pass_indirectly_in_non_rustic_abis]` can only be applied to structs + = help: the `rustc_pass_indirectly_in_non_rustic_abis` attribute can only be applied to structs error: aborting due to 1 previous error diff --git a/tests/ui/attributes/positions/used.stderr b/tests/ui/attributes/positions/used.stderr index 79011f3a758f5..dceba0253c1d3 100644 --- a/tests/ui/attributes/positions/used.stderr +++ b/tests/ui/attributes/positions/used.stderr @@ -1,42 +1,42 @@ -error: `#[used]` attribute cannot be used on functions - --> $DIR/used.rs:7:1 +error: the `used` attribute cannot be used on functions + --> $DIR/used.rs:7:3 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics -error: `#[used]` attribute cannot be used on structs - --> $DIR/used.rs:10:1 +error: the `used` attribute cannot be used on structs + --> $DIR/used.rs:10:3 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics -error: `#[used]` attribute cannot be used on traits - --> $DIR/used.rs:13:1 +error: the `used` attribute cannot be used on traits + --> $DIR/used.rs:13:3 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics -error: `#[used]` attribute cannot be used on trait impl blocks - --> $DIR/used.rs:16:1 +error: the `used` attribute cannot be used on trait impl blocks + --> $DIR/used.rs:16:3 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics -error: `#[used]` attribute cannot be used on foreign statics - --> $DIR/used.rs:21:5 +error: the `used` attribute cannot be used on foreign statics + --> $DIR/used.rs:21:7 | LL | #[used] - | ^^^^^^^ + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics error: aborting due to 5 previous errors diff --git a/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr b/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr index 3d3af82d6dbd1..a55268991d2ba 100644 --- a/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr +++ b/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr @@ -1,10 +1,10 @@ -error: `#[repr(align(...))]` attribute cannot be used on required trait methods - --> $DIR/repr-align-in-trait-issue-132391.rs:2:5 +error: the `repr(align(...))` attribute cannot be used on required trait methods + --> $DIR/repr-align-in-trait-issue-132391.rs:2:7 | LL | #[repr(align)] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[repr(align(...))]` can only be applied to data types + = help: the `repr(align(...))` attribute can only be applied to data types error[E0539]: malformed `repr` attribute input --> $DIR/repr-align-in-trait-issue-132391.rs:2:5 diff --git a/tests/ui/attributes/rustc_confusables.stderr b/tests/ui/attributes/rustc_confusables.stderr index a6808498dad8d..d5c72dbb4d9d6 100644 --- a/tests/ui/attributes/rustc_confusables.stderr +++ b/tests/ui/attributes/rustc_confusables.stderr @@ -29,13 +29,13 @@ LL - #[rustc_confusables(invalid_meta_item)] LL + #[rustc_confusables("name1", "name2", ...)] | -error: `#[rustc_confusables]` attribute cannot be used on functions - --> $DIR/rustc_confusables.rs:45:1 +error: the `rustc_confusables` attribute cannot be used on functions + --> $DIR/rustc_confusables.rs:45:3 | LL | #[rustc_confusables("blah")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_confusables]` can only be applied to inherent methods + = help: the `rustc_confusables` attribute can only be applied to inherent methods error[E0599]: no method named `inser` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope --> $DIR/rustc_confusables.rs:12:7 diff --git a/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr b/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr index 0244527ef34dc..ae91af030a941 100644 --- a/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr +++ b/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr @@ -91,13 +91,13 @@ LL - #[rustc_skip_during_method_dispatch("array")] LL + #[rustc_skip_during_method_dispatch(array, boxed_slice)] | -error: `#[rustc_skip_during_method_dispatch]` attribute cannot be used on trait impl blocks - --> $DIR/rustc_skip_during_method_dispatch.rs:34:1 +error: the `rustc_skip_during_method_dispatch` attribute cannot be used on trait impl blocks + --> $DIR/rustc_skip_during_method_dispatch.rs:34:3 | LL | #[rustc_skip_during_method_dispatch(array)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_skip_during_method_dispatch]` can only be applied to traits + = help: the `rustc_skip_during_method_dispatch` attribute can only be applied to traits error: aborting due to 8 previous errors diff --git a/tests/ui/comptime/comptime_closure.rs b/tests/ui/comptime/comptime_closure.rs index bc3d58104cbc6..64b29997bcda5 100644 --- a/tests/ui/comptime/comptime_closure.rs +++ b/tests/ui/comptime/comptime_closure.rs @@ -2,7 +2,7 @@ const _: () = { let f = #[rustc_comptime] - //~^ ERROR: `#[rustc_comptime]` attribute cannot be used on closures + //~^ ERROR: the `rustc_comptime` attribute cannot be used on closures || (); // FIXME(comptime): closures should work, too. diff --git a/tests/ui/comptime/comptime_closure.stderr b/tests/ui/comptime/comptime_closure.stderr index 602f88e64b7ad..71445e033ff1e 100644 --- a/tests/ui/comptime/comptime_closure.stderr +++ b/tests/ui/comptime/comptime_closure.stderr @@ -1,10 +1,10 @@ -error: `#[rustc_comptime]` attribute cannot be used on closures - --> $DIR/comptime_closure.rs:4:13 +error: the `rustc_comptime` attribute cannot be used on closures + --> $DIR/comptime_closure.rs:4:15 | LL | let f = #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions, inherent impl blocks, and inherent methods + = help: the `rustc_comptime` attribute can be applied to functions, inherent impl blocks, and inherent methods error[E0015]: cannot call non-const closure in constants --> $DIR/comptime_closure.rs:9:5 diff --git a/tests/ui/comptime/comptime_impl.stderr b/tests/ui/comptime/comptime_impl.stderr index 25f5e878b57f6..4231df305cfc1 100644 --- a/tests/ui/comptime/comptime_impl.stderr +++ b/tests/ui/comptime/comptime_impl.stderr @@ -1,10 +1,10 @@ -error: `#[rustc_comptime]` attribute cannot be used on trait impl blocks - --> $DIR/comptime_impl.rs:16:1 +error: the `rustc_comptime` attribute cannot be used on trait impl blocks + --> $DIR/comptime_impl.rs:16:3 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions and inherent impl blocks + = help: the `rustc_comptime` attribute can be applied to functions and inherent impl blocks error[E0277]: the trait bound `Bar: const Foo` is not satisfied --> $DIR/comptime_impl.rs:29:9 diff --git a/tests/ui/comptime/comptime_trait.rs b/tests/ui/comptime/comptime_trait.rs index 6f7b601149191..b7f2ffe7faf3e 100644 --- a/tests/ui/comptime/comptime_trait.rs +++ b/tests/ui/comptime/comptime_trait.rs @@ -1,7 +1,7 @@ #![feature(rustc_attrs, const_trait_impl, trait_alias)] #[rustc_comptime] -//~^ ERROR: `#[rustc_comptime]` attribute cannot be used on traits +//~^ ERROR: the `rustc_comptime` attribute cannot be used on traits trait Trait { fn method(&self) {} } @@ -9,7 +9,7 @@ trait Trait { const impl Trait for () {} #[rustc_comptime] -//~^ ERROR: `#[rustc_comptime]` attribute cannot be used on trait impl +//~^ ERROR: the `rustc_comptime` attribute cannot be used on trait impl impl Trait for u32 { fn method(&self) { comptime_fn(); @@ -20,7 +20,7 @@ impl Trait for u32 { fn comptime_fn() {} #[rustc_comptime] -//~^ ERROR: `#[rustc_comptime]` attribute cannot be used on trait aliases +//~^ ERROR: the `rustc_comptime` attribute cannot be used on trait aliases trait TraitAlias = const Trait; #[rustc_comptime] diff --git a/tests/ui/comptime/comptime_trait.stderr b/tests/ui/comptime/comptime_trait.stderr index 8e9272e238fe1..71fa410608405 100644 --- a/tests/ui/comptime/comptime_trait.stderr +++ b/tests/ui/comptime/comptime_trait.stderr @@ -1,26 +1,26 @@ -error: `#[rustc_comptime]` attribute cannot be used on traits - --> $DIR/comptime_trait.rs:3:1 +error: the `rustc_comptime` attribute cannot be used on traits + --> $DIR/comptime_trait.rs:3:3 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions and inherent impl blocks + = help: the `rustc_comptime` attribute can be applied to functions and inherent impl blocks -error: `#[rustc_comptime]` attribute cannot be used on trait impl blocks - --> $DIR/comptime_trait.rs:11:1 +error: the `rustc_comptime` attribute cannot be used on trait impl blocks + --> $DIR/comptime_trait.rs:11:3 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions and inherent impl blocks + = help: the `rustc_comptime` attribute can be applied to functions and inherent impl blocks -error: `#[rustc_comptime]` attribute cannot be used on trait aliases - --> $DIR/comptime_trait.rs:22:1 +error: the `rustc_comptime` attribute cannot be used on trait aliases + --> $DIR/comptime_trait.rs:22:3 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions and inherent impl blocks + = help: the `rustc_comptime` attribute can be applied to functions and inherent impl blocks error[E0015]: cannot call non-const method `::method` in constants --> $DIR/comptime_trait.rs:28:7 diff --git a/tests/ui/comptime/trait_comptime.stderr b/tests/ui/comptime/trait_comptime.stderr index 0ff981e290b17..2411ebe70759b 100644 --- a/tests/ui/comptime/trait_comptime.stderr +++ b/tests/ui/comptime/trait_comptime.stderr @@ -1,26 +1,26 @@ -error: `#[rustc_comptime]` attribute cannot be used on required trait methods - --> $DIR/trait_comptime.rs:4:5 +error: the `rustc_comptime` attribute cannot be used on required trait methods + --> $DIR/trait_comptime.rs:4:7 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions with a body and inherent impl blocks + = help: the `rustc_comptime` attribute can be applied to functions with a body and inherent impl blocks -error: `#[rustc_comptime]` attribute cannot be used on provided trait methods - --> $DIR/trait_comptime.rs:8:5 +error: the `rustc_comptime` attribute cannot be used on provided trait methods + --> $DIR/trait_comptime.rs:8:7 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions, inherent impl blocks, and inherent methods + = help: the `rustc_comptime` attribute can be applied to functions, inherent impl blocks, and inherent methods -error: `#[rustc_comptime]` attribute cannot be used on trait methods in impl blocks - --> $DIR/trait_comptime.rs:21:5 +error: the `rustc_comptime` attribute cannot be used on trait methods in impl blocks + --> $DIR/trait_comptime.rs:21:7 | LL | #[rustc_comptime] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[rustc_comptime]` can be applied to functions, inherent impl blocks, and inherent methods + = help: the `rustc_comptime` attribute can be applied to functions, inherent impl blocks, and inherent methods error: aborting due to 3 previous errors diff --git a/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.rs b/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.rs index 2264d2ba44a89..7b240bae05cc5 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.rs +++ b/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.rs @@ -6,6 +6,6 @@ fn main() { fn inline_case() { let _x = 30; - #[inline] //~ ERROR `#[inline]` attribute cannot be used on expressions + #[inline] //~ ERROR the `inline` attribute cannot be used on expressions _x //~ ERROR mismatched types } diff --git a/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.stderr b/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.stderr index ee62d232b12a7..70e9698950e1a 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-parsed-span-issue-154801.stderr @@ -11,13 +11,13 @@ LL - #[cfg_attr(, (cc))] LL + #[cfg_attr(predicate, attr1, attr2, ...)] | -error: `#[inline]` attribute cannot be used on expressions - --> $DIR/cfg-attr-parsed-span-issue-154801.rs:9:5 +error: the `inline` attribute cannot be used on expressions + --> $DIR/cfg-attr-parsed-span-issue-154801.rs:9:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions error[E0308]: mismatched types --> $DIR/cfg-attr-parsed-span-issue-154801.rs:4:5 diff --git a/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr index ff7c289ef1f6f..6e557120f8256 100644 --- a/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr +++ b/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr @@ -174,13 +174,13 @@ LL | #[cfg_attr(true, inline(always))] LL | #[cfg_attr(true, inline(never))] | +++++ -warning: `#[link_section]` attribute cannot be used on structs +warning: the `link_section` attribute cannot be used on structs --> $DIR/cfg_attr-attr-syntax-validation.rs:44:18 | LL | #[cfg_attr(true, link_section)] | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` diff --git a/tests/ui/const-generics/invalid-attributes-on-const-params-78957.stderr b/tests/ui/const-generics/invalid-attributes-on-const-params-78957.stderr index cbf9a5a03f881..18a61b8ecf0cd 100644 --- a/tests/ui/const-generics/invalid-attributes-on-const-params-78957.stderr +++ b/tests/ui/const-generics/invalid-attributes-on-const-params-78957.stderr @@ -1,58 +1,58 @@ -error: `#[inline]` attribute cannot be used on const parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:6:16 +error: the `inline` attribute cannot be used on const parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:6:18 | LL | pub struct Foo<#[inline] const N: usize>; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[repr(C)]` attribute cannot be used on const parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:11:16 +error: the `repr(C)` attribute cannot be used on const parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:11:18 | LL | pub struct Baz<#[repr(C)] const N: usize>; - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[inline]` attribute cannot be used on lifetime parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:14:17 +error: the `inline` attribute cannot be used on lifetime parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:14:19 | LL | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>); - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[repr(C)]` attribute cannot be used on lifetime parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:19:17 +error: the `repr(C)` attribute cannot be used on lifetime parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:19:19 | LL | pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>); - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[inline]` attribute cannot be used on type parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:22:17 +error: the `inline` attribute cannot be used on type parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:22:19 | LL | pub struct Foo3<#[inline] T>(PhantomData); - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[repr(C)]` attribute cannot be used on type parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:27:17 +error: the `repr(C)` attribute cannot be used on type parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:27:19 | LL | pub struct Baz3<#[repr(C)] T>(PhantomData); - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[cold]` attribute cannot be used on const parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:8:16 +error: the `cold` attribute cannot be used on const parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:8:18 | LL | pub struct Bar<#[cold] const N: usize>; - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/invalid-attributes-on-const-params-78957.rs:2:9 @@ -60,22 +60,22 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: `#[cold]` attribute cannot be used on lifetime parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:16:17 +error: the `cold` attribute cannot be used on lifetime parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:16:19 | LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>); - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[cold]` attribute cannot be used on type parameters - --> $DIR/invalid-attributes-on-const-params-78957.rs:24:17 +error: the `cold` attribute cannot be used on type parameters + --> $DIR/invalid-attributes-on-const-params-78957.rs:24:19 | LL | pub struct Bar3<#[cold] T>(PhantomData); - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 9 previous errors diff --git a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.rs b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.rs index 03a28fac95def..539fbec048864 100644 --- a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.rs +++ b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.rs @@ -17,7 +17,7 @@ fn foo4() {} //~^^ ERROR malformed `rustc_legacy_const_generics` attribute input fn foo5() {} -#[rustc_legacy_const_generics(0)] //~ ERROR `#[rustc_legacy_const_generics]` attribute cannot be used on structs +#[rustc_legacy_const_generics(0)] //~ ERROR the `rustc_legacy_const_generics` attribute cannot be used on structs struct S; #[rustc_legacy_const_generics(0usize)] @@ -26,7 +26,7 @@ struct S; fn foo6() {} extern "C" { - #[rustc_legacy_const_generics(1)] //~ ERROR `#[rustc_legacy_const_generics]` attribute cannot be used on foreign functions + #[rustc_legacy_const_generics(1)] //~ ERROR the `rustc_legacy_const_generics` attribute cannot be used on foreign functions fn foo7(); //~ ERROR foreign items may not have const parameters } @@ -34,7 +34,7 @@ extern "C" { fn foo8() {} impl S { - #[rustc_legacy_const_generics(0)] //~ ERROR `#[rustc_legacy_const_generics]` attribute cannot be used on inherent methods + #[rustc_legacy_const_generics(0)] //~ ERROR the `rustc_legacy_const_generics` attribute cannot be used on inherent methods fn foo9() {} } diff --git a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr index c1fde24ed04cf..69e3ccc7da3cc 100644 --- a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr +++ b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr @@ -40,13 +40,13 @@ LL - #[rustc_legacy_const_generics(1, a, 2, b)] LL + #[rustc_legacy_const_generics(N)] | -error: `#[rustc_legacy_const_generics]` attribute cannot be used on structs - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:20:1 +error: the `rustc_legacy_const_generics` attribute cannot be used on structs + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:20:3 | LL | #[rustc_legacy_const_generics(0)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_legacy_const_generics]` can only be applied to functions + = help: the `rustc_legacy_const_generics` attribute can only be applied to functions error: suffixed literals are not allowed in attributes --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:23:31 @@ -70,21 +70,21 @@ LL - #[rustc_legacy_const_generics(0usize)] LL + #[rustc_legacy_const_generics(N)] | -error: `#[rustc_legacy_const_generics]` attribute cannot be used on foreign functions - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:5 +error: the `rustc_legacy_const_generics` attribute cannot be used on foreign functions + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:29:7 | LL | #[rustc_legacy_const_generics(1)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_legacy_const_generics]` can only be applied to functions + = help: the `rustc_legacy_const_generics` attribute can only be applied to functions -error: `#[rustc_legacy_const_generics]` attribute cannot be used on inherent methods - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:37:5 +error: the `rustc_legacy_const_generics` attribute cannot be used on inherent methods + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:37:7 | LL | #[rustc_legacy_const_generics(0)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_legacy_const_generics]` can only be applied to functions + = help: the `rustc_legacy_const_generics` attribute can only be applied to functions error[E0539]: malformed `rustc_legacy_const_generics` attribute input --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:41:1 diff --git a/tests/ui/coroutine/invalid_attr_usage.stderr b/tests/ui/coroutine/invalid_attr_usage.stderr index 46fc80c1bad49..7c0d8e98eb2aa 100644 --- a/tests/ui/coroutine/invalid_attr_usage.stderr +++ b/tests/ui/coroutine/invalid_attr_usage.stderr @@ -1,18 +1,18 @@ -error: `#[coroutine]` attribute cannot be used on structs - --> $DIR/invalid_attr_usage.rs:5:1 +error: the `coroutine` attribute cannot be used on structs + --> $DIR/invalid_attr_usage.rs:5:3 | LL | #[coroutine] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[coroutine]` can only be applied to closures + = help: the `coroutine` attribute can only be applied to closures -error: `#[coroutine]` attribute cannot be used on functions - --> $DIR/invalid_attr_usage.rs:9:1 +error: the `coroutine` attribute cannot be used on functions + --> $DIR/invalid_attr_usage.rs:9:3 | LL | #[coroutine] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[coroutine]` can only be applied to closures + = help: the `coroutine` attribute can only be applied to closures error: aborting due to 2 previous errors diff --git a/tests/ui/coverage-attr/allowed-positions.stderr b/tests/ui/coverage-attr/allowed-positions.stderr index ae7e1d2fea980..e3e1e67bf7375 100644 --- a/tests/ui/coverage-attr/allowed-positions.stderr +++ b/tests/ui/coverage-attr/allowed-positions.stderr @@ -8,141 +8,141 @@ LL | let _closure_expr = #[coverage(off)] || (); = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[coverage]` attribute cannot be used on type aliases - --> $DIR/allowed-positions.rs:14:1 +error: the `coverage` attribute cannot be used on type aliases + --> $DIR/allowed-positions.rs:14:3 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on traits - --> $DIR/allowed-positions.rs:17:1 +error: the `coverage` attribute cannot be used on traits + --> $DIR/allowed-positions.rs:17:3 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/allowed-positions.rs:19:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/allowed-positions.rs:19:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:22:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/allowed-positions.rs:22:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:25:5 +error: the `coverage` attribute cannot be used on required trait methods + --> $DIR/allowed-positions.rs:25:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions with a body, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:31:5 +error: the `coverage` attribute cannot be used on required trait methods + --> $DIR/allowed-positions.rs:31:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions with a body, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:39:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/allowed-positions.rs:39:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:56:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/allowed-positions.rs:56:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on structs - --> $DIR/allowed-positions.rs:61:1 +error: the `coverage` attribute cannot be used on structs + --> $DIR/allowed-positions.rs:61:3 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on struct fields - --> $DIR/allowed-positions.rs:63:5 +error: the `coverage` attribute cannot be used on struct fields + --> $DIR/allowed-positions.rs:63:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on foreign statics - --> $DIR/allowed-positions.rs:76:5 +error: the `coverage` attribute cannot be used on foreign statics + --> $DIR/allowed-positions.rs:76:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on foreign types - --> $DIR/allowed-positions.rs:79:5 +error: the `coverage` attribute cannot be used on foreign types + --> $DIR/allowed-positions.rs:79:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on foreign functions - --> $DIR/allowed-positions.rs:82:5 +error: the `coverage` attribute cannot be used on foreign functions + --> $DIR/allowed-positions.rs:82:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions with a body, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:88:5 +error: the `coverage` attribute cannot be used on statements + --> $DIR/allowed-positions.rs:88:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:94:5 +error: the `coverage` attribute cannot be used on statements + --> $DIR/allowed-positions.rs:94:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on match arms - --> $DIR/allowed-positions.rs:110:9 +error: the `coverage` attribute cannot be used on match arms + --> $DIR/allowed-positions.rs:110:11 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules -error: `#[coverage]` attribute cannot be used on expressions - --> $DIR/allowed-positions.rs:114:5 +error: the `coverage` attribute cannot be used on expressions + --> $DIR/allowed-positions.rs:114:7 | LL | #[coverage(off)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: aborting due to 18 previous errors diff --git a/tests/ui/coverage-attr/name-value.stderr b/tests/ui/coverage-attr/name-value.stderr index d15be83465fd3..02421774e9363 100644 --- a/tests/ui/coverage-attr/name-value.stderr +++ b/tests/ui/coverage-attr/name-value.stderr @@ -49,13 +49,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on structs - --> $DIR/name-value.rs:21:1 +error: the `coverage` attribute cannot be used on structs + --> $DIR/name-value.rs:21:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:26:1 @@ -91,13 +91,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/name-value.rs:29:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/name-value.rs:29:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:35:1 @@ -116,13 +116,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on traits - --> $DIR/name-value.rs:35:1 +error: the `coverage` attribute cannot be used on traits + --> $DIR/name-value.rs:35:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:39:5 @@ -141,13 +141,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/name-value.rs:39:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/name-value.rs:39:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:44:5 @@ -166,13 +166,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/name-value.rs:44:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/name-value.rs:44:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:50:1 @@ -208,13 +208,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/name-value.rs:53:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/name-value.rs:53:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:58:5 @@ -233,13 +233,13 @@ LL - #[coverage = "off"] LL + #[coverage(on)] | -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/name-value.rs:58:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/name-value.rs:58:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/name-value.rs:64:1 diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index 481010415237d..a7cdb1e7c7723 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -37,13 +37,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on structs - --> $DIR/word-only.rs:21:1 +error: the `coverage` attribute cannot be used on structs + --> $DIR/word-only.rs:21:3 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:26:1 @@ -71,13 +71,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/word-only.rs:29:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/word-only.rs:29:7 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:35:1 @@ -92,13 +92,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on traits - --> $DIR/word-only.rs:35:1 +error: the `coverage` attribute cannot be used on traits + --> $DIR/word-only.rs:35:3 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:39:5 @@ -113,13 +113,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/word-only.rs:39:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/word-only.rs:39:7 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:44:5 @@ -134,13 +134,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/word-only.rs:44:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/word-only.rs:44:7 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:50:1 @@ -168,13 +168,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on associated consts - --> $DIR/word-only.rs:53:5 +error: the `coverage` attribute cannot be used on associated consts + --> $DIR/word-only.rs:53:7 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:58:5 @@ -189,13 +189,13 @@ LL | #[coverage(off)] LL | #[coverage(on)] | ++++ -error: `#[coverage]` attribute cannot be used on associated types - --> $DIR/word-only.rs:58:5 +error: the `coverage` attribute cannot be used on associated types + --> $DIR/word-only.rs:58:7 | LL | #[coverage] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[coverage]` can be applied to crates, functions, impl blocks, and modules + = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input --> $DIR/word-only.rs:64:1 diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr index 228d5fb299203..e38645655a8a5 100644 --- a/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.ice_155127.stderr @@ -1,10 +1,10 @@ -error: `#[deprecated]` attribute cannot be used on delegations - --> $DIR/hir-crate-items-before-lowering-ices.rs:27:9 +error: the `deprecated` attribute cannot be used on delegations + --> $DIR/hir-crate-items-before-lowering-ices.rs:27:11 | LL | #[deprecated] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: `#[deny(useless_deprecated)]` on by default diff --git a/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs b/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs index aaf84514eb784..7c8e9481d850a 100644 --- a/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs +++ b/tests/ui/delegation/hir-crate-items-before-lowering-ices.rs @@ -24,7 +24,7 @@ mod ice_155127 { fn foo() {} impl S { - #[deprecated] //[ice_155127]~ ERROR: `#[deprecated]` attribute cannot be used on delegations + #[deprecated] //[ice_155127]~ ERROR: the `deprecated` attribute cannot be used on delegations //[ice_155127]~^ WARN: this was previously accepted by the compiler but is being phased out; reuse foo; } diff --git a/tests/ui/deprecation/deprecated-expr-precedence.stderr b/tests/ui/deprecation/deprecated-expr-precedence.stderr index 2fa398c2ee47e..b86588acda7cb 100644 --- a/tests/ui/deprecation/deprecated-expr-precedence.stderr +++ b/tests/ui/deprecation/deprecated-expr-precedence.stderr @@ -1,10 +1,10 @@ -warning: `#[deprecated]` attribute cannot be used on expressions - --> $DIR/deprecated-expr-precedence.rs:6:5 +warning: the `deprecated` attribute cannot be used on expressions + --> $DIR/deprecated-expr-precedence.rs:6:7 | LL | #[deprecated] 0 - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` diff --git a/tests/ui/deprecation/deprecation-sanity.stderr b/tests/ui/deprecation/deprecation-sanity.stderr index 997cb1fb8c267..b11b3bae3e18d 100644 --- a/tests/ui/deprecation/deprecation-sanity.stderr +++ b/tests/ui/deprecation/deprecation-sanity.stderr @@ -95,13 +95,13 @@ LL | #[deprecated(since = "a", since = "b", note = "c")] | | | found `since` used as a key more than once -error: `#[deprecated]` attribute cannot be used on trait impl blocks - --> $DIR/deprecation-sanity.rs:40:1 +error: the `deprecated` attribute cannot be used on trait impl blocks + --> $DIR/deprecation-sanity.rs:40:3 | LL | #[deprecated = "hello"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: `#[deny(useless_deprecated)]` on by default diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr b/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr index 4a131b9c2a2a6..ab48b3b9a1b14 100644 --- a/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr +++ b/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr @@ -1,75 +1,75 @@ -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on constants - --> $DIR/incorrect-locations.rs:7:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on constants + --> $DIR/incorrect-locations.rs:7:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on statics - --> $DIR/incorrect-locations.rs:11:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on statics + --> $DIR/incorrect-locations.rs:11:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on type aliases - --> $DIR/incorrect-locations.rs:15:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on type aliases + --> $DIR/incorrect-locations.rs:15:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on enums - --> $DIR/incorrect-locations.rs:19:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on enums + --> $DIR/incorrect-locations.rs:19:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on inherent impl blocks - --> $DIR/incorrect-locations.rs:23:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on inherent impl blocks + --> $DIR/incorrect-locations.rs:23:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on foreign modules - --> $DIR/incorrect-locations.rs:27:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on foreign modules + --> $DIR/incorrect-locations.rs:27:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on functions - --> $DIR/incorrect-locations.rs:31:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on functions + --> $DIR/incorrect-locations.rs:31:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on structs - --> $DIR/incorrect-locations.rs:35:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on structs + --> $DIR/incorrect-locations.rs:35:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on traits - --> $DIR/incorrect-locations.rs:39:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on traits + --> $DIR/incorrect-locations.rs:39:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks warning: 9 warnings emitted diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr b/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr index 4a131b9c2a2a6..ab48b3b9a1b14 100644 --- a/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr +++ b/tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr @@ -1,75 +1,75 @@ -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on constants - --> $DIR/incorrect-locations.rs:7:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on constants + --> $DIR/incorrect-locations.rs:7:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on statics - --> $DIR/incorrect-locations.rs:11:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on statics + --> $DIR/incorrect-locations.rs:11:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on type aliases - --> $DIR/incorrect-locations.rs:15:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on type aliases + --> $DIR/incorrect-locations.rs:15:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on enums - --> $DIR/incorrect-locations.rs:19:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on enums + --> $DIR/incorrect-locations.rs:19:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on inherent impl blocks - --> $DIR/incorrect-locations.rs:23:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on inherent impl blocks + --> $DIR/incorrect-locations.rs:23:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on foreign modules - --> $DIR/incorrect-locations.rs:27:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on foreign modules + --> $DIR/incorrect-locations.rs:27:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on functions - --> $DIR/incorrect-locations.rs:31:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on functions + --> $DIR/incorrect-locations.rs:31:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on structs - --> $DIR/incorrect-locations.rs:35:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on structs + --> $DIR/incorrect-locations.rs:35:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks -warning: `#[diagnostic::do_not_recommend]` attribute cannot be used on traits - --> $DIR/incorrect-locations.rs:39:1 +warning: the `diagnostic::do_not_recommend` attribute cannot be used on traits + --> $DIR/incorrect-locations.rs:39:3 | LL | #[diagnostic::do_not_recommend] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::do_not_recommend]` can only be applied to trait impl blocks + = help: the `diagnostic::do_not_recommend` attribute can only be applied to trait impl blocks warning: 9 warnings emitted diff --git a/tests/ui/diagnostic_namespace/on_const/misplaced_attr.stderr b/tests/ui/diagnostic_namespace/on_const/misplaced_attr.stderr index 89df20ccfc668..8509b251a1b39 100644 --- a/tests/ui/diagnostic_namespace/on_const/misplaced_attr.stderr +++ b/tests/ui/diagnostic_namespace/on_const/misplaced_attr.stderr @@ -13,29 +13,29 @@ note: the lint level is defined here LL | #![deny(misplaced_diagnostic_attributes)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[diagnostic::on_const]` attribute cannot be used on structs - --> $DIR/misplaced_attr.rs:4:1 +error: the `diagnostic::on_const` attribute cannot be used on structs + --> $DIR/misplaced_attr.rs:4:3 | LL | #[diagnostic::on_const(message = "tadaa", note = "boing")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_const]` can only be applied to trait impl blocks + = help: the `diagnostic::on_const` attribute can only be applied to trait impl blocks -error: `#[diagnostic::on_const]` attribute cannot be used on inherent impl blocks - --> $DIR/misplaced_attr.rs:16:1 +error: the `diagnostic::on_const` attribute cannot be used on inherent impl blocks + --> $DIR/misplaced_attr.rs:16:3 | LL | #[diagnostic::on_const(message = "tadaa", note = "boing")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_const]` can only be applied to trait impl blocks + = help: the `diagnostic::on_const` attribute can only be applied to trait impl blocks -error: `#[diagnostic::on_const]` attribute cannot be used on trait methods in impl blocks - --> $DIR/misplaced_attr.rs:25:5 +error: the `diagnostic::on_const` attribute cannot be used on trait methods in impl blocks + --> $DIR/misplaced_attr.rs:25:7 | LL | #[diagnostic::on_const(message = "tadaa", note = "boing")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_const]` can only be applied to trait impl blocks + = help: the `diagnostic::on_const` attribute can only be applied to trait impl blocks error: aborting due to 4 previous errors diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.rs b/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.rs index 8de8a29be77aa..ccec2cff7d1eb 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.rs +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.rs @@ -7,7 +7,7 @@ struct Foo; #[diagnostic::on_move( -//~^WARN `#[diagnostic::on_move]` attribute cannot be used on traits +//~^WARN the `diagnostic::on_move` attribute cannot be used on traits message = "Foo", label = "Bar", )] diff --git a/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.stderr b/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.stderr index 821feabe4de98..010af259e4f33 100644 --- a/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.stderr +++ b/tests/ui/diagnostic_namespace/on_move/report_warning_on_non_adt.stderr @@ -1,14 +1,10 @@ -warning: `#[diagnostic::on_move]` attribute cannot be used on traits - --> $DIR/report_warning_on_non_adt.rs:9:1 +warning: the `diagnostic::on_move` attribute cannot be used on traits + --> $DIR/report_warning_on_non_adt.rs:9:3 | -LL | / #[diagnostic::on_move( -LL | | -LL | | message = "Foo", -LL | | label = "Bar", -LL | | )] - | |__^ +LL | #[diagnostic::on_move( + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_move]` can only be applied to data types + = help: the `diagnostic::on_move` attribute can only be applied to data types = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default error[E0382]: Foo diff --git a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.stderr b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.stderr index a79d396397042..9ef283dd436a0 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.stderr +++ b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.stderr @@ -1,51 +1,51 @@ -warning: `#[diagnostic::on_type_error]` attribute cannot be used on functions - --> $DIR/report_warning_on_non_adt.rs:3:1 +warning: the `diagnostic::on_type_error` attribute cannot be used on functions + --> $DIR/report_warning_on_non_adt.rs:3:3 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: `#[diagnostic::on_type_error]` attribute cannot be used on statics - --> $DIR/report_warning_on_non_adt.rs:7:1 +warning: the `diagnostic::on_type_error` attribute cannot be used on statics + --> $DIR/report_warning_on_non_adt.rs:7:3 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types -warning: `#[diagnostic::on_type_error]` attribute cannot be used on modules - --> $DIR/report_warning_on_non_adt.rs:11:1 +warning: the `diagnostic::on_type_error` attribute cannot be used on modules + --> $DIR/report_warning_on_non_adt.rs:11:3 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types -warning: `#[diagnostic::on_type_error]` attribute cannot be used on traits - --> $DIR/report_warning_on_non_adt.rs:15:1 +warning: the `diagnostic::on_type_error` attribute cannot be used on traits + --> $DIR/report_warning_on_non_adt.rs:15:3 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types -warning: `#[diagnostic::on_type_error]` attribute cannot be used on type aliases - --> $DIR/report_warning_on_non_adt.rs:19:1 +warning: the `diagnostic::on_type_error` attribute cannot be used on type aliases + --> $DIR/report_warning_on_non_adt.rs:19:3 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types -warning: `#[diagnostic::on_type_error]` attribute cannot be used on inherent methods - --> $DIR/report_warning_on_non_adt.rs:26:5 +warning: the `diagnostic::on_type_error` attribute cannot be used on inherent methods + --> $DIR/report_warning_on_non_adt.rs:26:7 | LL | #[diagnostic::on_type_error(note = "custom on_type_error note: not an ADT")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_type_error]` can only be applied to data types + = help: the `diagnostic::on_type_error` attribute can only be applied to data types error[E0308]: mismatched types --> $DIR/report_warning_on_non_adt.rs:38:25 diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr index 4059bcaec7573..566ff1493e769 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr @@ -152,13 +152,13 @@ LL | #[diagnostic::on_unimplemented = "Message"] | = help: only `message`, `note` and `label` are allowed as options -warning: `#[diagnostic::on_unimplemented]` attribute cannot be used on trait impl blocks - --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:22:1 +warning: the `diagnostic::on_unimplemented` attribute cannot be used on trait impl blocks + --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:22:3 | LL | #[diagnostic::on_unimplemented(message = "Not allowed to apply it on a impl")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unimplemented]` can only be applied to traits + = help: the `diagnostic::on_unimplemented` attribute can only be applied to traits = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: format specifiers are not permitted in diagnostic attributes diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr index 739bd598e9c69..e47c8102d0b55 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr @@ -16,13 +16,13 @@ LL | #[diagnostic::on_unimplemented(unsupported = "foo")] = help: only `message`, `note` and `label` are allowed as options = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: `#[diagnostic::on_unimplemented]` attribute cannot be used on structs - --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:7:1 +warning: the `diagnostic::on_unimplemented` attribute cannot be used on structs + --> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:7:3 | LL | #[diagnostic::on_unimplemented(message = "Baz")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unimplemented]` can only be applied to traits + = help: the `diagnostic::on_unimplemented` attribute can only be applied to traits = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: malformed `diagnostic::on_unimplemented` attribute diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr index a9a38da242268..0eb00461f5524 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr @@ -1,10 +1,10 @@ -warning: `#[diagnostic::on_unimplemented]` attribute cannot be used on trait aliases - --> $DIR/on_impl_trait.rs:8:1 +warning: the `diagnostic::on_unimplemented` attribute cannot be used on trait aliases + --> $DIR/on_impl_trait.rs:8:3 | LL | #[diagnostic::on_unimplemented(message = "blah", label = "blah", note = "blah")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unimplemented]` can only be applied to traits + = help: the `diagnostic::on_unimplemented` attribute can only be applied to traits = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default error[E0277]: the trait bound `{integer}: Alias` is not satisfied diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr index 81508568d0e0e..150a5521792f5 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr @@ -1,91 +1,91 @@ -warning: `#[diagnostic::on_unknown]` attribute cannot be used on extern crates - --> $DIR/incorrect_locations.rs:5:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on extern crates + --> $DIR/incorrect_locations.rs:5:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: `#[diagnostic::on_unknown]` attribute cannot be used on constants - --> $DIR/incorrect_locations.rs:9:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on constants + --> $DIR/incorrect_locations.rs:9:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on statics - --> $DIR/incorrect_locations.rs:13:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on statics + --> $DIR/incorrect_locations.rs:13:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on type aliases - --> $DIR/incorrect_locations.rs:17:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on type aliases + --> $DIR/incorrect_locations.rs:17:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on enums - --> $DIR/incorrect_locations.rs:21:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on enums + --> $DIR/incorrect_locations.rs:21:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on inherent impl blocks - --> $DIR/incorrect_locations.rs:25:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on inherent impl blocks + --> $DIR/incorrect_locations.rs:25:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on foreign modules - --> $DIR/incorrect_locations.rs:29:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on foreign modules + --> $DIR/incorrect_locations.rs:29:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on functions - --> $DIR/incorrect_locations.rs:33:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on functions + --> $DIR/incorrect_locations.rs:33:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on structs - --> $DIR/incorrect_locations.rs:37:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on structs + --> $DIR/incorrect_locations.rs:37:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on traits - --> $DIR/incorrect_locations.rs:41:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on traits + --> $DIR/incorrect_locations.rs:41:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements -warning: `#[diagnostic::on_unknown]` attribute cannot be used on trait impl blocks - --> $DIR/incorrect_locations.rs:45:1 +warning: the `diagnostic::on_unknown` attribute cannot be used on trait impl blocks + --> $DIR/incorrect_locations.rs:45:3 | LL | #[diagnostic::on_unknown(message = "foo")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: 11 warnings emitted diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr index dc02dc4272487..f69a545526ca4 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr @@ -1,10 +1,10 @@ -warning: `#[diagnostic::on_unknown]` attribute cannot be used on expressions - --> $DIR/incorrect_unstable_positions.rs:8:5 +warning: the `diagnostic::on_unknown` attribute cannot be used on expressions + --> $DIR/incorrect_unstable_positions.rs:8:7 | LL | #[diagnostic::on_unknown(message = "anonymous block")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unknown]` can be applied to crates, modules, and use statements + = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: 1 warning emitted diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_non_macro.stderr b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_non_macro.stderr index bd94410ff72f7..bad26db7271a1 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_non_macro.stderr +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_non_macro.stderr @@ -1,10 +1,10 @@ -warning: `#[diagnostic::on_unmatched_args]` attribute cannot be used on structs - --> $DIR/report_warning_on_non_macro.rs:4:1 +warning: the `diagnostic::on_unmatched_args` attribute cannot be used on structs + --> $DIR/report_warning_on_non_macro.rs:4:3 | LL | #[diagnostic::on_unmatched_args(message = "not allowed here")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[diagnostic::on_unmatched_args]` can only be applied to macro defs + = help: the `diagnostic::on_unmatched_args` attribute can only be applied to macro defs = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: 1 warning emitted diff --git a/tests/ui/eii/track_caller_static_errors.rs b/tests/ui/eii/track_caller_static_errors.rs index 8bd12de5ad8c8..826e7d7a78473 100644 --- a/tests/ui/eii/track_caller_static_errors.rs +++ b/tests/ui/eii/track_caller_static_errors.rs @@ -2,7 +2,7 @@ // `#[track_caller]` is only valid on functions, not on EII (foreign) statics. #![feature(extern_item_impls)] -#[track_caller] //~ ERROR `#[track_caller]` attribute cannot be used on foreign statics +#[track_caller] //~ ERROR the `track_caller` attribute cannot be used on foreign statics #[eii(sfoo)] static FOO: u64 = 42; diff --git a/tests/ui/eii/track_caller_static_errors.stderr b/tests/ui/eii/track_caller_static_errors.stderr index 6b85ace2b0409..78b13c96632eb 100644 --- a/tests/ui/eii/track_caller_static_errors.stderr +++ b/tests/ui/eii/track_caller_static_errors.stderr @@ -1,10 +1,10 @@ -error: `#[track_caller]` attribute cannot be used on foreign statics - --> $DIR/track_caller_static_errors.rs:5:1 +error: the `track_caller` attribute cannot be used on foreign statics + --> $DIR/track_caller_static_errors.rs:5:3 | LL | #[track_caller] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[track_caller]` can only be applied to functions + = help: the `track_caller` attribute can only be applied to functions error: aborting due to 1 previous error diff --git a/tests/ui/enum-discriminant/eval-error.stderr b/tests/ui/enum-discriminant/eval-error.stderr index d355ac3ec04b0..5f9b5e3b71edd 100644 --- a/tests/ui/enum-discriminant/eval-error.stderr +++ b/tests/ui/enum-discriminant/eval-error.stderr @@ -4,13 +4,13 @@ error: unions cannot have zero fields LL | union Foo2 {} | ^^^^^^^^^^^^^ -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/eval-error.rs:24:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/eval-error.rs:24:3 | LL | #[repr(u8, packed)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/eval-error.rs:2:5 diff --git a/tests/ui/error-codes/E0718.rs b/tests/ui/error-codes/E0718.rs index 87e366c91a609..e48ac0a16c949 100644 --- a/tests/ui/error-codes/E0718.rs +++ b/tests/ui/error-codes/E0718.rs @@ -1,7 +1,7 @@ #![feature(lang_items)] // Box is expected to be a struct, so this will error. -#[lang = "owned_box"] //~ ERROR `#[lang = "owned_box"]` attribute cannot be used on statics +#[lang = "owned_box"] //~ ERROR the `lang = "owned_box"` attribute cannot be used on statics static X: u32 = 42; fn main() {} diff --git a/tests/ui/error-codes/E0718.stderr b/tests/ui/error-codes/E0718.stderr index 873c714df8c2f..8c0cd42415f4c 100644 --- a/tests/ui/error-codes/E0718.stderr +++ b/tests/ui/error-codes/E0718.stderr @@ -1,10 +1,10 @@ -error: `#[lang = "owned_box"]` attribute cannot be used on statics - --> $DIR/E0718.rs:4:1 +error: the `lang = "owned_box"` attribute cannot be used on statics + --> $DIR/E0718.rs:4:3 | LL | #[lang = "owned_box"] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[lang = "owned_box"]` can only be applied to structs + = help: the `lang = "owned_box"` attribute can only be applied to structs error: aborting due to 1 previous error diff --git a/tests/ui/extern/extern-no-mangle.stderr b/tests/ui/extern/extern-no-mangle.stderr index f25d74a8bb96b..210beb1e70929 100644 --- a/tests/ui/extern/extern-no-mangle.stderr +++ b/tests/ui/extern/extern-no-mangle.stderr @@ -1,10 +1,10 @@ -warning: `#[no_mangle]` attribute cannot be used on statements - --> $DIR/extern-no-mangle.rs:24:5 +warning: the `no_mangle` attribute cannot be used on statements + --> $DIR/extern-no-mangle.rs:24:7 | LL | #[no_mangle] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/extern-no-mangle.rs:1:9 @@ -12,22 +12,22 @@ note: the lint level is defined here LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -warning: `#[no_mangle]` attribute cannot be used on foreign statics - --> $DIR/extern-no-mangle.rs:11:5 +warning: the `no_mangle` attribute cannot be used on foreign statics + --> $DIR/extern-no-mangle.rs:11:7 | LL | #[no_mangle] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on foreign functions - --> $DIR/extern-no-mangle.rs:16:5 +warning: the `no_mangle` attribute cannot be used on foreign functions + --> $DIR/extern-no-mangle.rs:16:7 | LL | #[no_mangle] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions with a body and statics + = help: the `no_mangle` attribute can be applied to functions with a body and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: 3 warnings emitted diff --git a/tests/ui/extern/issue-47725.stderr b/tests/ui/extern/issue-47725.stderr index de18b5b8a730f..7447dcc1d9483 100644 --- a/tests/ui/extern/issue-47725.stderr +++ b/tests/ui/extern/issue-47725.stderr @@ -10,13 +10,13 @@ help: must be of the form LL | #[link_name = "name"] | ++++++++ -warning: `#[link_name]` attribute cannot be used on structs - --> $DIR/issue-47725.rs:4:1 +warning: the `link_name` attribute cannot be used on structs + --> $DIR/issue-47725.rs:4:3 | LL | #[link_name = "foo"] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/issue-47725.rs:2:9 @@ -24,22 +24,22 @@ note: the lint level is defined here LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -warning: `#[link_name]` attribute cannot be used on foreign modules - --> $DIR/issue-47725.rs:11:1 +warning: the `link_name` attribute cannot be used on foreign modules + --> $DIR/issue-47725.rs:11:3 | LL | #[link_name = "foobar"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on foreign modules - --> $DIR/issue-47725.rs:20:1 +warning: the `link_name` attribute cannot be used on foreign modules + --> $DIR/issue-47725.rs:20:3 | LL | #[link_name] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 1 previous error; 3 warnings emitted diff --git a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr index 8a446d455a5b5..777f64319d1a6 100644 --- a/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr +++ b/tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr @@ -7,13 +7,13 @@ LL | #[allow_internal_unstable(something)] = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[allow_internal_unstable]` attribute cannot be used on structs - --> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1 +error: the `allow_internal_unstable` attribute cannot be used on structs + --> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:3 | LL | #[allow_internal_unstable(something)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[allow_internal_unstable]` can be applied to functions and macro defs + = help: the `allow_internal_unstable` attribute can be applied to functions and macro defs error: aborting due to 2 previous errors diff --git a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs index 66a038c4ad90f..91e844aa0b9b1 100644 --- a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs +++ b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.rs @@ -7,7 +7,7 @@ macro_rules! foo ( () => ( #[allow_internal_unstable()] //~^ ERROR the `allow_internal_unstable` attribute side-steps - //~| ERROR `#[allow_internal_unstable]` attribute cannot be used on macro calls + //~| ERROR the `allow_internal_unstable` attribute cannot be used on macro calls bar!(); ); ); diff --git a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr index aa8e105d0e36f..7838d8a32b292 100644 --- a/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr +++ b/tests/ui/feature-gates/feature-gate-check-nested-macro-invocation.stderr @@ -11,16 +11,16 @@ LL | foo!(); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) -error: `#[allow_internal_unstable]` attribute cannot be used on macro calls - --> $DIR/feature-gate-check-nested-macro-invocation.rs:8:9 +error: the `allow_internal_unstable` attribute cannot be used on macro calls + --> $DIR/feature-gate-check-nested-macro-invocation.rs:8:11 | LL | #[allow_internal_unstable()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ ... LL | foo!(); | ------ in this macro invocation | - = help: `#[allow_internal_unstable]` can be applied to functions and macro defs + = help: the `allow_internal_unstable` attribute can be applied to functions and macro defs = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/feature-gates/feature-gate-repr-simd.stderr b/tests/ui/feature-gates/feature-gate-repr-simd.stderr index 82ded7e300122..a43e9f4cea342 100644 --- a/tests/ui/feature-gates/feature-gate-repr-simd.stderr +++ b/tests/ui/feature-gates/feature-gate-repr-simd.stderr @@ -28,13 +28,13 @@ LL | #[repr(simd)] = help: add `#![feature(repr_simd)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[repr(simd)]` attribute cannot be used on unions - --> $DIR/feature-gate-repr-simd.rs:9:1 +error: the `repr(simd)` attribute cannot be used on unions + --> $DIR/feature-gate-repr-simd.rs:9:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs error[E0658]: SIMD types are experimental and possibly buggy --> $DIR/feature-gate-repr-simd.rs:13:8 @@ -46,13 +46,13 @@ LL | #[repr(simd)] = help: add `#![feature(repr_simd)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[repr(simd)]` attribute cannot be used on enums - --> $DIR/feature-gate-repr-simd.rs:13:1 +error: the `repr(simd)` attribute cannot be used on enums + --> $DIR/feature-gate-repr-simd.rs:13:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs error[E0566]: conflicting representation hints --> $DIR/feature-gate-repr-simd.rs:4:8 diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs index ac954e31b82cc..3cc404416839e 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs @@ -7,9 +7,9 @@ #![macro_export] -//~^ ERROR: `#[macro_export]` attribute cannot be used on crates +//~^ ERROR: the `macro_export` attribute cannot be used on crates #![rustc_main] -//~^ ERROR: `#[rustc_main]` attribute cannot be used on crates +//~^ ERROR: the `rustc_main` attribute cannot be used on crates //~| ERROR: use of an internal attribute [E0658] //~| NOTE: the `rustc_main` attribute is an internal implementation detail that will never be stable //~| NOTE: the `rustc_main` attribute is used internally to specify test entry point function @@ -28,7 +28,7 @@ //~| WARN cannot be used on crates //~| WARN previously accepted #![no_link] -//~^ ERROR: `#[no_link]` attribute cannot be used on crates +//~^ ERROR: the `no_link` attribute cannot be used on crates #![export_name = "2200"] //~^ ERROR: attribute cannot be used on //~| NOTE takes precedence @@ -57,38 +57,38 @@ mod inline { } #[no_link] -//~^ ERROR `#[no_link]` attribute cannot be used on modules +//~^ ERROR the `no_link` attribute cannot be used on modules mod no_link { mod inner { #![no_link] } - //~^ ERROR `#[no_link]` attribute cannot be used on modules + //~^ ERROR the `no_link` attribute cannot be used on modules #[no_link] fn f() { - //~^ ERROR `#[no_link]` attribute cannot be used on functions + //~^ ERROR the `no_link` attribute cannot be used on functions match () { #[no_link] - //~^ WARN `#[no_link]` attribute cannot be used on match arms [unused_attributes] + //~^ WARN the `no_link` attribute cannot be used on match arms [unused_attributes] //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! _ => () } } #[no_link] - //~^ ERROR `#[no_link]` attribute cannot be used on structs + //~^ ERROR the `no_link` attribute cannot be used on structs struct S { #[no_link] - //~^ WARN `#[no_link]` attribute cannot be used on struct fields [unused_attributes] + //~^ WARN the `no_link` attribute cannot be used on struct fields [unused_attributes] //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! field: () } #[no_link]type T = S; - //~^ ERROR `#[no_link]` attribute cannot be used on type aliases + //~^ ERROR the `no_link` attribute cannot be used on type aliases #[no_link] impl S { } - //~^ ERROR `#[no_link]` attribute cannot be used on inherent impl blocks + //~^ ERROR the `no_link` attribute cannot be used on inherent impl blocks #[no_link] - //~^ WARN `#[no_link]` attribute cannot be used on macro defs + //~^ WARN the `no_link` attribute cannot be used on macro defs //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! macro_rules! m{() => {}} } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr index aaac5ddec51c1..e859683caf925 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr @@ -1,10 +1,10 @@ -error: `#[macro_export]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:9:1 +error: the `macro_export` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:9:4 | LL | #![macro_export] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs error[E0658]: use of an internal attribute --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:4 @@ -16,277 +16,277 @@ LL | #![rustc_main] = note: the `rustc_main` attribute is an internal implementation detail that will never be stable = note: the `rustc_main` attribute is used internally to specify test entry point function -error: `#[rustc_main]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:1 +error: the `rustc_main` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:4 | LL | #![rustc_main] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[rustc_main]` can only be applied to functions + = help: the `rustc_main` attribute can only be applied to functions -error: `#[repr()]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:16:1 +error: the `repr()` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:16:4 | LL | #![repr()] - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[repr()]` can only be applied to data types + = help: the `repr()` attribute can only be applied to data types -error: `#[path]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:20:1 +error: the `path` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:20:4 | LL | #![path = "3800"] - | ^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules -error: `#[automatically_derived]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:22:1 +error: the `automatically_derived` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:22:4 | LL | #![automatically_derived] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks -error: `#[no_link]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:30:1 +error: the `no_link` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:30:4 | LL | #![no_link] - | ^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[export_name]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:1 +error: the `export_name` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:4 | LL | #![export_name = "2200"] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[inline]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:35:1 +error: the `inline` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:35:4 | LL | #![inline] - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:1 +error: the `inline` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:3 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:17 +error: the `inline` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:20 | LL | mod inner { #![inline] } - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:49:5 +error: the `inline` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:49:7 | LL | #[inline] struct S; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:52:5 +error: the `inline` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:52:7 | LL | #[inline] type T = S; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:5 +error: the `inline` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:7 | LL | #[inline] impl S { } - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[no_link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:59:1 +error: the `no_link` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:59:3 | LL | #[no_link] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[no_link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:62:17 +error: the `no_link` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:62:20 | LL | mod inner { #![no_link] } - | ^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[no_link]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:5 +error: the `no_link` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:7 | LL | #[no_link] fn f() { - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[no_link]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:75:5 +error: the `no_link` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:75:7 | LL | #[no_link] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[no_link]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:84:5 +error: the `no_link` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:84:7 | LL | #[no_link]type T = S; - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[no_link]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:87:5 +error: the `no_link` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:87:7 | LL | #[no_link] impl S { } - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates -error: `#[export_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:1 +error: the `export_name` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:3 | LL | #[export_name = "2200"] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[export_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:99:17 +error: the `export_name` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:99:20 | LL | mod inner { #![export_name="2200"] } - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[export_name]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:104:5 +error: the `export_name` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:104:7 | LL | #[export_name = "2200"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[export_name]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:107:5 +error: the `export_name` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:107:7 | LL | #[export_name = "2200"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[export_name]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:5 +error: the `export_name` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:7 | LL | #[export_name = "2200"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions and statics + = help: the `export_name` attribute can be applied to functions and statics -error: `#[export_name]` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:114:9 +error: the `export_name` attribute cannot be used on required trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:114:11 | LL | #[export_name = "2200"] fn foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | - = help: `#[export_name]` can be applied to functions with a body and statics + = help: the `export_name` attribute can be applied to functions with a body and statics -error: `#[repr(C)]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:1 +error: the `repr(C)` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:3 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:124:17 +error: the `repr(C)` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:124:20 | LL | mod inner { #![repr(C)] } - | ^^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:127:5 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:127:7 | LL | #[repr(C)] fn f() { } - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:132:5 +error: the `repr(C)` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:132:7 | LL | #[repr(C)] type T = S; - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:135:5 +error: the `repr(C)` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:135:7 | LL | #[repr(C)] impl S { } - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(Rust)]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:140:1 +error: the `repr(Rust)` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:140:3 | LL | #[repr(Rust)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types -error: `#[repr(Rust)]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:143:17 +error: the `repr(Rust)` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:143:20 | LL | mod inner { #![repr(Rust)] } - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types -error: `#[repr(Rust)]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:146:5 +error: the `repr(Rust)` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:146:7 | LL | #[repr(Rust)] fn f() { } - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types -error: `#[repr(Rust)]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:151:5 +error: the `repr(Rust)` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:151:7 | LL | #[repr(Rust)] type T = S; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types -error: `#[repr(Rust)]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:154:5 +error: the `repr(Rust)` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:154:7 | LL | #[repr(Rust)] impl S { } - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(Rust)]` can only be applied to data types + = help: the `repr(Rust)` attribute can only be applied to data types warning: `#[no_mangle]` attribute may not be used in combination with `#[export_name]` --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:1 @@ -313,13 +313,13 @@ LL | #![repr()] | = note: using `repr` with an empty list has no effect -warning: `#[no_mangle]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:1 +warning: the `no_mangle` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:4 | LL | #![no_mangle] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` @@ -332,31 +332,31 @@ LL | #[inline = "2100"] fn f() { } = note: for more information, see issue #57571 = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default -warning: `#[no_link]` attribute cannot be used on match arms - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:68:13 +warning: the `no_link` attribute cannot be used on match arms + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:68:15 | LL | #[no_link] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_link]` attribute cannot be used on struct fields - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:78:9 +warning: the `no_link` attribute cannot be used on struct fields + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:78:11 | LL | #[no_link] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_link]` attribute cannot be used on macro defs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:5 +warning: the `no_link` attribute cannot be used on macro defs + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:7 | LL | #[no_link] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[no_link]` can only be applied to extern crates + = help: the `no_link` attribute can only be applied to extern crates = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 37 previous errors; 6 warnings emitted diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index 7d98b9f9982a7..31677560a005a 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -215,37 +215,37 @@ mod macro_use { } #[macro_export] -//~^ WARN `#[macro_export]` attribute cannot be used on modules [unused_attributes] +//~^ WARN the `macro_export` attribute cannot be used on modules [unused_attributes] //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute mod macro_export { mod inner { #![macro_export] } - //~^ WARN `#[macro_export]` attribute cannot be used on modules + //~^ WARN the `macro_export` attribute cannot be used on modules //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute #[macro_export] fn f() { } - //~^ WARN `#[macro_export]` attribute cannot be used on function + //~^ WARN the `macro_export` attribute cannot be used on function //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute #[macro_export] struct S; - //~^ WARN `#[macro_export]` attribute cannot be used on structs + //~^ WARN the `macro_export` attribute cannot be used on structs //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute #[macro_export] type T = S; - //~^ WARN `#[macro_export]` attribute cannot be used on type aliases + //~^ WARN the `macro_export` attribute cannot be used on type aliases //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute #[macro_export] impl S { } - //~^ WARN `#[macro_export]` attribute cannot be used on inherent impl blocks + //~^ WARN the `macro_export` attribute cannot be used on inherent impl blocks //~| WARN previously accepted //~| HELP can only be applied to //~| HELP remove the attribute diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index 8c94bbcb2e027..f2c77b2e4808d 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -207,481 +207,481 @@ note: the lint level is defined here LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^^^^^ -warning: `#[macro_use]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1 +warning: the `macro_use` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:4 | LL | #![macro_use] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:1 +warning: the `should_panic` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:4 | LL | #![should_panic] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1 +warning: the `ignore` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:4 | LL | #![ignore] - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[proc_macro_derive]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1 +warning: the `proc_macro_derive` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:4 | LL | #![proc_macro_derive(Test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[cold]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1 +warning: the `cold` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:4 | LL | #![cold] - | ^^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1 +warning: the `link` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:4 | LL | #![link(name = "x")] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:1 +warning: the `link_name` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:76:4 | LL | #![link_name = "1900"] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:81:1 +warning: the `link_section` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:81:4 | LL | #![link_section = ",1800"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:86:1 +warning: the `must_use` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:86:4 | LL | #![must_use] - | ^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:5 +warning: the `macro_use` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:7 | LL | #[macro_use] fn f() { } - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5 +warning: the `macro_use` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:7 | LL | #[macro_use] struct S; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5 +warning: the `macro_use` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:7 | LL | #[macro_use] type T = S; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5 +warning: the `macro_use` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:7 | LL | #[macro_use] impl S { } - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:1 +warning: the `macro_export` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:3 | LL | #[macro_export] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:17 +warning: the `macro_export` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:20 | LL | mod inner { #![macro_export] } - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:229:5 +warning: the `macro_export` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:229:7 | LL | #[macro_export] fn f() { } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5 +warning: the `macro_export` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:7 | LL | #[macro_export] struct S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 +warning: the `macro_export` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:7 | LL | #[macro_export] type T = S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_export]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:5 +warning: the `macro_export` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:7 | LL | #[macro_export] impl S { } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_export]` can only be applied to macro defs + = help: the `macro_export` attribute can only be applied to macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[path]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5 +warning: the `path` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:7 | LL | #[path = "3800"] fn f() { } - | ^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[path]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:264:5 +warning: the `path` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:264:7 | LL | #[path = "3800"] struct S; - | ^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[path]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:270:5 +warning: the `path` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:270:7 | LL | #[path = "3800"] type T = S; - | ^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[path]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:276:5 +warning: the `path` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:276:7 | LL | #[path = "3800"] impl S { } - | ^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:283:1 +warning: the `automatically_derived` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:283:3 | LL | #[automatically_derived] - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:17 +warning: the `automatically_derived` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:20 | LL | mod inner { #![automatically_derived] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:295:5 +warning: the `automatically_derived` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:295:7 | LL | #[automatically_derived] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5 +warning: the `automatically_derived` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:7 | LL | #[automatically_derived] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:5 +warning: the `automatically_derived` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:7 | LL | #[automatically_derived] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on traits - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:5 +warning: the `automatically_derived` attribute cannot be used on traits + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:7 | LL | #[automatically_derived] trait W { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[automatically_derived]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:5 +warning: the `automatically_derived` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:7 | LL | #[automatically_derived] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:1 +warning: the `no_mangle` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:3 | LL | #[no_mangle] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:334:17 +warning: the `no_mangle` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:334:20 | LL | mod inner { #![no_mangle] } - | ^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:5 +warning: the `no_mangle` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:7 | LL | #[no_mangle] struct S; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:5 +warning: the `no_mangle` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:7 | LL | #[no_mangle] type T = S; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:5 +warning: the `no_mangle` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:7 | LL | #[no_mangle] impl S { } - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:1 +warning: the `should_panic` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:3 | LL | #[should_panic] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:17 +warning: the `should_panic` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:20 | LL | mod inner { #![should_panic] } - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5 +warning: the `should_panic` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:7 | LL | #[should_panic] struct S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5 +warning: the `should_panic` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:7 | LL | #[should_panic] type T = S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[should_panic]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5 +warning: the `should_panic` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:7 | LL | #[should_panic] impl S { } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:1 +warning: the `ignore` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:3 | LL | #[ignore] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:17 +warning: the `ignore` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:20 | LL | mod inner { #![ignore] } - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:5 +warning: the `ignore` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:7 | LL | #[ignore] struct S; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:428:5 +warning: the `ignore` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:428:7 | LL | #[ignore] type T = S; - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[ignore]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:434:5 +warning: the `ignore` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:434:7 | LL | #[ignore] impl S { } - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_implicit_prelude]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5 +warning: the `no_implicit_prelude` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:7 | LL | #[no_implicit_prelude] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_implicit_prelude]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 +warning: the `no_implicit_prelude` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:7 | LL | #[no_implicit_prelude] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_implicit_prelude]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5 +warning: the `no_implicit_prelude` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:7 | LL | #[no_implicit_prelude] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_implicit_prelude]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:5 +warning: the `no_implicit_prelude` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:7 | LL | #[no_implicit_prelude] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | - = help: `#[no_implicit_prelude]` can be applied to crates and modules + = help: the `no_implicit_prelude` attribute can be applied to crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_escape]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5 +warning: the `macro_escape` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:7 | LL | #[macro_escape] fn f() { } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_escape]` can be applied to extern crates and modules + = help: the `macro_escape` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_escape]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:5 +warning: the `macro_escape` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:7 | LL | #[macro_escape] struct S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_escape]` can be applied to extern crates and modules + = help: the `macro_escape` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_escape]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5 +warning: the `macro_escape` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:7 | LL | #[macro_escape] type T = S; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_escape]` can be applied to extern crates and modules + = help: the `macro_escape` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_escape]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5 +warning: the `macro_escape` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:7 | LL | #[macro_escape] impl S { } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_escape]` can be applied to extern crates and modules + = help: the `macro_escape` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` @@ -754,256 +754,256 @@ note: this attribute does not have an `!`, which means it is applied to this imp LL | #[no_std] impl S { } | ^^^^^^^^^^ -warning: `#[cold]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:1 +warning: the `cold` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:3 | LL | #[cold] - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[cold]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:17 +warning: the `cold` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:20 | LL | mod inner { #![cold] } - | ^^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[cold]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:5 +warning: the `cold` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:7 | LL | #[cold] struct S; - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[cold]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:5 +warning: the `cold` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:7 | LL | #[cold] type T = S; - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[cold]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:571:5 +warning: the `cold` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:571:7 | LL | #[cold] impl S { } - | ^^^^^^^ + | ^^^^ | - = help: `#[cold]` can only be applied to functions + = help: the `cold` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:578:1 +warning: the `link_name` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:578:3 | LL | #[link_name = "1900"] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on foreign modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:584:5 +warning: the `link_name` attribute cannot be used on foreign modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:584:7 | LL | #[link_name = "1900"] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:591:17 +warning: the `link_name` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:591:20 | LL | mod inner { #![link_name="1900"] } - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:597:5 +warning: the `link_name` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:597:7 | LL | #[link_name = "1900"] fn f() { } - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:5 +warning: the `link_name` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:7 | LL | #[link_name = "1900"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:609:5 +warning: the `link_name` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:609:7 | LL | #[link_name = "1900"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_name]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:615:5 +warning: the `link_name` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:615:7 | LL | #[link_name = "1900"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[link_name]` can be applied to foreign functions and foreign statics + = help: the `link_name` attribute can be applied to foreign functions and foreign statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:622:1 +warning: the `link_section` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:622:3 | LL | #[link_section = ",1800"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:628:17 +warning: the `link_section` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:628:20 | LL | mod inner { #![link_section=",1800"] } - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:636:5 +warning: the `link_section` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:636:7 | LL | #[link_section = ",1800"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:642:5 +warning: the `link_section` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:642:7 | LL | #[link_section = ",1800"] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:5 +warning: the `link_section` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:7 | LL | #[link_section = ",1800"] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on traits - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:5 +warning: the `link_section` attribute cannot be used on traits + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:7 | LL | #[link_section = ",1800"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions and statics + = help: the `link_section` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:1 +warning: the `link` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:3 | LL | #[link(name = "x")] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:17 +warning: the `link` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:20 | LL | mod inner { #![link(name = "x")] } - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 +warning: the `link` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:7 | LL | #[link(name = "x")] fn f() { } - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5 +warning: the `link` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:7 | LL | #[link(name = "x")] struct S; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5 +warning: the `link` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:7 | LL | #[link(name = "x")] type T = S; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 +warning: the `link` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:7 | LL | #[link(name = "x")] impl S { } - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1 +warning: the `must_use` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:17 +warning: the `must_use` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:20 | LL | mod inner { #![must_use] } - | ^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5 +warning: the `must_use` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:7 | LL | #[must_use] type T = S; - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5 +warning: the `must_use` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:7 | LL | #[must_use] impl S { } - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` @@ -1566,31 +1566,31 @@ note: this attribute does not have an `!`, which means it is applied to this imp LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^ -warning: `#[no_mangle]` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:9 +warning: the `no_mangle` attribute cannot be used on required trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:11 | LL | #[no_mangle] fn foo(); - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions with a body and statics + = help: the `no_mangle` attribute can be applied to functions with a body and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on provided trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:9 +warning: the `no_mangle` attribute cannot be used on provided trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:11 | LL | #[no_mangle] fn bar() {} - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions, inherent methods, statics, and trait methods in impl blocks + = help: the `no_mangle` attribute can be applied to functions, inherent methods, statics, and trait methods in impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[link_section]` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:9 +warning: the `link_section` attribute cannot be used on required trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:11 | LL | #[link_section = ",1800"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_section]` can be applied to functions with a body and statics + = help: the `link_section` attribute can be applied to functions with a body and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: 170 warnings emitted diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_escape.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_escape.stderr index 6a8c4b10094dd..97cc66a35eacf 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_escape.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_escape.stderr @@ -6,13 +6,13 @@ LL | #![macro_escape] | = help: try an outer attribute: `#[macro_use]` -warning: `#[macro_escape]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-macro_escape.rs:8:1 +warning: the `macro_escape` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-macro_escape.rs:8:4 | LL | #![macro_escape] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[macro_escape]` can be applied to extern crates and modules + = help: the `macro_escape` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr index 91ff30542d848..0b92a279a9809 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr @@ -34,50 +34,50 @@ LL - #[macro_use = "2700"] struct S; LL + #[macro_use] struct S; | -warning: `#[macro_use]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-macro_use.rs:6:1 +warning: the `macro_use` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-macro_use.rs:6:4 | LL | #![macro_use(my_macro)] - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` -warning: `#[macro_use]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-macro_use.rs:17:5 +warning: the `macro_use` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-macro_use.rs:17:7 | LL | #[macro_use = "2700"] struct S; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-macro_use.rs:22:5 +warning: the `macro_use` attribute cannot be used on functions + --> $DIR/issue-43106-gating-of-macro_use.rs:22:7 | LL | #[macro_use] fn f() { } - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-macro_use.rs:26:5 +warning: the `macro_use` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-macro_use.rs:26:7 | LL | #[macro_use] type T = S; - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[macro_use]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-macro_use.rs:30:5 +warning: the `macro_use` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-macro_use.rs:30:7 | LL | #[macro_use] impl S { } - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 4 previous errors; 5 warnings emitted diff --git a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr index 753e3e2f21da5..b341036d1f6f7 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.stderr @@ -4,53 +4,53 @@ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `p LL | #[proc_macro_derive(Test)] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[proc_macro_derive]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:5:1 +error: the `proc_macro_derive` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:5:3 | LL | #[proc_macro_derive(Test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions -error: `#[proc_macro_derive]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:8:17 +error: the `proc_macro_derive` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:8:20 | LL | mod inner { #![proc_macro_derive(Test)] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions -error: `#[proc_macro_derive]` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:13:17 +error: the `proc_macro_derive` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:13:20 | LL | mod inner { #![proc_macro_derive(Test)] } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions -error: `#[proc_macro_derive]` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:19:5 +error: the `proc_macro_derive` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:19:7 | LL | #[proc_macro_derive(Test)] struct S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions -error: `#[proc_macro_derive]` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:22:5 +error: the `proc_macro_derive` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:22:7 | LL | #[proc_macro_derive(Test)] type T = S; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions -error: `#[proc_macro_derive]` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:25:5 +error: the `proc_macro_derive` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-proc_macro_derive.rs:25:7 | LL | #[proc_macro_derive(Test)] impl S { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions error: aborting due to 7 previous errors diff --git a/tests/ui/ffi-attrs/ffi_const.stderr b/tests/ui/ffi-attrs/ffi_const.stderr index af54486e433ca..66b5339b31e2d 100644 --- a/tests/ui/ffi-attrs/ffi_const.stderr +++ b/tests/ui/ffi-attrs/ffi_const.stderr @@ -1,26 +1,26 @@ -error: `#[ffi_const]` attribute cannot be used on functions - --> $DIR/ffi_const.rs:4:1 +error: the `ffi_const` attribute cannot be used on functions + --> $DIR/ffi_const.rs:4:10 | LL | #[unsafe(ffi_const)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[ffi_const]` can only be applied to foreign functions + = help: the `ffi_const` attribute can only be applied to foreign functions -error: `#[ffi_const]` attribute cannot be used on macro defs - --> $DIR/ffi_const.rs:7:1 +error: the `ffi_const` attribute cannot be used on macro defs + --> $DIR/ffi_const.rs:7:10 | LL | #[unsafe(ffi_const)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[ffi_const]` can only be applied to foreign functions + = help: the `ffi_const` attribute can only be applied to foreign functions -error: `#[ffi_const]` attribute cannot be used on foreign statics - --> $DIR/ffi_const.rs:13:5 +error: the `ffi_const` attribute cannot be used on foreign statics + --> $DIR/ffi_const.rs:13:14 | LL | #[unsafe(ffi_const)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[ffi_const]` can only be applied to foreign functions + = help: the `ffi_const` attribute can only be applied to foreign functions error: unsafe attribute used without unsafe --> $DIR/ffi_const.rs:16:7 diff --git a/tests/ui/ffi-attrs/ffi_pure.stderr b/tests/ui/ffi-attrs/ffi_pure.stderr index 11e9199b40f4b..5c3b5ef9a812f 100644 --- a/tests/ui/ffi-attrs/ffi_pure.stderr +++ b/tests/ui/ffi-attrs/ffi_pure.stderr @@ -1,26 +1,26 @@ -error: `#[ffi_pure]` attribute cannot be used on functions - --> $DIR/ffi_pure.rs:4:1 +error: the `ffi_pure` attribute cannot be used on functions + --> $DIR/ffi_pure.rs:4:10 | LL | #[unsafe(ffi_pure)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[ffi_pure]` can only be applied to foreign functions + = help: the `ffi_pure` attribute can only be applied to foreign functions -error: `#[ffi_pure]` attribute cannot be used on macro defs - --> $DIR/ffi_pure.rs:7:1 +error: the `ffi_pure` attribute cannot be used on macro defs + --> $DIR/ffi_pure.rs:7:10 | LL | #[unsafe(ffi_pure)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[ffi_pure]` can only be applied to foreign functions + = help: the `ffi_pure` attribute can only be applied to foreign functions -error: `#[ffi_pure]` attribute cannot be used on foreign statics - --> $DIR/ffi_pure.rs:13:5 +error: the `ffi_pure` attribute cannot be used on foreign statics + --> $DIR/ffi_pure.rs:13:14 | LL | #[unsafe(ffi_pure)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[ffi_pure]` can only be applied to foreign functions + = help: the `ffi_pure` attribute can only be applied to foreign functions error: unsafe attribute used without unsafe --> $DIR/ffi_pure.rs:16:7 diff --git a/tests/ui/force-inlining/invalid.stderr b/tests/ui/force-inlining/invalid.stderr index 3b9975e19a1b1..d3e0e8dfa98e9 100644 --- a/tests/ui/force-inlining/invalid.stderr +++ b/tests/ui/force-inlining/invalid.stderr @@ -64,237 +64,237 @@ LL - #[rustc_force_inline = 2] LL + #[rustc_force_inline] | -error: `#[rustc_force_inline]` attribute cannot be used on extern crates - --> $DIR/invalid.rs:30:1 +error: the `rustc_force_inline` attribute cannot be used on extern crates + --> $DIR/invalid.rs:30:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on use statements - --> $DIR/invalid.rs:34:1 +error: the `rustc_force_inline` attribute cannot be used on use statements + --> $DIR/invalid.rs:34:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on statics - --> $DIR/invalid.rs:38:1 +error: the `rustc_force_inline` attribute cannot be used on statics + --> $DIR/invalid.rs:38:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on constants - --> $DIR/invalid.rs:42:1 +error: the `rustc_force_inline` attribute cannot be used on constants + --> $DIR/invalid.rs:42:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on modules - --> $DIR/invalid.rs:46:1 +error: the `rustc_force_inline` attribute cannot be used on modules + --> $DIR/invalid.rs:46:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on foreign modules - --> $DIR/invalid.rs:50:1 +error: the `rustc_force_inline` attribute cannot be used on foreign modules + --> $DIR/invalid.rs:50:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on foreign statics - --> $DIR/invalid.rs:53:5 +error: the `rustc_force_inline` attribute cannot be used on foreign statics + --> $DIR/invalid.rs:53:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on foreign types - --> $DIR/invalid.rs:57:5 +error: the `rustc_force_inline` attribute cannot be used on foreign types + --> $DIR/invalid.rs:57:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on foreign functions - --> $DIR/invalid.rs:61:5 +error: the `rustc_force_inline` attribute cannot be used on foreign functions + --> $DIR/invalid.rs:61:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions with a body + = help: the `rustc_force_inline` attribute can only be applied to functions with a body -error: `#[rustc_force_inline]` attribute cannot be used on type aliases - --> $DIR/invalid.rs:66:1 +error: the `rustc_force_inline` attribute cannot be used on type aliases + --> $DIR/invalid.rs:66:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on enums - --> $DIR/invalid.rs:70:1 +error: the `rustc_force_inline` attribute cannot be used on enums + --> $DIR/invalid.rs:70:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on type parameters - --> $DIR/invalid.rs:72:10 +error: the `rustc_force_inline` attribute cannot be used on type parameters + --> $DIR/invalid.rs:72:12 | LL | enum Bar<#[rustc_force_inline] T> { - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on enum variants - --> $DIR/invalid.rs:74:5 +error: the `rustc_force_inline` attribute cannot be used on enum variants + --> $DIR/invalid.rs:74:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on structs - --> $DIR/invalid.rs:79:1 +error: the `rustc_force_inline` attribute cannot be used on structs + --> $DIR/invalid.rs:79:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on struct fields - --> $DIR/invalid.rs:82:5 +error: the `rustc_force_inline` attribute cannot be used on struct fields + --> $DIR/invalid.rs:82:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on unions - --> $DIR/invalid.rs:87:1 +error: the `rustc_force_inline` attribute cannot be used on unions + --> $DIR/invalid.rs:87:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on traits - --> $DIR/invalid.rs:94:1 +error: the `rustc_force_inline` attribute cannot be used on traits + --> $DIR/invalid.rs:94:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on associated types - --> $DIR/invalid.rs:97:5 +error: the `rustc_force_inline` attribute cannot be used on associated types + --> $DIR/invalid.rs:97:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on associated consts - --> $DIR/invalid.rs:100:5 +error: the `rustc_force_inline` attribute cannot be used on associated consts + --> $DIR/invalid.rs:100:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on provided trait methods - --> $DIR/invalid.rs:104:5 +error: the `rustc_force_inline` attribute cannot be used on provided trait methods + --> $DIR/invalid.rs:104:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can be applied to functions and inherent methods + = help: the `rustc_force_inline` attribute can be applied to functions and inherent methods -error: `#[rustc_force_inline]` attribute cannot be used on trait aliases - --> $DIR/invalid.rs:109:1 +error: the `rustc_force_inline` attribute cannot be used on trait aliases + --> $DIR/invalid.rs:109:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on inherent impl blocks - --> $DIR/invalid.rs:113:1 +error: the `rustc_force_inline` attribute cannot be used on inherent impl blocks + --> $DIR/invalid.rs:113:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on trait impl blocks - --> $DIR/invalid.rs:120:1 +error: the `rustc_force_inline` attribute cannot be used on trait impl blocks + --> $DIR/invalid.rs:120:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on macro defs - --> $DIR/invalid.rs:127:1 +error: the `rustc_force_inline` attribute cannot be used on macro defs + --> $DIR/invalid.rs:127:3 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on function params - --> $DIR/invalid.rs:131:11 +error: the `rustc_force_inline` attribute cannot be used on function params + --> $DIR/invalid.rs:131:13 | LL | fn barqux(#[rustc_force_inline] _x: u32) {} - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on closures - --> $DIR/invalid.rs:148:14 +error: the `rustc_force_inline` attribute cannot be used on closures + --> $DIR/invalid.rs:148:16 | LL | let _x = #[rustc_force_inline] || { }; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can be applied to functions and inherent methods + = help: the `rustc_force_inline` attribute can be applied to functions and inherent methods -error: `#[rustc_force_inline]` attribute cannot be used on expressions - --> $DIR/invalid.rs:150:14 +error: the `rustc_force_inline` attribute cannot be used on expressions + --> $DIR/invalid.rs:150:16 | LL | let _y = #[rustc_force_inline] 3 + 4; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on statements - --> $DIR/invalid.rs:152:5 +error: the `rustc_force_inline` attribute cannot be used on statements + --> $DIR/invalid.rs:152:7 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions -error: `#[rustc_force_inline]` attribute cannot be used on match arms - --> $DIR/invalid.rs:157:9 +error: the `rustc_force_inline` attribute cannot be used on match arms + --> $DIR/invalid.rs:157:11 | LL | #[rustc_force_inline] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_force_inline]` can only be applied to functions + = help: the `rustc_force_inline` attribute can only be applied to functions error: attribute cannot be applied to a `async`, `gen` or `async gen` function --> $DIR/invalid.rs:135:1 diff --git a/tests/ui/internal-lints/query_stability_incorrect.rs b/tests/ui/internal-lints/query_stability_incorrect.rs index cefd898677113..5e7765a74f5b4 100644 --- a/tests/ui/internal-lints/query_stability_incorrect.rs +++ b/tests/ui/internal-lints/query_stability_incorrect.rs @@ -3,7 +3,7 @@ #![feature(rustc_attrs)] #[rustc_lint_query_instability] -//~^ ERROR `#[rustc_lint_query_instability]` attribute cannot be used on structs +//~^ ERROR the `rustc_lint_query_instability` attribute cannot be used on structs struct Foo; impl Foo { diff --git a/tests/ui/internal-lints/query_stability_incorrect.stderr b/tests/ui/internal-lints/query_stability_incorrect.stderr index 0e5b2ec072b2e..5dafcbfb2490a 100644 --- a/tests/ui/internal-lints/query_stability_incorrect.stderr +++ b/tests/ui/internal-lints/query_stability_incorrect.stderr @@ -1,10 +1,10 @@ -error: `#[rustc_lint_query_instability]` attribute cannot be used on structs - --> $DIR/query_stability_incorrect.rs:5:1 +error: the `rustc_lint_query_instability` attribute cannot be used on structs + --> $DIR/query_stability_incorrect.rs:5:3 | LL | #[rustc_lint_query_instability] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_lint_query_instability]` can only be applied to functions + = help: the `rustc_lint_query_instability` attribute can only be applied to functions error[E0565]: malformed `rustc_lint_query_instability` attribute input --> $DIR/query_stability_incorrect.rs:10:5 diff --git a/tests/ui/internal/internal-unstable.stderr b/tests/ui/internal/internal-unstable.stderr index 9581cfff5bb91..b816dc6f7454c 100644 --- a/tests/ui/internal/internal-unstable.stderr +++ b/tests/ui/internal/internal-unstable.stderr @@ -59,23 +59,23 @@ LL | bar!(internal_unstable::unstable()); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this error originates in the macro `foo` which comes from the expansion of the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info) -warning: `#[allow_internal_unstable]` attribute cannot be used on struct fields - --> $DIR/internal-unstable.rs:10:5 +warning: the `allow_internal_unstable` attribute cannot be used on struct fields + --> $DIR/internal-unstable.rs:10:7 | LL | #[allow_internal_unstable] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[allow_internal_unstable]` can be applied to functions and macro defs + = help: the `allow_internal_unstable` attribute can be applied to functions and macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` -warning: `#[allow_internal_unstable]` attribute cannot be used on match arms - --> $DIR/internal-unstable.rs:61:9 +warning: the `allow_internal_unstable` attribute cannot be used on match arms + --> $DIR/internal-unstable.rs:61:11 | LL | #[allow_internal_unstable] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[allow_internal_unstable]` can be applied to functions and macro defs + = help: the `allow_internal_unstable` attribute can be applied to functions and macro defs = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 7 previous errors; 2 warnings emitted diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index 8d5de72633f14..baaffa7c9de42 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -4,21 +4,21 @@ error: unions cannot have zero fields LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^^^^ -error: `#[rustc_dump_layout]` attribute cannot be used on constants - --> $DIR/debug.rs:71:1 +error: the `rustc_dump_layout` attribute cannot be used on constants + --> $DIR/debug.rs:71:3 | LL | #[rustc_dump_layout(debug)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_dump_layout]` can be applied to data types and type aliases + = help: the `rustc_dump_layout` attribute can be applied to data types and type aliases -error: `#[rustc_dump_layout]` attribute cannot be used on associated consts - --> $DIR/debug.rs:75:5 +error: the `rustc_dump_layout` attribute cannot be used on associated consts + --> $DIR/debug.rs:75:7 | LL | #[rustc_dump_layout(debug)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_dump_layout]` can be applied to data types and type aliases + = help: the `rustc_dump_layout` attribute can be applied to data types and type aliases error: layout_of(E) = Layout { size: Size(12 bytes), diff --git a/tests/ui/layout/thaw-transmute-invalid-enum.stderr b/tests/ui/layout/thaw-transmute-invalid-enum.stderr index 7732e21409fc4..76492027503c0 100644 --- a/tests/ui/layout/thaw-transmute-invalid-enum.stderr +++ b/tests/ui/layout/thaw-transmute-invalid-enum.stderr @@ -9,13 +9,13 @@ help: you might be missing a type parameter LL | fn test() { | ++++++++ -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/thaw-transmute-invalid-enum.rs:22:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/thaw-transmute-invalid-enum.rs:22:3 | LL | #[repr(C, packed(2))] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions error[E0658]: use of unstable library feature `transmutability` --> $DIR/thaw-transmute-invalid-enum.rs:4:20 diff --git a/tests/ui/layout/thaw-validate-invalid-enum.stderr b/tests/ui/layout/thaw-validate-invalid-enum.stderr index c7076d9162ea1..d4a54bca17cc1 100644 --- a/tests/ui/layout/thaw-validate-invalid-enum.stderr +++ b/tests/ui/layout/thaw-validate-invalid-enum.stderr @@ -1,10 +1,10 @@ -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/thaw-validate-invalid-enum.rs:3:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/thaw-validate-invalid-enum.rs:3:3 | LL | #[repr(packed)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/thaw-validate-invalid-enum.rs:14:9 diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-not-foreign-fn.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-not-foreign-fn.stderr index 0f7fb8e6d3b28..b4b81b2cfff37 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-not-foreign-fn.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-not-foreign-fn.stderr @@ -1,26 +1,26 @@ -error: `#[link_ordinal]` attribute cannot be used on structs - --> $DIR/link-ordinal-not-foreign-fn.rs:1:1 +error: the `link_ordinal` attribute cannot be used on structs + --> $DIR/link-ordinal-not-foreign-fn.rs:1:3 | LL | #[link_ordinal(123)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_ordinal]` can be applied to foreign functions and foreign statics + = help: the `link_ordinal` attribute can be applied to foreign functions and foreign statics -error: `#[link_ordinal]` attribute cannot be used on functions - --> $DIR/link-ordinal-not-foreign-fn.rs:5:1 +error: the `link_ordinal` attribute cannot be used on functions + --> $DIR/link-ordinal-not-foreign-fn.rs:5:3 | LL | #[link_ordinal(123)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_ordinal]` can be applied to foreign functions and foreign statics + = help: the `link_ordinal` attribute can be applied to foreign functions and foreign statics -error: `#[link_ordinal]` attribute cannot be used on statics - --> $DIR/link-ordinal-not-foreign-fn.rs:9:1 +error: the `link_ordinal` attribute cannot be used on statics + --> $DIR/link-ordinal-not-foreign-fn.rs:9:3 | LL | #[link_ordinal(42)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[link_ordinal]` can be applied to foreign functions and foreign statics + = help: the `link_ordinal` attribute can be applied to foreign functions and foreign statics error: aborting due to 3 previous errors diff --git a/tests/ui/lint/fn_must_use.stderr b/tests/ui/lint/fn_must_use.stderr index c9089d9215785..1277a6283c645 100644 --- a/tests/ui/lint/fn_must_use.stderr +++ b/tests/ui/lint/fn_must_use.stderr @@ -1,10 +1,10 @@ -warning: `#[must_use]` attribute cannot be used on trait methods in impl blocks - --> $DIR/fn_must_use.rs:41:5 +warning: the `must_use` attribute cannot be used on trait methods in impl blocks + --> $DIR/fn_must_use.rs:41:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, and traits + = help: the `must_use` attribute can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` diff --git a/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr index 4aff0575e5f56..6495da94137ed 100644 --- a/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr +++ b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr @@ -1,10 +1,10 @@ -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:6:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:6:3 | LL | #[repr(packed)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:18:9 diff --git a/tests/ui/lint/inert-attr-macro.rs b/tests/ui/lint/inert-attr-macro.rs index c2ccba7f9baf3..3c7542ff4d225 100644 --- a/tests/ui/lint/inert-attr-macro.rs +++ b/tests/ui/lint/inert-attr-macro.rs @@ -7,13 +7,13 @@ macro_rules! foo { } fn main() { - #[inline] foo!(); //~ WARN `#[inline]` attribute cannot be used on macro calls + #[inline] foo!(); //~ WARN the `inline` attribute cannot be used on macro calls //~^ WARN previously accepted // This does nothing, since `#[allow(warnings)]` is itself // an inert attribute on a macro call #[allow(warnings)] #[inline] foo!(); //~ WARN unused attribute `allow` - //~^ WARN `#[inline]` attribute cannot be used on macro calls + //~^ WARN the `inline` attribute cannot be used on macro calls //~| WARN previously accepted // This does work, since the attribute is on a parent diff --git a/tests/ui/lint/inert-attr-macro.stderr b/tests/ui/lint/inert-attr-macro.stderr index 6d29a5a94ed0e..dcb9fb3d61ce7 100644 --- a/tests/ui/lint/inert-attr-macro.stderr +++ b/tests/ui/lint/inert-attr-macro.stderr @@ -1,10 +1,10 @@ -warning: `#[inline]` attribute cannot be used on macro calls - --> $DIR/inert-attr-macro.rs:10:5 +warning: the `inline` attribute cannot be used on macro calls + --> $DIR/inert-attr-macro.rs:10:7 | LL | #[inline] foo!(); - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute note: the lint level is defined here @@ -26,13 +26,13 @@ note: the built-in attribute `allow` will be ignored, since it's applied to the LL | #[allow(warnings)] #[inline] foo!(); | ^^^ -warning: `#[inline]` attribute cannot be used on macro calls - --> $DIR/inert-attr-macro.rs:15:24 +warning: the `inline` attribute cannot be used on macro calls + --> $DIR/inert-attr-macro.rs:15:26 | LL | #[allow(warnings)] #[inline] foo!(); - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute diff --git a/tests/ui/lint/inline-trait-and-foreign-items.stderr b/tests/ui/lint/inline-trait-and-foreign-items.stderr index 06f8dfbd649c9..859a5080ee453 100644 --- a/tests/ui/lint/inline-trait-and-foreign-items.stderr +++ b/tests/ui/lint/inline-trait-and-foreign-items.stderr @@ -1,50 +1,50 @@ -error: `#[inline]` attribute cannot be used on associated types - --> $DIR/inline-trait-and-foreign-items.rs:11:5 +error: the `inline` attribute cannot be used on associated types + --> $DIR/inline-trait-and-foreign-items.rs:11:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on associated types - --> $DIR/inline-trait-and-foreign-items.rs:22:5 +error: the `inline` attribute cannot be used on associated types + --> $DIR/inline-trait-and-foreign-items.rs:22:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on associated types - --> $DIR/inline-trait-and-foreign-items.rs:25:5 +error: the `inline` attribute cannot be used on associated types + --> $DIR/inline-trait-and-foreign-items.rs:25:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on foreign statics - --> $DIR/inline-trait-and-foreign-items.rs:30:5 +error: the `inline` attribute cannot be used on foreign statics + --> $DIR/inline-trait-and-foreign-items.rs:30:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -error: `#[inline]` attribute cannot be used on foreign types - --> $DIR/inline-trait-and-foreign-items.rs:33:5 +error: the `inline` attribute cannot be used on foreign types + --> $DIR/inline-trait-and-foreign-items.rs:33:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions -warning: `#[inline]` attribute cannot be used on associated consts - --> $DIR/inline-trait-and-foreign-items.rs:7:5 +warning: the `inline` attribute cannot be used on associated consts + --> $DIR/inline-trait-and-foreign-items.rs:7:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/inline-trait-and-foreign-items.rs:4:9 @@ -52,13 +52,13 @@ note: the lint level is defined here LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -warning: `#[inline]` attribute cannot be used on associated consts - --> $DIR/inline-trait-and-foreign-items.rs:18:5 +warning: the `inline` attribute cannot be used on associated consts + --> $DIR/inline-trait-and-foreign-items.rs:18:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions + = help: the `inline` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: unconstrained opaque type diff --git a/tests/ui/lint/must_not_suspend/other_items.stderr b/tests/ui/lint/must_not_suspend/other_items.stderr index 289230b027ada..700b70d653014 100644 --- a/tests/ui/lint/must_not_suspend/other_items.stderr +++ b/tests/ui/lint/must_not_suspend/other_items.stderr @@ -1,10 +1,10 @@ -error: `#[must_not_suspend]` attribute cannot be used on modules - --> $DIR/other_items.rs:5:1 +error: the `must_not_suspend` attribute cannot be used on modules + --> $DIR/other_items.rs:5:3 | LL | #[must_not_suspend] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | - = help: `#[must_not_suspend]` can be applied to data types and traits + = help: the `must_not_suspend` attribute can be applied to data types and traits error: aborting due to 1 previous error diff --git a/tests/ui/lint/must_not_suspend/return.stderr b/tests/ui/lint/must_not_suspend/return.stderr index b041491128e12..9225e6bd42d7d 100644 --- a/tests/ui/lint/must_not_suspend/return.stderr +++ b/tests/ui/lint/must_not_suspend/return.stderr @@ -1,10 +1,10 @@ -error: `#[must_not_suspend]` attribute cannot be used on functions - --> $DIR/return.rs:5:1 +error: the `must_not_suspend` attribute cannot be used on functions + --> $DIR/return.rs:5:3 | LL | #[must_not_suspend] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ | - = help: `#[must_not_suspend]` can be applied to data types and traits + = help: the `must_not_suspend` attribute can be applied to data types and traits error: aborting due to 1 previous error diff --git a/tests/ui/lint/unused/unused-attr-macro-rules.stderr b/tests/ui/lint/unused/unused-attr-macro-rules.stderr index b736235d852de..d44a6359044a8 100644 --- a/tests/ui/lint/unused/unused-attr-macro-rules.stderr +++ b/tests/ui/lint/unused/unused-attr-macro-rules.stderr @@ -1,10 +1,10 @@ -error: `#[macro_use]` attribute cannot be used on macro defs - --> $DIR/unused-attr-macro-rules.rs:7:1 +error: the `macro_use` attribute cannot be used on macro defs + --> $DIR/unused-attr-macro-rules.rs:7:3 | LL | #[macro_use] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/unused-attr-macro-rules.rs:1:9 @@ -12,13 +12,13 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: `#[path]` attribute cannot be used on macro defs - --> $DIR/unused-attr-macro-rules.rs:9:1 +error: the `path` attribute cannot be used on macro defs + --> $DIR/unused-attr-macro-rules.rs:9:3 | LL | #[path="foo"] - | ^^^^^^^^^^^^^ + | ^^^^ | - = help: `#[path]` can only be applied to modules + = help: the `path` attribute can only be applied to modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` diff --git a/tests/ui/lint/unused/unused_attributes-must_use.fixed b/tests/ui/lint/unused/unused_attributes-must_use.fixed index 082096f12080a..326d12de8e6e6 100644 --- a/tests/ui/lint/unused/unused_attributes-must_use.fixed +++ b/tests/ui/lint/unused/unused_attributes-must_use.fixed @@ -65,7 +65,7 @@ extern "Rust" { fn foreign_foo() -> i64; } -//~^ ERROR `#[must_use]` attribute cannot be used on macro calls +//~^ ERROR the `must_use` attribute cannot be used on macro calls //~| WARN this was previously accepted by the compiler but is being phased out global_asm!(""); diff --git a/tests/ui/lint/unused/unused_attributes-must_use.rs b/tests/ui/lint/unused/unused_attributes-must_use.rs index b4b17476d0b1b..3edd856665d0c 100644 --- a/tests/ui/lint/unused/unused_attributes-must_use.rs +++ b/tests/ui/lint/unused/unused_attributes-must_use.rs @@ -66,7 +66,7 @@ extern "Rust" { } #[must_use] -//~^ ERROR `#[must_use]` attribute cannot be used on macro calls +//~^ ERROR the `must_use` attribute cannot be used on macro calls //~| WARN this was previously accepted by the compiler but is being phased out global_asm!(""); diff --git a/tests/ui/lint/unused/unused_attributes-must_use.stderr b/tests/ui/lint/unused/unused_attributes-must_use.stderr index e0e045285e49f..18340f963801e 100644 --- a/tests/ui/lint/unused/unused_attributes-must_use.stderr +++ b/tests/ui/lint/unused/unused_attributes-must_use.stderr @@ -1,10 +1,10 @@ -error: `#[must_use]` attribute cannot be used on macro calls - --> $DIR/unused_attributes-must_use.rs:68:1 +error: the `must_use` attribute cannot be used on macro calls + --> $DIR/unused_attributes-must_use.rs:68:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute note: the lint level is defined here @@ -13,193 +13,193 @@ note: the lint level is defined here LL | #![deny(unused_attributes, unused_must_use)] | ^^^^^^^^^^^^^^^^^ -error: `#[must_use]` attribute cannot be used on extern crates - --> $DIR/unused_attributes-must_use.rs:7:1 +error: the `must_use` attribute cannot be used on extern crates + --> $DIR/unused_attributes-must_use.rs:7:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on modules - --> $DIR/unused_attributes-must_use.rs:11:1 +error: the `must_use` attribute cannot be used on modules + --> $DIR/unused_attributes-must_use.rs:11:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on use statements - --> $DIR/unused_attributes-must_use.rs:15:1 +error: the `must_use` attribute cannot be used on use statements + --> $DIR/unused_attributes-must_use.rs:15:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on constants - --> $DIR/unused_attributes-must_use.rs:19:1 +error: the `must_use` attribute cannot be used on constants + --> $DIR/unused_attributes-must_use.rs:19:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on statics - --> $DIR/unused_attributes-must_use.rs:22:1 +error: the `must_use` attribute cannot be used on statics + --> $DIR/unused_attributes-must_use.rs:22:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on inherent impl blocks - --> $DIR/unused_attributes-must_use.rs:40:1 +error: the `must_use` attribute cannot be used on inherent impl blocks + --> $DIR/unused_attributes-must_use.rs:40:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on foreign modules - --> $DIR/unused_attributes-must_use.rs:55:1 +error: the `must_use` attribute cannot be used on foreign modules + --> $DIR/unused_attributes-must_use.rs:55:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on type aliases - --> $DIR/unused_attributes-must_use.rs:73:1 +error: the `must_use` attribute cannot be used on type aliases + --> $DIR/unused_attributes-must_use.rs:73:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on type parameters - --> $DIR/unused_attributes-must_use.rs:77:8 +error: the `must_use` attribute cannot be used on type parameters + --> $DIR/unused_attributes-must_use.rs:77:10 | LL | fn qux<#[must_use] T>(_: T) {} - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on trait impl blocks - --> $DIR/unused_attributes-must_use.rs:95:1 +error: the `must_use` attribute cannot be used on trait impl blocks + --> $DIR/unused_attributes-must_use.rs:95:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on trait aliases - --> $DIR/unused_attributes-must_use.rs:107:1 +error: the `must_use` attribute cannot be used on trait aliases + --> $DIR/unused_attributes-must_use.rs:107:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on macro defs - --> $DIR/unused_attributes-must_use.rs:111:1 +error: the `must_use` attribute cannot be used on macro defs + --> $DIR/unused_attributes-must_use.rs:111:3 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on statements - --> $DIR/unused_attributes-must_use.rs:120:5 +error: the `must_use` attribute cannot be used on statements + --> $DIR/unused_attributes-must_use.rs:120:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on closures - --> $DIR/unused_attributes-must_use.rs:125:13 +error: the `must_use` attribute cannot be used on closures + --> $DIR/unused_attributes-must_use.rs:125:15 | LL | let x = #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, foreign functions, functions, methods, and traits + = help: the `must_use` attribute can be applied to data types, foreign functions, functions, methods, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on match arms - --> $DIR/unused_attributes-must_use.rs:148:9 +error: the `must_use` attribute cannot be used on match arms + --> $DIR/unused_attributes-must_use.rs:148:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on struct fields - --> $DIR/unused_attributes-must_use.rs:157:28 +error: the `must_use` attribute cannot be used on struct fields + --> $DIR/unused_attributes-must_use.rs:157:30 | LL | let s = PatternField { #[must_use] foo: 123 }; - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on pattern fields - --> $DIR/unused_attributes-must_use.rs:159:24 +error: the `must_use` attribute cannot be used on pattern fields + --> $DIR/unused_attributes-must_use.rs:159:26 | LL | let PatternField { #[must_use] foo } = s; - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on associated consts - --> $DIR/unused_attributes-must_use.rs:82:5 +error: the `must_use` attribute cannot be used on associated consts + --> $DIR/unused_attributes-must_use.rs:82:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on associated types - --> $DIR/unused_attributes-must_use.rs:85:5 +error: the `must_use` attribute cannot be used on associated types + --> $DIR/unused_attributes-must_use.rs:85:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on trait methods in impl blocks - --> $DIR/unused_attributes-must_use.rs:100:5 +error: the `must_use` attribute cannot be used on trait methods in impl blocks + --> $DIR/unused_attributes-must_use.rs:100:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, and traits + = help: the `must_use` attribute can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: `#[must_use]` attribute cannot be used on foreign statics - --> $DIR/unused_attributes-must_use.rs:59:5 +error: the `must_use` attribute cannot be used on foreign statics + --> $DIR/unused_attributes-must_use.rs:59:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: unused `X` that must be used diff --git a/tests/ui/lint/warn-unused-inline-on-fn-prototypes.stderr b/tests/ui/lint/warn-unused-inline-on-fn-prototypes.stderr index d3cad7c0c4775..8f02673a03d96 100644 --- a/tests/ui/lint/warn-unused-inline-on-fn-prototypes.stderr +++ b/tests/ui/lint/warn-unused-inline-on-fn-prototypes.stderr @@ -1,10 +1,10 @@ -error: `#[inline]` attribute cannot be used on required trait methods - --> $DIR/warn-unused-inline-on-fn-prototypes.rs:4:5 +error: the `inline` attribute cannot be used on required trait methods + --> $DIR/warn-unused-inline-on-fn-prototypes.rs:4:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions with a body + = help: the `inline` attribute can only be applied to functions with a body = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here --> $DIR/warn-unused-inline-on-fn-prototypes.rs:1:9 @@ -12,13 +12,13 @@ note: the lint level is defined here LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -error: `#[inline]` attribute cannot be used on foreign functions - --> $DIR/warn-unused-inline-on-fn-prototypes.rs:10:5 +error: the `inline` attribute cannot be used on foreign functions + --> $DIR/warn-unused-inline-on-fn-prototypes.rs:10:7 | LL | #[inline] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[inline]` can only be applied to functions with a body + = help: the `inline` attribute can only be applied to functions with a body = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 2 previous errors diff --git a/tests/ui/loop-match/invalid-attribute.rs b/tests/ui/loop-match/invalid-attribute.rs index 2953df6373e69..35882fe7abac5 100644 --- a/tests/ui/loop-match/invalid-attribute.rs +++ b/tests/ui/loop-match/invalid-attribute.rs @@ -38,7 +38,7 @@ fn main() { { #[loop_match] //~ ERROR attribute cannot be used on #[const_continue] - //~^ ERROR `#[const_continue]` attribute cannot be used on expressions + //~^ ERROR the `const_continue` attribute cannot be used on expressions 5 }; } diff --git a/tests/ui/loop-match/invalid-attribute.stderr b/tests/ui/loop-match/invalid-attribute.stderr index ce291d6d446a6..6c76d279d80c0 100644 --- a/tests/ui/loop-match/invalid-attribute.stderr +++ b/tests/ui/loop-match/invalid-attribute.stderr @@ -1,114 +1,114 @@ -error: `#[loop_match]` attribute cannot be used on crates - --> $DIR/invalid-attribute.rs:6:1 +error: the `loop_match` attribute cannot be used on crates + --> $DIR/invalid-attribute.rs:6:4 | LL | #![loop_match] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on crates - --> $DIR/invalid-attribute.rs:7:1 +error: the `const_continue` attribute cannot be used on crates + --> $DIR/invalid-attribute.rs:7:4 | LL | #![const_continue] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on foreign functions - --> $DIR/invalid-attribute.rs:10:5 +error: the `loop_match` attribute cannot be used on foreign functions + --> $DIR/invalid-attribute.rs:10:7 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on foreign functions - --> $DIR/invalid-attribute.rs:11:5 +error: the `const_continue` attribute cannot be used on foreign functions + --> $DIR/invalid-attribute.rs:11:7 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on structs - --> $DIR/invalid-attribute.rs:15:1 +error: the `loop_match` attribute cannot be used on structs + --> $DIR/invalid-attribute.rs:15:3 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on structs - --> $DIR/invalid-attribute.rs:16:1 +error: the `const_continue` attribute cannot be used on structs + --> $DIR/invalid-attribute.rs:16:3 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on required trait methods - --> $DIR/invalid-attribute.rs:24:5 +error: the `loop_match` attribute cannot be used on required trait methods + --> $DIR/invalid-attribute.rs:24:7 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on required trait methods - --> $DIR/invalid-attribute.rs:25:5 +error: the `const_continue` attribute cannot be used on required trait methods + --> $DIR/invalid-attribute.rs:25:7 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on functions - --> $DIR/invalid-attribute.rs:29:1 +error: the `loop_match` attribute cannot be used on functions + --> $DIR/invalid-attribute.rs:29:3 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on functions - --> $DIR/invalid-attribute.rs:30:1 +error: the `const_continue` attribute cannot be used on functions + --> $DIR/invalid-attribute.rs:30:3 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on closures - --> $DIR/invalid-attribute.rs:34:5 +error: the `loop_match` attribute cannot be used on closures + --> $DIR/invalid-attribute.rs:34:7 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on closures - --> $DIR/invalid-attribute.rs:35:5 +error: the `const_continue` attribute cannot be used on closures + --> $DIR/invalid-attribute.rs:35:7 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions -error: `#[loop_match]` attribute cannot be used on expressions - --> $DIR/invalid-attribute.rs:39:9 +error: the `loop_match` attribute cannot be used on expressions + --> $DIR/invalid-attribute.rs:39:11 | LL | #[loop_match] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[loop_match]` can only be applied to loops + = help: the `loop_match` attribute can only be applied to loops -error: `#[const_continue]` attribute cannot be used on expressions - --> $DIR/invalid-attribute.rs:40:9 +error: the `const_continue` attribute cannot be used on expressions + --> $DIR/invalid-attribute.rs:40:11 | LL | #[const_continue] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[const_continue]` can only be applied to break expressions + = help: the `const_continue` attribute can only be applied to break expressions error: aborting due to 14 previous errors diff --git a/tests/ui/macros/issue-68060.stderr b/tests/ui/macros/issue-68060.stderr index 54a6baaa39369..fbcda462197c2 100644 --- a/tests/ui/macros/issue-68060.stderr +++ b/tests/ui/macros/issue-68060.stderr @@ -1,10 +1,10 @@ -error: `#[target_feature]` attribute cannot be used on closures - --> $DIR/issue-68060.rs:4:13 +error: the `target_feature` attribute cannot be used on closures + --> $DIR/issue-68060.rs:4:15 | LL | #[target_feature(enable = "")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can be applied to functions and methods + = help: the `target_feature` attribute can be applied to functions and methods error[E0658]: `#[track_caller]` on closures is currently unstable --> $DIR/issue-68060.rs:6:13 diff --git a/tests/ui/malformed/malformed-regressions.stderr b/tests/ui/malformed/malformed-regressions.stderr index b831ba4a58b75..9ce4638ab6d37 100644 --- a/tests/ui/malformed/malformed-regressions.stderr +++ b/tests/ui/malformed/malformed-regressions.stderr @@ -47,23 +47,23 @@ LL | #[inline = ""] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #57571 -warning: `#[link]` attribute cannot be used on functions - --> $DIR/malformed-regressions.rs:8:1 +warning: the `link` attribute cannot be used on functions + --> $DIR/malformed-regressions.rs:8:3 | LL | #[link] - | ^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` -warning: `#[link]` attribute cannot be used on functions - --> $DIR/malformed-regressions.rs:11:1 +warning: the `link` attribute cannot be used on functions + --> $DIR/malformed-regressions.rs:11:3 | LL | #[link = ""] - | ^^^^^^^^^^^^ + | ^^^^ | - = help: `#[link]` can only be applied to foreign modules + = help: the `link` attribute can only be applied to foreign modules = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 5 previous errors; 2 warnings emitted diff --git a/tests/ui/marker_trait_attr/marker-attribute-on-non-trait.stderr b/tests/ui/marker_trait_attr/marker-attribute-on-non-trait.stderr index 71abe7f39df03..0a9cde8461100 100644 --- a/tests/ui/marker_trait_attr/marker-attribute-on-non-trait.stderr +++ b/tests/ui/marker_trait_attr/marker-attribute-on-non-trait.stderr @@ -1,50 +1,50 @@ -error: `#[marker]` attribute cannot be used on structs - --> $DIR/marker-attribute-on-non-trait.rs:3:1 +error: the `marker` attribute cannot be used on structs + --> $DIR/marker-attribute-on-non-trait.rs:3:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits -error: `#[marker]` attribute cannot be used on inherent impl blocks - --> $DIR/marker-attribute-on-non-trait.rs:6:1 +error: the `marker` attribute cannot be used on inherent impl blocks + --> $DIR/marker-attribute-on-non-trait.rs:6:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits -error: `#[marker]` attribute cannot be used on unions - --> $DIR/marker-attribute-on-non-trait.rs:9:1 +error: the `marker` attribute cannot be used on unions + --> $DIR/marker-attribute-on-non-trait.rs:9:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits -error: `#[marker]` attribute cannot be used on constants - --> $DIR/marker-attribute-on-non-trait.rs:14:1 +error: the `marker` attribute cannot be used on constants + --> $DIR/marker-attribute-on-non-trait.rs:14:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits -error: `#[marker]` attribute cannot be used on functions - --> $DIR/marker-attribute-on-non-trait.rs:17:1 +error: the `marker` attribute cannot be used on functions + --> $DIR/marker-attribute-on-non-trait.rs:17:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits -error: `#[marker]` attribute cannot be used on type aliases - --> $DIR/marker-attribute-on-non-trait.rs:20:1 +error: the `marker` attribute cannot be used on type aliases + --> $DIR/marker-attribute-on-non-trait.rs:20:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits error: aborting due to 6 previous errors diff --git a/tests/ui/panic-handler/panic-handler-wrong-location.stderr b/tests/ui/panic-handler/panic-handler-wrong-location.stderr index 7af0a4326d9a0..a9c545d447c3c 100644 --- a/tests/ui/panic-handler/panic-handler-wrong-location.stderr +++ b/tests/ui/panic-handler/panic-handler-wrong-location.stderr @@ -1,12 +1,12 @@ error: `#[panic_handler]` function required, but not found -error: `#[panic_handler]` attribute cannot be used on statics - --> $DIR/panic-handler-wrong-location.rs:6:1 +error: the `panic_handler` attribute cannot be used on statics + --> $DIR/panic-handler-wrong-location.rs:6:3 | LL | #[panic_handler] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | - = help: `#[panic_handler]` can only be applied to functions + = help: the `panic_handler` attribute can only be applied to functions error: aborting due to 2 previous errors diff --git a/tests/ui/pin-ergonomics/pin_v2-attr.rs b/tests/ui/pin-ergonomics/pin_v2-attr.rs index ba25d3587edd8..588ea014d4533 100644 --- a/tests/ui/pin-ergonomics/pin_v2-attr.rs +++ b/tests/ui/pin-ergonomics/pin_v2-attr.rs @@ -7,7 +7,7 @@ fn_delegation, )] #![allow(incomplete_features)] -#![pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on crates +#![pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on crates // allowed @@ -25,114 +25,114 @@ union Union { // disallowed enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { - //~^ ERROR `#[pin_v2]` attribute cannot be used on type parameters - //~| ERROR `#[pin_v2]` attribute cannot be used on type parameters - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on enum variants + //~^ ERROR the `pin_v2` attribute cannot be used on type parameters + //~| ERROR the `pin_v2` attribute cannot be used on type parameters + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on enum variants UnitVariant, - TupleVariant(#[pin_v2] T), //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + TupleVariant(#[pin_v2] T), //~ ERROR the `pin_v2` attribute cannot be used on struct fields StructVariant { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on struct fields field: U, }, } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on traits +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on traits trait Trait { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on associated consts + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on associated consts const ASSOC_CONST: () = (); - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on associated types + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on associated types type AssocType = (); - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on required trait methods + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on required trait methods fn method(); - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on provided trait methods + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on provided trait methods fn method_with_body() {} } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait aliases +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on trait aliases trait TraitAlias = Trait; -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on inherent impl blocks +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on inherent impl blocks impl Struct { // FIXME: delegation macros are not tested yet (how to?) - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on delegations + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on delegations reuse ::type_id; - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on inherent methods + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on inherent methods fn method() {} } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait impl blocks +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on trait impl blocks impl Trait for Enum { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait methods in impl blocks + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on trait methods in impl blocks fn method() {} } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on extern crates +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on extern crates extern crate alloc; -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on use statements +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on use statements use std::pin::Pin; -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on statics +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on statics static STATIC: () = (); -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on constants +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on constants const CONST: () = (); -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on functions +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on functions fn f(#[pin_v2] param: Foo) -//~^ ERROR `#[pin_v2]` attribute cannot be used on function params +//~^ ERROR the `pin_v2` attribute cannot be used on function params //~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters where #[pin_v2] - //~^ ERROR `#[pin_v2]` attribute cannot be used on where predicates + //~^ ERROR the `pin_v2` attribute cannot be used on where predicates T:, { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on closures + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on closures || (); - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on expressions + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on expressions [(), (), ()]; - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on statements + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on statements let _: Foo<(), ()> = Foo::StructVariant { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on struct fields field: (), }; match param { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on match arms + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on match arms Foo::UnitVariant => {} Foo::TupleVariant(..) => {} Foo::StructVariant { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on pattern fields + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on pattern fields field, } => {} } } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on modules +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on modules mod m {} -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign modules +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on foreign modules extern "C" { - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign types + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on foreign types type ForeignTy; - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign statics + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on foreign statics static EXTERN_STATIC: (); - #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign functions + #[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on foreign functions fn extern_fn(); } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on type alias +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on type alias type Type = (); -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on macro defs +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on macro defs macro_rules! macro_def { () => {}; } -#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on macro calls +#[pin_v2] //~ ERROR the `pin_v2` attribute cannot be used on macro calls macro_def!(); fn main() {} diff --git a/tests/ui/pin-ergonomics/pin_v2-attr.stderr b/tests/ui/pin-ergonomics/pin_v2-attr.stderr index 7f11124a081ae..d58fce5e282b2 100644 --- a/tests/ui/pin-ergonomics/pin_v2-attr.stderr +++ b/tests/ui/pin-ergonomics/pin_v2-attr.stderr @@ -1,10 +1,10 @@ -error: `#[pin_v2]` attribute cannot be used on macro calls - --> $DIR/pin_v2-attr.rs:135:1 +error: the `pin_v2` attribute cannot be used on macro calls + --> $DIR/pin_v2-attr.rs:135:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters @@ -13,301 +13,301 @@ error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed LL | fn f(#[pin_v2] param: Foo) | ^^^^^^^^^ -error: `#[pin_v2]` attribute cannot be used on crates - --> $DIR/pin_v2-attr.rs:10:1 +error: the `pin_v2` attribute cannot be used on crates + --> $DIR/pin_v2-attr.rs:10:4 | LL | #![pin_v2] - | ^^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on type parameters - --> $DIR/pin_v2-attr.rs:27:10 +error: the `pin_v2` attribute cannot be used on type parameters + --> $DIR/pin_v2-attr.rs:27:12 | LL | enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on type parameters - --> $DIR/pin_v2-attr.rs:27:23 +error: the `pin_v2` attribute cannot be used on type parameters + --> $DIR/pin_v2-attr.rs:27:25 | LL | enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on enum variants - --> $DIR/pin_v2-attr.rs:30:5 +error: the `pin_v2` attribute cannot be used on enum variants + --> $DIR/pin_v2-attr.rs:30:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on struct fields - --> $DIR/pin_v2-attr.rs:32:18 +error: the `pin_v2` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:32:20 | LL | TupleVariant(#[pin_v2] T), - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on struct fields - --> $DIR/pin_v2-attr.rs:34:9 +error: the `pin_v2` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:34:11 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on traits - --> $DIR/pin_v2-attr.rs:39:1 +error: the `pin_v2` attribute cannot be used on traits + --> $DIR/pin_v2-attr.rs:39:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on associated consts - --> $DIR/pin_v2-attr.rs:41:5 +error: the `pin_v2` attribute cannot be used on associated consts + --> $DIR/pin_v2-attr.rs:41:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on associated types - --> $DIR/pin_v2-attr.rs:43:5 +error: the `pin_v2` attribute cannot be used on associated types + --> $DIR/pin_v2-attr.rs:43:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on required trait methods - --> $DIR/pin_v2-attr.rs:46:5 +error: the `pin_v2` attribute cannot be used on required trait methods + --> $DIR/pin_v2-attr.rs:46:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on provided trait methods - --> $DIR/pin_v2-attr.rs:48:5 +error: the `pin_v2` attribute cannot be used on provided trait methods + --> $DIR/pin_v2-attr.rs:48:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on trait aliases - --> $DIR/pin_v2-attr.rs:52:1 +error: the `pin_v2` attribute cannot be used on trait aliases + --> $DIR/pin_v2-attr.rs:52:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on inherent impl blocks - --> $DIR/pin_v2-attr.rs:55:1 +error: the `pin_v2` attribute cannot be used on inherent impl blocks + --> $DIR/pin_v2-attr.rs:55:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on delegations - --> $DIR/pin_v2-attr.rs:58:5 +error: the `pin_v2` attribute cannot be used on delegations + --> $DIR/pin_v2-attr.rs:58:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on inherent methods - --> $DIR/pin_v2-attr.rs:61:5 +error: the `pin_v2` attribute cannot be used on inherent methods + --> $DIR/pin_v2-attr.rs:61:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on trait impl blocks - --> $DIR/pin_v2-attr.rs:65:1 +error: the `pin_v2` attribute cannot be used on trait impl blocks + --> $DIR/pin_v2-attr.rs:65:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on trait methods in impl blocks - --> $DIR/pin_v2-attr.rs:67:5 +error: the `pin_v2` attribute cannot be used on trait methods in impl blocks + --> $DIR/pin_v2-attr.rs:67:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on extern crates - --> $DIR/pin_v2-attr.rs:71:1 +error: the `pin_v2` attribute cannot be used on extern crates + --> $DIR/pin_v2-attr.rs:71:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on use statements - --> $DIR/pin_v2-attr.rs:74:1 +error: the `pin_v2` attribute cannot be used on use statements + --> $DIR/pin_v2-attr.rs:74:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on statics - --> $DIR/pin_v2-attr.rs:77:1 +error: the `pin_v2` attribute cannot be used on statics + --> $DIR/pin_v2-attr.rs:77:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on constants - --> $DIR/pin_v2-attr.rs:80:1 +error: the `pin_v2` attribute cannot be used on constants + --> $DIR/pin_v2-attr.rs:80:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on functions - --> $DIR/pin_v2-attr.rs:83:1 +error: the `pin_v2` attribute cannot be used on functions + --> $DIR/pin_v2-attr.rs:83:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on function params - --> $DIR/pin_v2-attr.rs:84:12 +error: the `pin_v2` attribute cannot be used on function params + --> $DIR/pin_v2-attr.rs:84:14 | LL | fn f(#[pin_v2] param: Foo) - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on closures - --> $DIR/pin_v2-attr.rs:92:5 +error: the `pin_v2` attribute cannot be used on closures + --> $DIR/pin_v2-attr.rs:92:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on expressions - --> $DIR/pin_v2-attr.rs:94:5 +error: the `pin_v2` attribute cannot be used on expressions + --> $DIR/pin_v2-attr.rs:94:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on struct fields - --> $DIR/pin_v2-attr.rs:98:9 +error: the `pin_v2` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:98:11 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on statements - --> $DIR/pin_v2-attr.rs:96:5 +error: the `pin_v2` attribute cannot be used on statements + --> $DIR/pin_v2-attr.rs:96:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on match arms - --> $DIR/pin_v2-attr.rs:102:9 +error: the `pin_v2` attribute cannot be used on match arms + --> $DIR/pin_v2-attr.rs:102:11 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on pattern fields - --> $DIR/pin_v2-attr.rs:106:13 +error: the `pin_v2` attribute cannot be used on pattern fields + --> $DIR/pin_v2-attr.rs:106:15 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on where predicates - --> $DIR/pin_v2-attr.rs:88:5 +error: the `pin_v2` attribute cannot be used on where predicates + --> $DIR/pin_v2-attr.rs:88:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on modules - --> $DIR/pin_v2-attr.rs:112:1 +error: the `pin_v2` attribute cannot be used on modules + --> $DIR/pin_v2-attr.rs:112:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on foreign modules - --> $DIR/pin_v2-attr.rs:115:1 +error: the `pin_v2` attribute cannot be used on foreign modules + --> $DIR/pin_v2-attr.rs:115:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on foreign types - --> $DIR/pin_v2-attr.rs:117:5 +error: the `pin_v2` attribute cannot be used on foreign types + --> $DIR/pin_v2-attr.rs:117:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on foreign statics - --> $DIR/pin_v2-attr.rs:120:5 +error: the `pin_v2` attribute cannot be used on foreign statics + --> $DIR/pin_v2-attr.rs:120:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on foreign functions - --> $DIR/pin_v2-attr.rs:123:5 +error: the `pin_v2` attribute cannot be used on foreign functions + --> $DIR/pin_v2-attr.rs:123:7 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on type aliases - --> $DIR/pin_v2-attr.rs:127:1 +error: the `pin_v2` attribute cannot be used on type aliases + --> $DIR/pin_v2-attr.rs:127:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types -error: `#[pin_v2]` attribute cannot be used on macro defs - --> $DIR/pin_v2-attr.rs:130:1 +error: the `pin_v2` attribute cannot be used on macro defs + --> $DIR/pin_v2-attr.rs:130:3 | LL | #[pin_v2] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[pin_v2]` can only be applied to data types + = help: the `pin_v2` attribute can only be applied to data types error: aborting due to 39 previous errors diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr b/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr index f14acd1b78532..882de640aa2f1 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr @@ -94,21 +94,21 @@ LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ = help: use `crate::feature` to refer to this attribute macro unambiguously -error: `#[repr(C)]` attribute cannot be used on match arms - --> $DIR/ambiguous-builtin-attrs.rs:25:9 +error: the `repr(C)` attribute cannot be used on match arms + --> $DIR/ambiguous-builtin-attrs.rs:25:11 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(C)]` attribute cannot be used on type parameters - --> $DIR/ambiguous-builtin-attrs.rs:21:32 +error: the `repr(C)` attribute cannot be used on type parameters + --> $DIR/ambiguous-builtin-attrs.rs:21:34 | LL | fn non_macro_expanded_location<#[repr(C)] T>() { - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types error: aborting due to 9 previous errors diff --git a/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr b/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr index f01619b919564..b8f8f535d4058 100644 --- a/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr +++ b/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr @@ -4,13 +4,13 @@ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `p LL | #[proc_macro_derive(Foo)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[proc_macro_derive]` attribute cannot be used on structs - --> $DIR/illegal-proc-macro-derive-use.rs:10:1 +error: the `proc_macro_derive` attribute cannot be used on structs + --> $DIR/illegal-proc-macro-derive-use.rs:10:3 | LL | #[proc_macro_derive(Foo)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[proc_macro_derive]` can only be applied to functions + = help: the `proc_macro_derive` attribute can only be applied to functions error: aborting due to 2 previous errors diff --git a/tests/ui/repr/attr-usage-repr.stderr b/tests/ui/repr/attr-usage-repr.stderr index 5511f90582d66..3f34e2a3bc3ee 100644 --- a/tests/ui/repr/attr-usage-repr.stderr +++ b/tests/ui/repr/attr-usage-repr.stderr @@ -1,42 +1,42 @@ -error: `#[repr(C)]` attribute cannot be used on functions - --> $DIR/attr-usage-repr.rs:3:1 +error: the `repr(C)` attribute cannot be used on functions + --> $DIR/attr-usage-repr.rs:3:3 | LL | #[repr(C)] - | ^^^^^^^^^^ + | ^^^^^^^ | - = help: `#[repr(C)]` can only be applied to data types + = help: the `repr(C)` attribute can only be applied to data types -error: `#[repr(i8)]` attribute cannot be used on structs - --> $DIR/attr-usage-repr.rs:15:1 +error: the `repr(i8)` attribute cannot be used on structs + --> $DIR/attr-usage-repr.rs:15:3 | LL | #[repr(i8)] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[repr(i8)]` can only be applied to enums + = help: the `repr(i8)` attribute can only be applied to enums -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/attr-usage-repr.rs:30:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/attr-usage-repr.rs:30:3 | LL | #[repr(packed)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions -error: `#[repr(simd)]` attribute cannot be used on enums - --> $DIR/attr-usage-repr.rs:36:1 +error: the `repr(simd)` attribute cannot be used on enums + --> $DIR/attr-usage-repr.rs:36:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs -error: `#[repr()]` attribute cannot be used on type aliases - --> $DIR/attr-usage-repr.rs:48:1 +error: the `repr()` attribute cannot be used on type aliases + --> $DIR/attr-usage-repr.rs:48:3 | LL | #[repr()] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[repr()]` can only be applied to data types + = help: the `repr()` attribute can only be applied to data types warning: unused attribute --> $DIR/attr-usage-repr.rs:48:1 diff --git a/tests/ui/repr/invalid-repr-on-structs-74082.stderr b/tests/ui/repr/invalid-repr-on-structs-74082.stderr index a9dc539f62ce6..c9c89f588140a 100644 --- a/tests/ui/repr/invalid-repr-on-structs-74082.stderr +++ b/tests/ui/repr/invalid-repr-on-structs-74082.stderr @@ -1,18 +1,18 @@ -error: `#[repr(i128)]` attribute cannot be used on structs - --> $DIR/invalid-repr-on-structs-74082.rs:4:1 +error: the `repr(i128)` attribute cannot be used on structs + --> $DIR/invalid-repr-on-structs-74082.rs:4:3 | LL | #[repr(i128)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(i128)]` can only be applied to enums + = help: the `repr(i128)` attribute can only be applied to enums -error: `#[repr(u128)]` attribute cannot be used on structs - --> $DIR/invalid-repr-on-structs-74082.rs:7:1 +error: the `repr(u128)` attribute cannot be used on structs + --> $DIR/invalid-repr-on-structs-74082.rs:7:3 | LL | #[repr(u128)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(u128)]` can only be applied to enums + = help: the `repr(u128)` attribute can only be applied to enums error: aborting due to 2 previous errors diff --git a/tests/ui/repr/issue-83505-repr-simd.stderr b/tests/ui/repr/issue-83505-repr-simd.stderr index d0f895b4e34d2..c6da78ea48c0f 100644 --- a/tests/ui/repr/issue-83505-repr-simd.stderr +++ b/tests/ui/repr/issue-83505-repr-simd.stderr @@ -16,13 +16,13 @@ LL | #[repr(simd)] = help: add `#![feature(repr_simd)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[repr(simd)]` attribute cannot be used on enums - --> $DIR/issue-83505-repr-simd.rs:5:1 +error: the `repr(simd)` attribute cannot be used on enums + --> $DIR/issue-83505-repr-simd.rs:5:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs error[E0084]: unsupported representation for zero-variant enum --> $DIR/issue-83505-repr-simd.rs:5:8 diff --git a/tests/ui/repr/repr-disallow-on-variant.stderr b/tests/ui/repr/repr-disallow-on-variant.stderr index 39556fb589b5d..4b7b345ac2624 100644 --- a/tests/ui/repr/repr-disallow-on-variant.stderr +++ b/tests/ui/repr/repr-disallow-on-variant.stderr @@ -1,10 +1,10 @@ -error: `#[repr(u8)]` attribute cannot be used on enum variants - --> $DIR/repr-disallow-on-variant.rs:4:5 +error: the `repr(u8)` attribute cannot be used on enum variants + --> $DIR/repr-disallow-on-variant.rs:4:7 | LL | #[repr(u8)] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[repr(u8)]` can only be applied to enums + = help: the `repr(u8)` attribute can only be applied to enums error: aborting due to 1 previous error diff --git a/tests/ui/repr/repr-empty-packed.stderr b/tests/ui/repr/repr-empty-packed.stderr index 903a5ff6fea21..1636242c18c77 100644 --- a/tests/ui/repr/repr-empty-packed.stderr +++ b/tests/ui/repr/repr-empty-packed.stderr @@ -1,10 +1,10 @@ -error: `#[repr(packed)]` attribute cannot be used on enums - --> $DIR/repr-empty-packed.rs:5:1 +error: the `repr(packed)` attribute cannot be used on enums + --> $DIR/repr-empty-packed.rs:5:3 | LL | #[repr(packed)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[repr(packed)]` can be applied to structs and unions + = help: the `repr(packed)` attribute can be applied to structs and unions error: unused attribute --> $DIR/repr-empty-packed.rs:4:1 diff --git a/tests/ui/repr/repr-transparent-other-items.stderr b/tests/ui/repr/repr-transparent-other-items.stderr index ddab462eb162f..82623ec47c83d 100644 --- a/tests/ui/repr/repr-transparent-other-items.stderr +++ b/tests/ui/repr/repr-transparent-other-items.stderr @@ -1,18 +1,18 @@ -error: `#[repr(transparent)]` attribute cannot be used on functions - --> $DIR/repr-transparent-other-items.rs:3:1 +error: the `repr(transparent)` attribute cannot be used on functions + --> $DIR/repr-transparent-other-items.rs:3:3 | LL | #[repr(transparent)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[repr(transparent)]` can only be applied to data types + = help: the `repr(transparent)` attribute can only be applied to data types -error: `#[repr(transparent)]` attribute cannot be used on statics - --> $DIR/repr-transparent-other-items.rs:6:1 +error: the `repr(transparent)` attribute cannot be used on statics + --> $DIR/repr-transparent-other-items.rs:6:3 | LL | #[repr(transparent)] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | - = help: `#[repr(transparent)]` can only be applied to data types + = help: the `repr(transparent)` attribute can only be applied to data types error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr index de2e5e3dc7247..de6fdb9b47658 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr @@ -12,21 +12,21 @@ LL - #[non_exhaustive(anything)] LL + #[non_exhaustive] | -error: `#[non_exhaustive]` attribute cannot be used on traits - --> $DIR/invalid-attribute.rs:5:1 +error: the `non_exhaustive` attribute cannot be used on traits + --> $DIR/invalid-attribute.rs:5:3 | LL | #[non_exhaustive] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[non_exhaustive]` can be applied to data types and enum variants + = help: the `non_exhaustive` attribute can be applied to data types and enum variants -error: `#[non_exhaustive]` attribute cannot be used on unions - --> $DIR/invalid-attribute.rs:9:1 +error: the `non_exhaustive` attribute cannot be used on unions + --> $DIR/invalid-attribute.rs:9:3 | LL | #[non_exhaustive] - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[non_exhaustive]` can be applied to enum variants, enums, and structs + = help: the `non_exhaustive` attribute can be applied to enum variants, enums, and structs error: aborting due to 3 previous errors diff --git a/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.stderr b/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.stderr index 3277fec050ec1..d80d55064f639 100644 --- a/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.stderr +++ b/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.stderr @@ -1,10 +1,10 @@ -warning: `#[track_caller]` attribute cannot be used on macro defs - --> $DIR/macro-declaration.rs:4:1 +warning: the `track_caller` attribute cannot be used on macro defs + --> $DIR/macro-declaration.rs:4:3 | LL | #[track_caller] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[track_caller]` can only be applied to functions + = help: the `track_caller` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` diff --git a/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr index 6ff66be4e5cea..c411acfdaa7e9 100644 --- a/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr +++ b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr @@ -1,10 +1,10 @@ -error: `#[track_caller]` attribute cannot be used on structs - --> $DIR/only-for-fns.rs:1:1 +error: the `track_caller` attribute cannot be used on structs + --> $DIR/only-for-fns.rs:1:3 | LL | #[track_caller] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[track_caller]` can only be applied to functions + = help: the `track_caller` attribute can only be applied to functions error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr index b260c5147b145..cee602a274bb3 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr @@ -382,149 +382,149 @@ error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed LL | #[no_mangle] b: i32 | ^^^^^^^^^^^^ -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:40:5 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:40:7 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: requested on the command line with `-W unused-attributes` -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:46:5 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:46:7 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:195:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:195:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:201:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:201:11 | LL | #[no_mangle] b: i32 - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:131:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:131:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:137:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:137:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:150:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:150:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:156:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:156:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:64:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:64:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:70:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:70:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:83:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:83:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:89:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:89:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:108:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:108:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:114:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:114:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[must_use]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:174:9 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:174:11 | LL | #[must_use] - | ^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[must_use]` can be applied to data types, functions, and traits + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: `#[no_mangle]` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:180:9 +warning: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:180:11 | LL | #[no_mangle] b: i32, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[no_mangle]` can be applied to functions and statics + = help: the `no_mangle` attribute can be applied to functions and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! error: aborting due to 64 previous errors; 16 warnings emitted diff --git a/tests/ui/sanitize-attr/valid-sanitize.stderr b/tests/ui/sanitize-attr/valid-sanitize.stderr index e1d6c0e187fdc..be6e9ad52dd85 100644 --- a/tests/ui/sanitize-attr/valid-sanitize.stderr +++ b/tests/ui/sanitize-attr/valid-sanitize.stderr @@ -6,141 +6,141 @@ LL | #[sanitize(thread = "off")] | = help: `#[sanitize]` can be used on statics if only the address is sanitized -error: `#[sanitize]` attribute cannot be used on type aliases - --> $DIR/valid-sanitize.rs:18:1 +error: the `sanitize` attribute cannot be used on type aliases + --> $DIR/valid-sanitize.rs:18:3 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on traits - --> $DIR/valid-sanitize.rs:21:1 +error: the `sanitize` attribute cannot be used on traits + --> $DIR/valid-sanitize.rs:21:3 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on associated consts - --> $DIR/valid-sanitize.rs:23:5 +error: the `sanitize` attribute cannot be used on associated consts + --> $DIR/valid-sanitize.rs:23:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on associated types - --> $DIR/valid-sanitize.rs:26:5 +error: the `sanitize` attribute cannot be used on associated types + --> $DIR/valid-sanitize.rs:26:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on required trait methods - --> $DIR/valid-sanitize.rs:29:5 +error: the `sanitize` attribute cannot be used on required trait methods + --> $DIR/valid-sanitize.rs:29:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions with a body, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions with a body, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on required trait methods - --> $DIR/valid-sanitize.rs:35:5 +error: the `sanitize` attribute cannot be used on required trait methods + --> $DIR/valid-sanitize.rs:35:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions with a body, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions with a body, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on associated types - --> $DIR/valid-sanitize.rs:43:5 +error: the `sanitize` attribute cannot be used on associated types + --> $DIR/valid-sanitize.rs:43:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on associated types - --> $DIR/valid-sanitize.rs:60:5 +error: the `sanitize` attribute cannot be used on associated types + --> $DIR/valid-sanitize.rs:60:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on structs - --> $DIR/valid-sanitize.rs:65:1 +error: the `sanitize` attribute cannot be used on structs + --> $DIR/valid-sanitize.rs:65:3 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on struct fields - --> $DIR/valid-sanitize.rs:67:5 +error: the `sanitize` attribute cannot be used on struct fields + --> $DIR/valid-sanitize.rs:67:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on foreign statics - --> $DIR/valid-sanitize.rs:80:5 +error: the `sanitize` attribute cannot be used on foreign statics + --> $DIR/valid-sanitize.rs:80:7 | LL | #[sanitize(address = "off", thread = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on foreign types - --> $DIR/valid-sanitize.rs:83:5 +error: the `sanitize` attribute cannot be used on foreign types + --> $DIR/valid-sanitize.rs:83:7 | LL | #[sanitize(address = "off", thread = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on foreign functions - --> $DIR/valid-sanitize.rs:86:5 +error: the `sanitize` attribute cannot be used on foreign functions + --> $DIR/valid-sanitize.rs:86:7 | LL | #[sanitize(address = "off", thread = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions with a body, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions with a body, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on statements - --> $DIR/valid-sanitize.rs:92:5 +error: the `sanitize` attribute cannot be used on statements + --> $DIR/valid-sanitize.rs:92:7 | LL | #[sanitize(address = "off", thread = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on statements - --> $DIR/valid-sanitize.rs:98:5 +error: the `sanitize` attribute cannot be used on statements + --> $DIR/valid-sanitize.rs:98:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on match arms - --> $DIR/valid-sanitize.rs:109:9 +error: the `sanitize` attribute cannot be used on match arms + --> $DIR/valid-sanitize.rs:109:11 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics -error: `#[sanitize]` attribute cannot be used on expressions - --> $DIR/valid-sanitize.rs:113:5 +error: the `sanitize` attribute cannot be used on expressions + --> $DIR/valid-sanitize.rs:113:7 | LL | #[sanitize(address = "off")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ | - = help: `#[sanitize]` can be applied to crates, functions, impl blocks, modules, and statics + = help: the `sanitize` attribute can be applied to crates, functions, impl blocks, modules, and statics error: aborting due to 18 previous errors diff --git a/tests/ui/scalable-vectors/invalid.rs b/tests/ui/scalable-vectors/invalid.rs index 0b6a915e5ccd2..4bbe11e019a62 100644 --- a/tests/ui/scalable-vectors/invalid.rs +++ b/tests/ui/scalable-vectors/invalid.rs @@ -8,133 +8,133 @@ #![feature(trait_alias)] #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on extern crates +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on extern crates extern crate std as other_std; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on use statements +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on use statements use std::vec::Vec; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on statics +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on statics static _X: u32 = 0; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on constants +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on constants const _Y: u32 = 0; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on modules +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on modules mod bar { } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on foreign modules +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on foreign modules unsafe extern "C" { #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on foreign statics +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on foreign statics static X: &'static u32; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on foreign types +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on foreign types type Y; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on foreign functions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on foreign functions fn foo(); } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on type aliases +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on type aliases type Foo = u32; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on enums +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on enums enum Bar<#[rustc_scalable_vector(4)] T> { -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on type parameters +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on type parameters #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on enum variants +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on enum variants Baz(std::marker::PhantomData), } struct Qux { #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on struct fields +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on struct fields field: u32, } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on unions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on unions union FooBar { x: u32, y: u32, } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on traits +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on traits trait FooBaz { #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on associated types +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on associated types type Foo; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on associated consts +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on associated consts const Bar: i32; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on provided trait methods +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on provided trait methods fn foo() {} } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on trait aliases +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on trait aliases trait FooQux = FooBaz; #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on inherent impl blocks +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on inherent impl blocks impl Bar { #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on inherent methods +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on inherent methods fn foo() {} } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on trait impl blocks +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on trait impl blocks impl FooBaz for Bar { type Foo = u32; const Bar: i32 = 3; } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on macro defs +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on macro defs macro_rules! barqux { ($foo:tt) => { $foo }; } #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on functions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on functions fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on function params +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on function params //~^^ ERROR: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on functions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on functions async fn async_foo() {} #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on functions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on functions gen fn gen_foo() {} #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on functions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on functions async gen fn async_gen_foo() {} fn main() { let _x = #[rustc_scalable_vector(4)] || { }; -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on closures +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on closures let _y = #[rustc_scalable_vector(4)] 3 + 4; -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on expressions +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on expressions #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on statements +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on statements let _z = 3; match _z { #[rustc_scalable_vector(4)] -//~^ ERROR: `#[rustc_scalable_vector]` attribute cannot be used on match arms +//~^ ERROR: the `rustc_scalable_vector` attribute cannot be used on match arms 1 => (), _ => (), } diff --git a/tests/ui/scalable-vectors/invalid.stderr b/tests/ui/scalable-vectors/invalid.stderr index a8ef99e2f8bc5..34deb1a13c827 100644 --- a/tests/ui/scalable-vectors/invalid.stderr +++ b/tests/ui/scalable-vectors/invalid.stderr @@ -4,275 +4,275 @@ error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed LL | fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: `#[rustc_scalable_vector]` attribute cannot be used on extern crates +error: the `rustc_scalable_vector` attribute cannot be used on extern crates --> $DIR/invalid.rs:10:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on use statements +error: the `rustc_scalable_vector` attribute cannot be used on use statements --> $DIR/invalid.rs:14:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on statics +error: the `rustc_scalable_vector` attribute cannot be used on statics --> $DIR/invalid.rs:18:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on constants +error: the `rustc_scalable_vector` attribute cannot be used on constants --> $DIR/invalid.rs:22:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on modules +error: the `rustc_scalable_vector` attribute cannot be used on modules --> $DIR/invalid.rs:26:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on foreign modules +error: the `rustc_scalable_vector` attribute cannot be used on foreign modules --> $DIR/invalid.rs:31:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on foreign statics +error: the `rustc_scalable_vector` attribute cannot be used on foreign statics --> $DIR/invalid.rs:34:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on foreign types +error: the `rustc_scalable_vector` attribute cannot be used on foreign types --> $DIR/invalid.rs:37:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on foreign functions +error: the `rustc_scalable_vector` attribute cannot be used on foreign functions --> $DIR/invalid.rs:40:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on type aliases +error: the `rustc_scalable_vector` attribute cannot be used on type aliases --> $DIR/invalid.rs:45:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on enums +error: the `rustc_scalable_vector` attribute cannot be used on enums --> $DIR/invalid.rs:49:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on type parameters +error: the `rustc_scalable_vector` attribute cannot be used on type parameters --> $DIR/invalid.rs:51:10 | LL | enum Bar<#[rustc_scalable_vector(4)] T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on enum variants +error: the `rustc_scalable_vector` attribute cannot be used on enum variants --> $DIR/invalid.rs:53:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on struct fields +error: the `rustc_scalable_vector` attribute cannot be used on struct fields --> $DIR/invalid.rs:59:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on unions +error: the `rustc_scalable_vector` attribute cannot be used on unions --> $DIR/invalid.rs:64:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on traits +error: the `rustc_scalable_vector` attribute cannot be used on traits --> $DIR/invalid.rs:71:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on associated types +error: the `rustc_scalable_vector` attribute cannot be used on associated types --> $DIR/invalid.rs:74:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on associated consts +error: the `rustc_scalable_vector` attribute cannot be used on associated consts --> $DIR/invalid.rs:77:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on provided trait methods +error: the `rustc_scalable_vector` attribute cannot be used on provided trait methods --> $DIR/invalid.rs:80:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on trait aliases +error: the `rustc_scalable_vector` attribute cannot be used on trait aliases --> $DIR/invalid.rs:85:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on inherent impl blocks +error: the `rustc_scalable_vector` attribute cannot be used on inherent impl blocks --> $DIR/invalid.rs:89:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on inherent methods +error: the `rustc_scalable_vector` attribute cannot be used on inherent methods --> $DIR/invalid.rs:92:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on trait impl blocks +error: the `rustc_scalable_vector` attribute cannot be used on trait impl blocks --> $DIR/invalid.rs:97:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on macro defs +error: the `rustc_scalable_vector` attribute cannot be used on macro defs --> $DIR/invalid.rs:104:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on functions +error: the `rustc_scalable_vector` attribute cannot be used on functions --> $DIR/invalid.rs:108:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on function params +error: the `rustc_scalable_vector` attribute cannot be used on function params --> $DIR/invalid.rs:110:11 | LL | fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on functions +error: the `rustc_scalable_vector` attribute cannot be used on functions --> $DIR/invalid.rs:114:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on functions +error: the `rustc_scalable_vector` attribute cannot be used on functions --> $DIR/invalid.rs:118:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on functions +error: the `rustc_scalable_vector` attribute cannot be used on functions --> $DIR/invalid.rs:122:1 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on closures +error: the `rustc_scalable_vector` attribute cannot be used on closures --> $DIR/invalid.rs:127:14 | LL | let _x = #[rustc_scalable_vector(4)] || { }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on expressions +error: the `rustc_scalable_vector` attribute cannot be used on expressions --> $DIR/invalid.rs:129:14 | LL | let _y = #[rustc_scalable_vector(4)] 3 + 4; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on statements +error: the `rustc_scalable_vector` attribute cannot be used on statements --> $DIR/invalid.rs:131:5 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs -error: `#[rustc_scalable_vector]` attribute cannot be used on match arms +error: the `rustc_scalable_vector` attribute cannot be used on match arms --> $DIR/invalid.rs:136:9 | LL | #[rustc_scalable_vector(4)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_scalable_vector]` can only be applied to structs + = help: the `rustc_scalable_vector` attribute can only be applied to structs error[E0539]: malformed `rustc_scalable_vector` attribute input --> $DIR/invalid.rs:143:1 | LL | #[rustc_scalable_vector("4")] - | ^^^^^^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^^^^^^---^ | | | expected an integer literal here | @@ -289,7 +289,7 @@ error[E0805]: malformed `rustc_scalable_vector` attribute input --> $DIR/invalid.rs:147:1 | LL | #[rustc_scalable_vector(4, 2)] - | ^^^^^^^^^^^^^^^^^^^^^^^------^ + | ^^^^^^^^^^^^^^^^^^^^^------ | | | expected a single argument here | @@ -306,7 +306,7 @@ error[E0539]: malformed `rustc_scalable_vector` attribute input --> $DIR/invalid.rs:151:1 | LL | #[rustc_scalable_vector(count = "4")] - | ^^^^^^^^^^^^^^^^^^^^^^^^-----------^^ + | ^^^^^^^^^^^^^^^^^^^^^^-----------^ | | | expected an integer literal here | @@ -323,7 +323,7 @@ error: element count in `rustc_scalable_vector` is too large: `65536` --> $DIR/invalid.rs:155:1 | LL | #[rustc_scalable_vector(65536)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = note: the value may not exceed `u16::MAX` diff --git a/tests/ui/simd/repr-simd-on-enum.stderr b/tests/ui/simd/repr-simd-on-enum.stderr index 5edbcb71be6a0..87f53f712c0e3 100644 --- a/tests/ui/simd/repr-simd-on-enum.stderr +++ b/tests/ui/simd/repr-simd-on-enum.stderr @@ -1,10 +1,10 @@ -error: `#[repr(simd)]` attribute cannot be used on enums - --> $DIR/repr-simd-on-enum.rs:5:1 +error: the `repr(simd)` attribute cannot be used on enums + --> $DIR/repr-simd-on-enum.rs:5:3 | LL | #[repr(simd)] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[repr(simd)]` can only be applied to structs + = help: the `repr(simd)` attribute can only be applied to structs error: aborting due to 1 previous error diff --git a/tests/ui/splat/splat-non-fn-arg.rs b/tests/ui/splat/splat-non-fn-arg.rs index 6f2815e2b6579..ffaaa52f6cdcf 100644 --- a/tests/ui/splat/splat-non-fn-arg.rs +++ b/tests/ui/splat/splat-non-fn-arg.rs @@ -3,10 +3,10 @@ #![allow(incomplete_features)] #![feature(splat)] -#[splat] //~ ERROR `#[splat]` attribute cannot be used on functions +#[splat] //~ ERROR the `splat` attribute cannot be used on functions fn tuple_args_bad((a, b): (u32, i8)) {} -#[splat] //~ ERROR `#[splat]` attribute cannot be used on traits +#[splat] //~ ERROR the `splat` attribute cannot be used on traits trait FooTraitBad { fn tuple_1(_: (u32,)); @@ -15,45 +15,45 @@ trait FooTraitBad { struct Foo; -#[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent impl blocks +#[splat] //~ ERROR the `splat` attribute cannot be used on inherent impl blocks impl Foo { fn tuple_1_bad((a,): (u32,)) {} } impl Foo { - #[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent methods + #[splat] //~ ERROR the `splat` attribute cannot be used on inherent methods fn tuple_3_bad((a, b, c): (u32, i32, i8)) {} - #[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent methods + #[splat] //~ ERROR the `splat` attribute cannot be used on inherent methods fn tuple_2_bad(self, (a, b): (u32, i8)) -> u32 { a } } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on trait impl blocks +#[splat] //~ ERROR the `splat` attribute cannot be used on trait impl blocks impl FooTraitBad for Foo { fn tuple_1(_: (u32,)) {} fn tuple_4(self, _: (u32, i8, (), f32)) {} } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on foreign modules +#[splat] //~ ERROR the `splat` attribute cannot be used on foreign modules extern "C" { fn foo_2(_: (u32, i8)); } extern "C" { - #[splat] //~ ERROR `#[splat]` attribute cannot be used on foreign functions + #[splat] //~ ERROR the `splat` attribute cannot be used on foreign functions fn bar_2_bad(_: (u32, i8)); } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on modules +#[splat] //~ ERROR the `splat` attribute cannot be used on modules mod foo_mod {} -#[splat] //~ ERROR `#[splat]` attribute cannot be used on use statements +#[splat] //~ ERROR the `splat` attribute cannot be used on use statements use std::mem; -#[splat] //~ ERROR `#[splat]` attribute cannot be used on structs +#[splat] //~ ERROR the `splat` attribute cannot be used on structs struct FooStruct; fn main() {} diff --git a/tests/ui/splat/splat-non-fn-arg.stderr b/tests/ui/splat/splat-non-fn-arg.stderr index 089636f3d4dff..b86432a25cf46 100644 --- a/tests/ui/splat/splat-non-fn-arg.stderr +++ b/tests/ui/splat/splat-non-fn-arg.stderr @@ -1,90 +1,90 @@ -error: `#[splat]` attribute cannot be used on functions - --> $DIR/splat-non-fn-arg.rs:6:1 +error: the `splat` attribute cannot be used on functions + --> $DIR/splat-non-fn-arg.rs:6:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on traits - --> $DIR/splat-non-fn-arg.rs:9:1 +error: the `splat` attribute cannot be used on traits + --> $DIR/splat-non-fn-arg.rs:9:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent impl blocks - --> $DIR/splat-non-fn-arg.rs:18:1 +error: the `splat` attribute cannot be used on inherent impl blocks + --> $DIR/splat-non-fn-arg.rs:18:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent methods - --> $DIR/splat-non-fn-arg.rs:24:5 +error: the `splat` attribute cannot be used on inherent methods + --> $DIR/splat-non-fn-arg.rs:24:7 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent methods - --> $DIR/splat-non-fn-arg.rs:27:5 +error: the `splat` attribute cannot be used on inherent methods + --> $DIR/splat-non-fn-arg.rs:27:7 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on trait impl blocks - --> $DIR/splat-non-fn-arg.rs:33:1 +error: the `splat` attribute cannot be used on trait impl blocks + --> $DIR/splat-non-fn-arg.rs:33:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on foreign modules - --> $DIR/splat-non-fn-arg.rs:40:1 +error: the `splat` attribute cannot be used on foreign modules + --> $DIR/splat-non-fn-arg.rs:40:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on foreign functions - --> $DIR/splat-non-fn-arg.rs:46:5 +error: the `splat` attribute cannot be used on foreign functions + --> $DIR/splat-non-fn-arg.rs:46:7 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on modules - --> $DIR/splat-non-fn-arg.rs:50:1 +error: the `splat` attribute cannot be used on modules + --> $DIR/splat-non-fn-arg.rs:50:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on use statements - --> $DIR/splat-non-fn-arg.rs:53:1 +error: the `splat` attribute cannot be used on use statements + --> $DIR/splat-non-fn-arg.rs:53:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params -error: `#[splat]` attribute cannot be used on structs - --> $DIR/splat-non-fn-arg.rs:56:1 +error: the `splat` attribute cannot be used on structs + --> $DIR/splat-non-fn-arg.rs:56:3 | LL | #[splat] - | ^^^^^^^^ + | ^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: the `splat` attribute can only be applied to function params error: aborting due to 11 previous errors diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index abe3ab431635f..79259fae936fd 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -1,26 +1,26 @@ -error: `#[target_feature]` attribute cannot be used on extern crates - --> $DIR/invalid-attribute.rs:12:1 +error: the `target_feature` attribute cannot be used on extern crates + --> $DIR/invalid-attribute.rs:12:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on use statements - --> $DIR/invalid-attribute.rs:16:1 +error: the `target_feature` attribute cannot be used on use statements + --> $DIR/invalid-attribute.rs:16:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on foreign modules - --> $DIR/invalid-attribute.rs:20:1 +error: the `target_feature` attribute cannot be used on foreign modules + --> $DIR/invalid-attribute.rs:20:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions error[E0539]: malformed `target_feature` attribute input --> $DIR/invalid-attribute.rs:24:1 @@ -64,101 +64,101 @@ LL - #[target_feature(disable = "baz")] LL + #[target_feature(enable = "feat1, feat2")] | -error: `#[target_feature]` attribute cannot be used on modules - --> $DIR/invalid-attribute.rs:38:1 +error: the `target_feature` attribute cannot be used on modules + --> $DIR/invalid-attribute.rs:38:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on constants - --> $DIR/invalid-attribute.rs:42:1 +error: the `target_feature` attribute cannot be used on constants + --> $DIR/invalid-attribute.rs:42:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on structs - --> $DIR/invalid-attribute.rs:46:1 +error: the `target_feature` attribute cannot be used on structs + --> $DIR/invalid-attribute.rs:46:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on enums - --> $DIR/invalid-attribute.rs:50:1 +error: the `target_feature` attribute cannot be used on enums + --> $DIR/invalid-attribute.rs:50:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on unions - --> $DIR/invalid-attribute.rs:54:1 +error: the `target_feature` attribute cannot be used on unions + --> $DIR/invalid-attribute.rs:54:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on type aliases - --> $DIR/invalid-attribute.rs:61:1 +error: the `target_feature` attribute cannot be used on type aliases + --> $DIR/invalid-attribute.rs:61:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on traits - --> $DIR/invalid-attribute.rs:65:1 +error: the `target_feature` attribute cannot be used on traits + --> $DIR/invalid-attribute.rs:65:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on statics - --> $DIR/invalid-attribute.rs:75:1 +error: the `target_feature` attribute cannot be used on statics + --> $DIR/invalid-attribute.rs:75:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on trait impl blocks - --> $DIR/invalid-attribute.rs:79:1 +error: the `target_feature` attribute cannot be used on trait impl blocks + --> $DIR/invalid-attribute.rs:79:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on inherent impl blocks - --> $DIR/invalid-attribute.rs:85:1 +error: the `target_feature` attribute cannot be used on inherent impl blocks + --> $DIR/invalid-attribute.rs:85:3 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on expressions - --> $DIR/invalid-attribute.rs:106:5 +error: the `target_feature` attribute cannot be used on expressions + --> $DIR/invalid-attribute.rs:106:7 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can only be applied to functions + = help: the `target_feature` attribute can only be applied to functions -error: `#[target_feature]` attribute cannot be used on closures - --> $DIR/invalid-attribute.rs:112:5 +error: the `target_feature` attribute cannot be used on closures + --> $DIR/invalid-attribute.rs:112:7 | LL | #[target_feature(enable = "sse2")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ | - = help: `#[target_feature]` can be applied to functions and methods + = help: the `target_feature` attribute can be applied to functions and methods error: cannot use `#[inline(always)]` with `#[target_feature]` --> $DIR/invalid-attribute.rs:69:1 diff --git a/tests/ui/thread-local/no-unstable.rs b/tests/ui/thread-local/no-unstable.rs index 9d4c0d07aad7f..209f054c22fb7 100644 --- a/tests/ui/thread-local/no-unstable.rs +++ b/tests/ui/thread-local/no-unstable.rs @@ -1,6 +1,5 @@ thread_local! { //~^ ERROR: `#[used(linker)]` is currently unstable [E0658] - //~| ERROR: `#[used]` attribute cannot be used on constants #[rustc_dummy = 17] //~ ERROR: use of an internal attribute [E0658] pub static FOO: () = (); @@ -8,7 +7,7 @@ thread_local! { #[cfg_attr(true, rustc_dummy = 17)] //~ ERROR: use of an internal attribute [E0658] pub static BAR: () = (); - #[used(linker)] + #[used(linker)] //~ ERROR: the `used` attribute cannot be used on constants pub static BAZ: () = (); } diff --git a/tests/ui/thread-local/no-unstable.stderr b/tests/ui/thread-local/no-unstable.stderr index acecab47bdaf6..ae3bf995b3720 100644 --- a/tests/ui/thread-local/no-unstable.stderr +++ b/tests/ui/thread-local/no-unstable.stderr @@ -1,5 +1,5 @@ error[E0658]: use of an internal attribute - --> $DIR/no-unstable.rs:5:7 + --> $DIR/no-unstable.rs:4:7 | LL | #[rustc_dummy = 17] | ^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | #[rustc_dummy = 17] = note: the `rustc_dummy` attribute is used for rustc unit tests error[E0658]: use of an internal attribute - --> $DIR/no-unstable.rs:8:22 + --> $DIR/no-unstable.rs:7:22 | LL | #[cfg_attr(true, rustc_dummy = 17)] | ^^^^^^^^^^^ @@ -22,6 +22,9 @@ error[E0658]: `#[used(linker)]` is currently unstable --> $DIR/no-unstable.rs:1:1 | LL | / thread_local! { +LL | | +LL | | +LL | | #[rustc_dummy = 17] ... | LL | | pub static BAZ: () = (); LL | | } @@ -31,16 +34,13 @@ LL | | } = help: add `#![feature(used_with_arg)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `#[used]` attribute cannot be used on constants - --> $DIR/no-unstable.rs:1:1 +error: the `used` attribute cannot be used on constants + --> $DIR/no-unstable.rs:10:7 | -LL | / thread_local! { -... | -LL | | pub static BAZ: () = (); -LL | | } - | |_^ +LL | #[used(linker)] + | ^^^^ | - = help: `#[used]` can only be applied to statics + = help: the `used` attribute can only be applied to statics error: aborting due to 4 previous errors diff --git a/tests/ui/thread-local/non-static.rs b/tests/ui/thread-local/non-static.rs index f14ff20f449b6..884ec42b5accc 100644 --- a/tests/ui/thread-local/non-static.rs +++ b/tests/ui/thread-local/non-static.rs @@ -2,19 +2,19 @@ #![feature(thread_local)] #[thread_local] -//~^ ERROR `#[thread_local]` attribute cannot be used on constants +//~^ ERROR the `thread_local` attribute cannot be used on constants const A: u32 = 0; #[thread_local] -//~^ ERROR `#[thread_local]` attribute cannot be used on functions +//~^ ERROR the `thread_local` attribute cannot be used on functions fn main() { #[thread_local] || {}; - //~^ ERROR `#[thread_local]` attribute cannot be used on closures + //~^ ERROR the `thread_local` attribute cannot be used on closures } struct S { #[thread_local] - //~^ ERROR `#[thread_local]` attribute cannot be used on struct fields + //~^ ERROR the `thread_local` attribute cannot be used on struct fields a: String, b: String, } diff --git a/tests/ui/thread-local/non-static.stderr b/tests/ui/thread-local/non-static.stderr index c83a6beb4c6ad..f323d8270b3cc 100644 --- a/tests/ui/thread-local/non-static.stderr +++ b/tests/ui/thread-local/non-static.stderr @@ -1,34 +1,34 @@ -error: `#[thread_local]` attribute cannot be used on constants - --> $DIR/non-static.rs:4:1 +error: the `thread_local` attribute cannot be used on constants + --> $DIR/non-static.rs:4:3 | LL | #[thread_local] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[thread_local]` can be applied to foreign statics and statics + = help: the `thread_local` attribute can be applied to foreign statics and statics -error: `#[thread_local]` attribute cannot be used on functions - --> $DIR/non-static.rs:8:1 +error: the `thread_local` attribute cannot be used on functions + --> $DIR/non-static.rs:8:3 | LL | #[thread_local] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[thread_local]` can be applied to foreign statics and statics + = help: the `thread_local` attribute can be applied to foreign statics and statics -error: `#[thread_local]` attribute cannot be used on closures - --> $DIR/non-static.rs:11:5 +error: the `thread_local` attribute cannot be used on closures + --> $DIR/non-static.rs:11:7 | LL | #[thread_local] || {}; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[thread_local]` can be applied to foreign statics and statics + = help: the `thread_local` attribute can be applied to foreign statics and statics -error: `#[thread_local]` attribute cannot be used on struct fields - --> $DIR/non-static.rs:16:5 +error: the `thread_local` attribute cannot be used on struct fields + --> $DIR/non-static.rs:16:7 | LL | #[thread_local] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[thread_local]` can be applied to foreign statics and statics + = help: the `thread_local` attribute can be applied to foreign statics and statics error: aborting due to 4 previous errors diff --git a/tests/ui/traits/alias/not-a-marker.stderr b/tests/ui/traits/alias/not-a-marker.stderr index 8b0eba65b956b..232ecb3c7c7ca 100644 --- a/tests/ui/traits/alias/not-a-marker.stderr +++ b/tests/ui/traits/alias/not-a-marker.stderr @@ -1,10 +1,10 @@ -error: `#[marker]` attribute cannot be used on trait aliases - --> $DIR/not-a-marker.rs:3:1 +error: the `marker` attribute cannot be used on trait aliases + --> $DIR/not-a-marker.rs:3:3 | LL | #[marker] - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[marker]` can only be applied to traits + = help: the `marker` attribute can only be applied to traits error: aborting due to 1 previous error diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs index 82d0fa36d7ecb..0219864c04755 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs @@ -36,11 +36,11 @@ trait Tr5 { } #[rustc_must_implement_one_of(abc, xyz)] -//~^ ERROR `#[rustc_must_implement_one_of]` attribute cannot be used on functions +//~^ ERROR the `rustc_must_implement_one_of` attribute cannot be used on functions fn function() {} #[rustc_must_implement_one_of(abc, xyz)] -//~^ ERROR `#[rustc_must_implement_one_of]` attribute cannot be used on structs +//~^ ERROR the `rustc_must_implement_one_of` attribute cannot be used on structs struct Struct {} fn main() {} diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr index 1059db683efb3..c10108b04e325 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr @@ -23,21 +23,21 @@ help: must be of the form LL | #[rustc_must_implement_one_of(function1, function2, ...)] | +++++++++++++++++++++++++++ -error: `#[rustc_must_implement_one_of]` attribute cannot be used on functions - --> $DIR/rustc_must_implement_one_of_misuse.rs:38:1 +error: the `rustc_must_implement_one_of` attribute cannot be used on functions + --> $DIR/rustc_must_implement_one_of_misuse.rs:38:3 | LL | #[rustc_must_implement_one_of(abc, xyz)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_must_implement_one_of]` can only be applied to traits + = help: the `rustc_must_implement_one_of` attribute can only be applied to traits -error: `#[rustc_must_implement_one_of]` attribute cannot be used on structs - --> $DIR/rustc_must_implement_one_of_misuse.rs:42:1 +error: the `rustc_must_implement_one_of` attribute cannot be used on structs + --> $DIR/rustc_must_implement_one_of_misuse.rs:42:3 | LL | #[rustc_must_implement_one_of(abc, xyz)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[rustc_must_implement_one_of]` can only be applied to traits + = help: the `rustc_must_implement_one_of` attribute can only be applied to traits error: function not found in this trait --> $DIR/rustc_must_implement_one_of_misuse.rs:3:31 diff --git a/tests/ui/unstable-feature-bound/unstable_inherent_method.stderr b/tests/ui/unstable-feature-bound/unstable_inherent_method.stderr index 3438e84079dfb..63ca539708f08 100644 --- a/tests/ui/unstable-feature-bound/unstable_inherent_method.stderr +++ b/tests/ui/unstable-feature-bound/unstable_inherent_method.stderr @@ -1,18 +1,18 @@ -error: `#[unstable_feature_bound]` attribute cannot be used on required trait methods - --> $DIR/unstable_inherent_method.rs:11:5 +error: the `unstable_feature_bound` attribute cannot be used on required trait methods + --> $DIR/unstable_inherent_method.rs:11:7 | LL | #[unstable_feature_bound(foo)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[unstable_feature_bound]` can be applied to functions, trait impl blocks, and traits + = help: the `unstable_feature_bound` attribute can be applied to functions, trait impl blocks, and traits -error: `#[unstable_feature_bound]` attribute cannot be used on trait methods in impl blocks - --> $DIR/unstable_inherent_method.rs:18:5 +error: the `unstable_feature_bound` attribute cannot be used on trait methods in impl blocks + --> $DIR/unstable_inherent_method.rs:18:7 | LL | #[unstable_feature_bound(foo)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[unstable_feature_bound]` can be applied to functions, trait impl blocks, and traits + = help: the `unstable_feature_bound` attribute can be applied to functions, trait impl blocks, and traits error: aborting due to 2 previous errors diff --git a/tests/ui/where-clauses/unsupported_attribute.stderr b/tests/ui/where-clauses/unsupported_attribute.stderr index fbd0e012a81a4..94f9719365c6e 100644 --- a/tests/ui/where-clauses/unsupported_attribute.stderr +++ b/tests/ui/where-clauses/unsupported_attribute.stderr @@ -26,53 +26,53 @@ LL | #[doc = "doc"] 'a: 'static, | = help: only `#[cfg]` and `#[cfg_attr]` are supported -error: `#[ignore]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:15:5 +error: the `ignore` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:15:7 | LL | #[ignore] T: Trait, - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions -error: `#[ignore]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:16:5 +error: the `ignore` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:16:7 | LL | #[ignore] 'a: 'static, - | ^^^^^^^^^ + | ^^^^^^ | - = help: `#[ignore]` can only be applied to functions + = help: the `ignore` attribute can only be applied to functions -error: `#[should_panic]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:17:5 +error: the `should_panic` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:17:7 | LL | #[should_panic] T: Trait, - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions -error: `#[should_panic]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:18:5 +error: the `should_panic` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:18:7 | LL | #[should_panic] 'a: 'static, - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | - = help: `#[should_panic]` can only be applied to functions + = help: the `should_panic` attribute can only be applied to functions -error: `#[macro_use]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:19:5 +error: the `macro_use` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:19:7 | LL | #[macro_use] T: Trait, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules -error: `#[macro_use]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:20:5 +error: the `macro_use` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:20:7 | LL | #[macro_use] 'a: 'static, - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | - = help: `#[macro_use]` can be applied to extern crates and modules + = help: the `macro_use` attribute can be applied to extern crates and modules error: most attributes are not supported in `where` clauses --> $DIR/unsupported_attribute.rs:21:5 @@ -90,37 +90,37 @@ LL | #[allow(unused)] 'a: 'static, | = help: only `#[cfg]` and `#[cfg_attr]` are supported -error: `#[deprecated]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:23:5 +error: the `deprecated` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:23:7 | LL | #[deprecated] T: Trait, - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements -error: `#[deprecated]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:24:5 +error: the `deprecated` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:24:7 | LL | #[deprecated] 'a: 'static, - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | - = help: `#[deprecated]` can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements + = help: the `deprecated` attribute can be applied to associated consts, associated types, constants, crates, data types, enum variants, foreign statics, functions, inherent impl blocks, macro defs, modules, statics, struct fields, traits, type aliases, and use statements -error: `#[automatically_derived]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:25:5 +error: the `automatically_derived` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:25:7 | LL | #[automatically_derived] T: Trait, - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks -error: `#[automatically_derived]` attribute cannot be used on where predicates - --> $DIR/unsupported_attribute.rs:26:5 +error: the `automatically_derived` attribute cannot be used on where predicates + --> $DIR/unsupported_attribute.rs:26:7 | LL | #[automatically_derived] 'a: 'static, - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | - = help: `#[automatically_derived]` can only be applied to trait impl blocks + = help: the `automatically_derived` attribute can only be applied to trait impl blocks error: most attributes are not supported in `where` clauses --> $DIR/unsupported_attribute.rs:27:5 From d36d39f2027e73505714648c95d725b938410e8d Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 Jul 2026 17:50:53 +1000 Subject: [PATCH 31/33] Improve consistency of some `cfg_attr` attribute error messages Similar to the previous two commits. --- compiler/rustc_expand/src/config.rs | 5 +++-- compiler/rustc_expand/src/diagnostics.rs | 4 ++-- tests/ui/cfg/crate-attributes-using-cfg_attr.rs | 8 ++++---- .../cfg/crate-attributes-using-cfg_attr.stderr | 16 ++++++++-------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 030fa96a9fa68..2ebacf62a585e 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -337,6 +337,7 @@ impl<'a> StripUnconfigured<'a> { .to_attr_token_stream(), )); + let attr_item_path_span = attr_item.node.path.span; let attr_tokens = Some(LazyAttrTokenStream::new_direct(AttrTokenStream::new(trees))); let attr = ast::attr::mk_attr_from_item( &self.sess.psess.attr_id_generator, @@ -346,10 +347,10 @@ impl<'a> StripUnconfigured<'a> { attr_item_span, ); if attr.has_name(sym::crate_type) { - self.sess.dcx().emit_err(CrateTypeInCfgAttr { span: attr.span }); + self.sess.dcx().emit_err(CrateTypeInCfgAttr { span: attr_item_path_span }); } if attr.has_name(sym::crate_name) { - self.sess.dcx().emit_err(CrateNameInCfgAttr { span: attr.span }); + self.sess.dcx().emit_err(CrateNameInCfgAttr { span: attr_item_path_span }); } attr } diff --git a/compiler/rustc_expand/src/diagnostics.rs b/compiler/rustc_expand/src/diagnostics.rs index c715fe4eb0ecf..5d2066ef88773 100644 --- a/compiler/rustc_expand/src/diagnostics.rs +++ b/compiler/rustc_expand/src/diagnostics.rs @@ -450,14 +450,14 @@ pub(crate) struct GlobDelegationOutsideImpls { } #[derive(Diagnostic)] -#[diag("`crate_name` within a `#![cfg_attr]` attribute is forbidden")] +#[diag("the `crate_name` attribute is forbidden within a `cfg_attr` attribute")] pub(crate) struct CrateNameInCfgAttr { #[primary_span] pub span: Span, } #[derive(Diagnostic)] -#[diag("`crate_type` within a `#![cfg_attr]` attribute is forbidden")] +#[diag("the `crate_type` attribute is forbidden within a `cfg_attr` attribute")] pub(crate) struct CrateTypeInCfgAttr { #[primary_span] pub span: Span, diff --git a/tests/ui/cfg/crate-attributes-using-cfg_attr.rs b/tests/ui/cfg/crate-attributes-using-cfg_attr.rs index 6dbc59ccc4edc..85a9d1d54583e 100644 --- a/tests/ui/cfg/crate-attributes-using-cfg_attr.rs +++ b/tests/ui/cfg/crate-attributes-using-cfg_attr.rs @@ -3,10 +3,10 @@ //@ reference: cfg.cfg_attr.attr-restriction #![cfg_attr(foo, crate_type="bin")] -//~^ERROR `crate_type` within -//~|ERROR `crate_type` within +//~^ERROR `crate_type` attribute is forbidden within +//~|ERROR `crate_type` attribute is forbidden within #![cfg_attr(foo, crate_name="bar")] -//~^ERROR `crate_name` within -//~|ERROR `crate_name` within +//~^ERROR `crate_name` attribute is forbidden within +//~|ERROR `crate_name` attribute is forbidden within fn main() {} diff --git a/tests/ui/cfg/crate-attributes-using-cfg_attr.stderr b/tests/ui/cfg/crate-attributes-using-cfg_attr.stderr index cd0a662cce384..a0ecd5c7d01f8 100644 --- a/tests/ui/cfg/crate-attributes-using-cfg_attr.stderr +++ b/tests/ui/cfg/crate-attributes-using-cfg_attr.stderr @@ -1,28 +1,28 @@ -error: `crate_type` within a `#![cfg_attr]` attribute is forbidden +error: the `crate_type` attribute is forbidden within a `cfg_attr` attribute --> $DIR/crate-attributes-using-cfg_attr.rs:5:18 | LL | #![cfg_attr(foo, crate_type="bin")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ -error: `crate_name` within a `#![cfg_attr]` attribute is forbidden +error: the `crate_name` attribute is forbidden within a `cfg_attr` attribute --> $DIR/crate-attributes-using-cfg_attr.rs:8:18 | LL | #![cfg_attr(foo, crate_name="bar")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ -error: `crate_type` within a `#![cfg_attr]` attribute is forbidden +error: the `crate_type` attribute is forbidden within a `cfg_attr` attribute --> $DIR/crate-attributes-using-cfg_attr.rs:5:18 | LL | #![cfg_attr(foo, crate_type="bin")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: `crate_name` within a `#![cfg_attr]` attribute is forbidden +error: the `crate_name` attribute is forbidden within a `cfg_attr` attribute --> $DIR/crate-attributes-using-cfg_attr.rs:8:18 | LL | #![cfg_attr(foo, crate_name="bar")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` From c4621ddc665aefbc3c317a358fd40a4058b3623f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 Jul 2026 19:12:12 +1000 Subject: [PATCH 32/33] Improve consistency of "malformed `foo` attribute input" error messages Similar to the previous three commits. --- .../rustc_attr_parsing/src/attributes/cfg.rs | 3 +- compiler/rustc_attr_parsing/src/context.rs | 9 +- .../src/session_diagnostics.rs | 8 +- tests/rustdoc-ui/check-doc-alias-attr.stderr | 8 +- .../doc-auto-cfg-values-non-ident.stderr | 4 +- tests/rustdoc-ui/doc-cfg.stderr | 20 +- tests/rustdoc-ui/invalid-cfg.stderr | 32 +-- tests/rustdoc-ui/lints/doc_cfg_hide-2.stderr | 4 +- tests/ui/abi/debug.generic.stderr | 4 +- tests/ui/abi/debug.loongarch64.stderr | 4 +- tests/ui/abi/debug.riscv64.stderr | 4 +- .../attributes/arg-error-issue-121425.stderr | 16 +- tests/ui/attributes/args-checked.stderr | 72 +++--- ...attribute-on-wrong-item-inline-repr.stderr | 24 +- .../ui/attributes/crate-type-delimited.stderr | 4 +- tests/ui/attributes/crate-type-empty.stderr | 4 +- .../ui/attributes/crate-type-non-crate.stderr | 28 +-- tests/ui/attributes/expected-word.stderr | 4 +- .../attributes/inline/invalid-inline.stderr | 8 +- tests/ui/attributes/instruction-set.stderr | 8 +- tests/ui/attributes/instrument_fn.stderr | 12 +- .../invalid-debugger-visualizer-option.stderr | 4 +- tests/ui/attributes/invalid-macro-use.stderr | 20 +- tests/ui/attributes/invalid-reprs.stderr | 4 +- tests/ui/attributes/malformed-attrs.stderr | 210 +++++++++--------- tests/ui/attributes/malformed-fn-align.stderr | 12 +- tests/ui/attributes/malformed-must_use.stderr | 4 +- tests/ui/attributes/malformed-no-std.stderr | 24 +- tests/ui/attributes/malformed-reprs.stderr | 4 +- .../attributes/malformed-static-align.stderr | 4 +- .../malformed-unstable-removed.stderr | 16 +- .../repr-align-in-trait-issue-132391.stderr | 4 +- tests/ui/attributes/rustc_confusables.stderr | 8 +- .../rustc_skip_during_method_dispatch.stderr | 28 +-- .../attributes/unroll/invalid-unroll.stderr | 16 +- .../unsafe/proc-unsafe-attributes.stderr | 4 +- .../ui/attributes/used_with_multi_args.stderr | 4 +- tests/ui/cfg/cfg-path-error.stderr | 16 +- tests/ui/cfg/cfg-target-compact-errors.stderr | 24 +- tests/ui/cfg/path-kw-as-cfg-pred.stderr | 72 +++--- tests/ui/cfg/suggest-any-or-all.stderr | 8 +- ...ames-request-malformed-crate-name-1.stderr | 4 +- .../cfg-attr-invalid-predicate.stderr | 4 +- .../cfg-attr-parse.stderr | 4 +- .../cfg-attr-syntax-validation.stderr | 36 +-- .../cfg_attr-attr-syntax-validation.stderr | 32 +-- .../cfg_attr-invalid-predicate-inner.stderr | 8 +- ...stc_legacy_const_generics-arguments.stderr | 24 +- .../ui/coverage-attr/bad-attr-ice.feat.stderr | 4 +- .../coverage-attr/bad-attr-ice.nofeat.stderr | 4 +- tests/ui/coverage-attr/bad-syntax.stderr | 32 +-- tests/ui/coverage-attr/name-value.stderr | 48 ++-- tests/ui/coverage-attr/subword.stderr | 16 +- tests/ui/coverage-attr/word-only.stderr | 48 ++-- .../ui/deprecation/deprecation-sanity.stderr | 36 +-- tests/ui/deprecation/invalid-literal.stderr | 4 +- tests/ui/error-codes/E0458.stderr | 4 +- tests/ui/error-codes/E0539.stderr | 4 +- tests/ui/error-codes/E0540.stderr | 4 +- tests/ui/error-codes/E0565-1.stderr | 4 +- tests/ui/error-codes/E0565.stderr | 4 +- tests/ui/extern/issue-47725.stderr | 4 +- .../feature-gate-fn_align.stderr | 4 +- .../feature-gate-optimize_attribute.stderr | 4 +- .../ui/feature-gates/gated-bad-feature.stderr | 16 +- .../issue-43106-gating-of-macro_use.stderr | 4 +- tests/ui/force-inlining/invalid.stderr | 12 +- .../query_stability_incorrect.stderr | 4 +- tests/ui/link-native-libs/issue-43925.stderr | 4 +- tests/ui/link-native-libs/issue-43926.stderr | 4 +- .../link-attr-validation-early.stderr | 8 +- .../link-attr-validation-late.stderr | 76 +++---- .../modifiers-override-4.stderr | 7 +- tests/ui/linkage-attr/linkage3.stderr | 4 +- .../import-name-type-invalid-format.stderr | 4 +- .../windows/import-name-type-multiple.stderr | 4 +- .../import-name-type-unknown-value.stderr | 4 +- .../link-ordinal-invalid-format.stderr | 8 +- .../link-ordinal-missing-argument.stderr | 8 +- .../link-ordinal-too-many-arguments.stderr | 8 +- tests/ui/macros/macro-use-bad-args-1.stderr | 4 +- tests/ui/macros/macro-use-bad-args-2.stderr | 4 +- .../tokenstream-ice-issue-149954.stderr | 8 +- .../ui/malformed/malformed-regressions.stderr | 8 +- .../malformed/malformed-special-attrs.stderr | 8 +- .../marker-attribute-with-values.stderr | 12 +- tests/ui/parser/bad-lit-suffixes.stderr | 4 +- .../patchable-function-entry-attribute.stderr | 32 +-- tests/ui/proc-macro/attribute.stderr | 64 +++--- tests/ui/proc-macro/invalid-attributes.stderr | 24 +- .../recursion_limit/invalid_digit_type.stderr | 4 +- .../recursion/recursion_limit/no-value.stderr | 4 +- tests/ui/repr/invalid_repr_list_help.stderr | 20 +- tests/ui/repr/malformed-repr-hints.stderr | 40 ++-- tests/ui/repr/repr-align-assign.stderr | 8 +- tests/ui/repr/repr.stderr | 12 +- .../invalid-attribute.stderr | 4 +- .../error-odd-syntax.stderr | 4 +- tests/ui/rustdoc/check-doc-alias-attr.stderr | 8 +- .../ui/sanitize-attr/invalid-sanitize.stderr | 20 +- .../cfi/invalid-attr-encoding.stderr | 4 +- tests/ui/scalable-vectors/invalid.stderr | 74 +++--- tests/ui/span/E0539.stderr | 4 +- .../stability-attribute-sanity-2.stderr | 8 +- .../stability-attribute-sanity-4.stderr | 16 +- .../stability-attribute-sanity.stderr | 20 +- .../target-feature/invalid-attribute.stderr | 12 +- .../test-attrs/test-should-panic-attr.stderr | 16 +- tests/ui/tool-attributes/invalid-tool.stderr | 4 +- .../tool-attributes/nested-disallowed.stderr | 4 +- .../rustc_must_implement_one_of_misuse.stderr | 8 +- tests/ui/wasm/wasm-import-module.stderr | 12 +- .../windows-subsystem-invalid.stderr | 4 +- 113 files changed, 882 insertions(+), 873 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/cfg.rs b/compiler/rustc_attr_parsing/src/attributes/cfg.rs index c0b0e6f03acc9..4f753d62ad766 100644 --- a/compiler/rustc_attr_parsing/src/attributes/cfg.rs +++ b/compiler/rustc_attr_parsing/src/attributes/cfg.rs @@ -353,12 +353,13 @@ pub fn parse_cfg_attr( { (dspan.entire(), AttributeParseErrorReason::ExpectedAtLeastOneArgument) } else { - (cfg_attr.span, AttributeParseErrorReason::ExpectedList) + (cfg_attr.get_normal_item().span, AttributeParseErrorReason::ExpectedList) }; sess.dcx().emit_err(AttributeParseError { span, attr_span: cfg_attr.span, + inner_span: cfg_attr.get_normal_item().span, template: CFG_ATTR_TEMPLATE, path: AttrPath::from_ast(&cfg_attr.get_normal_item().path, identity), description: ParsedDescription::Attribute, diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 5f329eec290fc..8ca8dee86d562 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -916,7 +916,7 @@ pub(crate) struct AttributeDiagnosticContext<'a, 'f, 'sess> { impl<'a, 'f, 'sess: 'f> AttributeDiagnosticContext<'a, 'f, 'sess> { fn emit_parse_error( &mut self, - span: Span, + mut span: Span, reason: AttributeParseErrorReason<'_>, ) -> ErrorGuaranteed { let suggestions = if self.custom_suggestions.is_empty() { @@ -925,9 +925,16 @@ impl<'a, 'f, 'sess: 'f> AttributeDiagnosticContext<'a, 'f, 'sess> { AttributeParseErrorSuggestions::CreatedByParser(mem::take(&mut self.custom_suggestions)) }; + // If the span is the full attribute (including the `#[`/`]` delimiters) shrink it to + // exclude those delimiters, because that's what we want in error messages. + if span == self.attr_span { + span = self.inner_span; + } + self.emit_err(AttributeParseError { span, attr_span: self.attr_span, + inner_span: self.inner_span, template: *self.template, path: self.attr_path.clone(), description: self.parsed_description, diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index c6619c1e7196c..fb984912b1936 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -510,6 +510,7 @@ pub enum ParsedDescription { pub(crate) struct AttributeParseError<'a> { pub(crate) span: Span, pub(crate) attr_span: Span, + pub(crate) inner_span: Span, pub(crate) template: AttributeTemplate, pub(crate) path: AttrPath, pub(crate) description: ParsedDescription, @@ -653,7 +654,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> { let description = self.description(); let mut diag = Diag::new(dcx, level, format!("malformed `{name}` {description} input")); - diag.span(self.attr_span); + diag.span(self.inner_span); diag.code(E0539); match &self.reason { AttributeParseErrorReason::ExpectedStringLiteral { byte_string } => { @@ -728,8 +729,9 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> { diag.code(E0565); } AttributeParseErrorReason::ExpectedNameValue(None) => { - // If the span is the entire attribute, the suggestion we add below this match already contains enough information - if self.span != self.attr_span { + // If the span is the entire attribute inner, the suggestion we add below this + // match already contains enough information. + if self.span != self.inner_span { diag.span_label(self.span, "expected this to be of the form `... = \"...\"`"); } } diff --git a/tests/rustdoc-ui/check-doc-alias-attr.stderr b/tests/rustdoc-ui/check-doc-alias-attr.stderr index d9e785ee0f1fe..2d9145a28e8e8 100644 --- a/tests/rustdoc-ui/check-doc-alias-attr.stderr +++ b/tests/rustdoc-ui/check-doc-alias-attr.stderr @@ -5,10 +5,10 @@ LL | #[doc(alias)] | ^^^^^ error[E0539]: malformed `doc` attribute input - --> $DIR/check-doc-alias-attr.rs:8:1 + --> $DIR/check-doc-alias-attr.rs:8:3 | LL | #[doc(alias = 0)] - | ^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^-^ | | | expected a string literal here @@ -57,10 +57,10 @@ LL | #[doc(alias = "")] | ^^ error[E0539]: malformed `doc` attribute input - --> $DIR/check-doc-alias-attr.rs:19:1 + --> $DIR/check-doc-alias-attr.rs:19:3 | LL | #[doc(alias(0))] - | ^^^^^^^^^^^^-^^^ + | ^^^^^^^^^^-^^ | | | expected a string literal here diff --git a/tests/rustdoc-ui/doc-auto-cfg-values-non-ident.stderr b/tests/rustdoc-ui/doc-auto-cfg-values-non-ident.stderr index 8c08c5ed4226d..4b0cc435306c7 100644 --- a/tests/rustdoc-ui/doc-auto-cfg-values-non-ident.stderr +++ b/tests/rustdoc-ui/doc-auto-cfg-values-non-ident.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `doc` attribute input - --> $DIR/doc-auto-cfg-values-non-ident.rs:5:1 + --> $DIR/doc-auto-cfg-values-non-ident.rs:5:3 | LL | #[doc(auto_cfg(hide(a, values(::b))))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^^ | | | expected a valid identifier here diff --git a/tests/rustdoc-ui/doc-cfg.stderr b/tests/rustdoc-ui/doc-cfg.stderr index 35d14f913b725..20e09af691915 100644 --- a/tests/rustdoc-ui/doc-cfg.stderr +++ b/tests/rustdoc-ui/doc-cfg.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `doc` attribute input - --> $DIR/doc-cfg.rs:4:1 + --> $DIR/doc-cfg.rs:4:3 | LL | #[doc(cfg(), cfg(foo, bar))] - | ^^^^^^^^^--^^^^^^^^^^^^^^^^^ + | ^^^^^^^--^^^^^^^^^^^^^^^^ | | | expected an argument here | @@ -12,10 +12,10 @@ LL | #[doc(cfg(false), cfg(foo, bar))] | +++++ error[E0805]: malformed `doc` attribute input - --> $DIR/doc-cfg.rs:4:1 + --> $DIR/doc-cfg.rs:4:3 | LL | #[doc(cfg(), cfg(foo, bar))] - | ^^^^^^^^^^^^^^^^----------^^ + | ^^^^^^^^^^^^^^----------^ | | | expected a single argument here | @@ -31,10 +31,10 @@ LL + #[doc(cfg(), cfg(any(foo, bar)))] | error[E0805]: malformed `doc` attribute input - --> $DIR/doc-cfg.rs:7:1 + --> $DIR/doc-cfg.rs:7:3 | LL | #[doc(cfg())] - | ^^^^^^^^^--^^ + | ^^^^^^^--^ | | | expected an argument here | @@ -44,10 +44,10 @@ LL | #[doc(cfg(false))] | +++++ error[E0805]: malformed `doc` attribute input - --> $DIR/doc-cfg.rs:8:1 + --> $DIR/doc-cfg.rs:8:3 | LL | #[doc(cfg(foo, bar))] - | ^^^^^^^^^----------^^ + | ^^^^^^^----------^ | | | expected a single argument here | @@ -63,10 +63,10 @@ LL + #[doc(cfg(any(foo, bar)))] | error[E0565]: malformed `doc` attribute input - --> $DIR/doc-cfg.rs:9:1 + --> $DIR/doc-cfg.rs:9:3 | LL | #[doc(auto_cfg(hide(foo::bar)))] - | ^^^^^^^^^^^^^^^^^^^^--------^^^^ + | ^^^^^^^^^^^^^^^^^^--------^^^ | | | expected a valid identifier here diff --git a/tests/rustdoc-ui/invalid-cfg.stderr b/tests/rustdoc-ui/invalid-cfg.stderr index 60b4033713622..4e3b37bab047a 100644 --- a/tests/rustdoc-ui/invalid-cfg.stderr +++ b/tests/rustdoc-ui/invalid-cfg.stderr @@ -1,16 +1,16 @@ error[E0539]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:2:1 + --> $DIR/invalid-cfg.rs:2:3 | LL | #[doc(cfg = "x")] - | ^^^^^^^^^^-----^^ + | ^^^^^^^^-----^ | | | expected this to be a list error[E0805]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:3:1 + --> $DIR/invalid-cfg.rs:3:3 | LL | #[doc(cfg(x, y))] - | ^^^^^^^^^------^^ + | ^^^^^^^------^ | | | expected a single argument here | @@ -26,18 +26,18 @@ LL + #[doc(cfg(any(x, y)))] | error[E0539]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:7:1 + --> $DIR/invalid-cfg.rs:7:3 | LL | #[doc(cfg = "x")] - | ^^^^^^^^^^-----^^ + | ^^^^^^^^-----^ | | | expected this to be a list error[E0805]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:8:1 + --> $DIR/invalid-cfg.rs:8:3 | LL | #[doc(cfg(x, y))] - | ^^^^^^^^^------^^ + | ^^^^^^^------^ | | | expected a single argument here | @@ -53,18 +53,18 @@ LL + #[doc(cfg(any(x, y)))] | error[E0539]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:12:1 + --> $DIR/invalid-cfg.rs:12:3 | LL | #[doc(cfg = "x")] - | ^^^^^^^^^^-----^^ + | ^^^^^^^^-----^ | | | expected this to be a list error[E0805]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:13:1 + --> $DIR/invalid-cfg.rs:13:3 | LL | #[doc(cfg(x, y))] - | ^^^^^^^^^------^^ + | ^^^^^^^------^ | | | expected a single argument here | @@ -80,18 +80,18 @@ LL + #[doc(cfg(any(x, y)))] | error[E0539]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:18:1 + --> $DIR/invalid-cfg.rs:18:3 | LL | #[doc(cfg = "x")] - | ^^^^^^^^^^-----^^ + | ^^^^^^^^-----^ | | | expected this to be a list error[E0805]: malformed `doc` attribute input - --> $DIR/invalid-cfg.rs:19:1 + --> $DIR/invalid-cfg.rs:19:3 | LL | #[doc(cfg(x, y))] - | ^^^^^^^^^------^^ + | ^^^^^^^------^ | | | expected a single argument here | diff --git a/tests/rustdoc-ui/lints/doc_cfg_hide-2.stderr b/tests/rustdoc-ui/lints/doc_cfg_hide-2.stderr index 68503ebf132fa..2ced3e1371988 100644 --- a/tests/rustdoc-ui/lints/doc_cfg_hide-2.stderr +++ b/tests/rustdoc-ui/lints/doc_cfg_hide-2.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `doc` attribute input - --> $DIR/doc_cfg_hide-2.rs:4:1 + --> $DIR/doc_cfg_hide-2.rs:4:4 | LL | #![doc(auto_cfg(hide(not(windows))))] - | ^^^^^^^^^^^^^^^^^^^^^---^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^---^^^^^^^^^^^^ | | | expected a valid identifier here diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index 2ef0c1a9ab25a..52727aee9d5a7 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -15,10 +15,10 @@ LL | #[rustc_abi(debug)] = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input - --> $DIR/debug.rs:74:1 + --> $DIR/debug.rs:74:3 | LL | #[rustc_abi("assert_eq")] - | ^^^^^^^^^^^-------------^ + | ^^^^^^^^^------------- | | | valid arguments are `assert_eq` or `debug` | diff --git a/tests/ui/abi/debug.loongarch64.stderr b/tests/ui/abi/debug.loongarch64.stderr index a624df31742f6..1bf0cdbd23720 100644 --- a/tests/ui/abi/debug.loongarch64.stderr +++ b/tests/ui/abi/debug.loongarch64.stderr @@ -15,10 +15,10 @@ LL | #[rustc_abi(debug)] = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input - --> $DIR/debug.rs:74:1 + --> $DIR/debug.rs:74:3 | LL | #[rustc_abi("assert_eq")] - | ^^^^^^^^^^^-------------^ + | ^^^^^^^^^------------- | | | valid arguments are `assert_eq` or `debug` | diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index a624df31742f6..1bf0cdbd23720 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -15,10 +15,10 @@ LL | #[rustc_abi(debug)] = help: the `rustc_abi` attribute can be applied to functions and type aliases error[E0539]: malformed `rustc_abi` attribute input - --> $DIR/debug.rs:74:1 + --> $DIR/debug.rs:74:3 | LL | #[rustc_abi("assert_eq")] - | ^^^^^^^^^^^-------------^ + | ^^^^^^^^^------------- | | | valid arguments are `assert_eq` or `debug` | diff --git a/tests/ui/attributes/arg-error-issue-121425.stderr b/tests/ui/attributes/arg-error-issue-121425.stderr index 7816ce4a4f377..f7c33d5e159d6 100644 --- a/tests/ui/attributes/arg-error-issue-121425.stderr +++ b/tests/ui/attributes/arg-error-issue-121425.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `repr` attribute input - --> $DIR/arg-error-issue-121425.rs:4:1 + --> $DIR/arg-error-issue-121425.rs:4:3 | LL | #[repr(align(N))] - | ^^^^^^^^^^^^^-^^^ + | ^^^^^^^^^^^-^^ | | | expected an integer literal here | @@ -21,30 +21,30 @@ LL | #[repr(align("str"))] | ^^^^^ error[E0805]: malformed `repr` attribute input - --> $DIR/arg-error-issue-121425.rs:16:1 + --> $DIR/arg-error-issue-121425.rs:16:3 | LL | #[repr(align())] - | ^^^^^^^^^^^^--^^ + | ^^^^^^^^^^--^ | | | expected an argument here | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/arg-error-issue-121425.rs:21:1 + --> $DIR/arg-error-issue-121425.rs:21:3 | LL | #[repr(packed(P))] - | ^^^^^^^^^^^^^^-^^^ + | ^^^^^^^^^^^^-^^ | | | expected an integer literal here | = note: for more information, visit error[E0805]: malformed `repr` attribute input - --> $DIR/arg-error-issue-121425.rs:25:1 + --> $DIR/arg-error-issue-121425.rs:25:3 | LL | #[repr(packed())] - | ^^^^^^^^^^^^^--^^ + | ^^^^^^^^^^^--^ | | | expected an argument here | diff --git a/tests/ui/attributes/args-checked.stderr b/tests/ui/attributes/args-checked.stderr index 277dd672fef22..fd6b0f43f88d2 100644 --- a/tests/ui/attributes/args-checked.stderr +++ b/tests/ui/attributes/args-checked.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `test_runner` attribute input - --> $DIR/args-checked.rs:7:1 + --> $DIR/args-checked.rs:7:4 | LL | #![test_runner(x = 5)] - | ^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^-----^ | | | didn't expect a literal here | @@ -13,10 +13,10 @@ LL + #![test_runner(path)] | error[E0565]: malformed `test_runner` attribute input - --> $DIR/args-checked.rs:9:1 + --> $DIR/args-checked.rs:9:4 | LL | #![test_runner(x(x,y,z))] - | ^^^^^^^^^^^^^^^--------^^ + | ^^^^^^^^^^^^--------^ | | | didn't expect a literal here | @@ -27,10 +27,10 @@ LL + #![test_runner(path)] | error[E0539]: malformed `inline` attribute input - --> $DIR/args-checked.rs:12:1 + --> $DIR/args-checked.rs:12:3 | LL | #[inline(always = 5)] - | ^^^^^^^^^----------^^ + | ^^^^^^^----------^ | | | valid arguments are `always` or `never` | @@ -48,10 +48,10 @@ LL + #[inline] | error[E0539]: malformed `inline` attribute input - --> $DIR/args-checked.rs:14:1 + --> $DIR/args-checked.rs:14:3 | LL | #[inline(always(x, y, z))] - | ^^^^^^^^^---------------^^ + | ^^^^^^^---------------^ | | | valid arguments are `always` or `never` | @@ -69,10 +69,10 @@ LL + #[inline] | error[E0539]: malformed `instruction_set` attribute input - --> $DIR/args-checked.rs:16:1 + --> $DIR/args-checked.rs:16:3 | LL | #[instruction_set(arm::a32 = 5)] - | ^^^^^^^^^^^^^^^^^^------------^^ + | ^^^^^^^^^^^^^^^^------------^ | | | valid arguments are `arm::a32` or `arm::t32` | @@ -84,10 +84,10 @@ LL + #[instruction_set(set)] | error[E0539]: malformed `instruction_set` attribute input - --> $DIR/args-checked.rs:18:1 + --> $DIR/args-checked.rs:18:3 | LL | #[instruction_set(arm::a32(x, y, z))] - | ^^^^^^^^^^^^^^^^^^-----------------^^ + | ^^^^^^^^^^^^^^^^-----------------^ | | | valid arguments are `arm::a32` or `arm::t32` | @@ -99,10 +99,10 @@ LL + #[instruction_set(set)] | error[E0539]: malformed `optimize` attribute input - --> $DIR/args-checked.rs:20:1 + --> $DIR/args-checked.rs:20:3 | LL | #[optimize(size = 5)] - | ^^^^^^^^^^^--------^^ + | ^^^^^^^^^--------^ | | | valid arguments are `size`, `speed` or `none` | @@ -119,10 +119,10 @@ LL + #[optimize(speed)] | error[E0539]: malformed `optimize` attribute input - --> $DIR/args-checked.rs:22:1 + --> $DIR/args-checked.rs:22:3 | LL | #[optimize(size(x, y, z))] - | ^^^^^^^^^^^-------------^^ + | ^^^^^^^^^-------------^ | | | valid arguments are `size`, `speed` or `none` | @@ -151,10 +151,10 @@ LL | #[optimize(size = 5)] | ^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `coverage` attribute input - --> $DIR/args-checked.rs:25:1 + --> $DIR/args-checked.rs:25:3 | LL | #[coverage(off = 5)] - | ^^^^^^^^^^^-------^^ + | ^^^^^^^^^-------^ | | | valid arguments are `on` or `off` | @@ -168,10 +168,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/args-checked.rs:27:1 + --> $DIR/args-checked.rs:27:3 | LL | #[coverage(off(x, y, z))] - | ^^^^^^^^^^^------------^^ + | ^^^^^^^^^------------^ | | | valid arguments are `on` or `off` | @@ -185,10 +185,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `rustc_abi` attribute input - --> $DIR/args-checked.rs:29:1 + --> $DIR/args-checked.rs:29:3 | LL | #[rustc_abi(debug = 5)] - | ^^^^^^^^^^^-----------^ + | ^^^^^^^^^----------- | | | valid arguments are `assert_eq` or `debug` | @@ -202,10 +202,10 @@ LL + #[rustc_abi(debug)] | error[E0539]: malformed `rustc_abi` attribute input - --> $DIR/args-checked.rs:31:1 + --> $DIR/args-checked.rs:31:3 | LL | #[rustc_abi(debug(x, y, z))] - | ^^^^^^^^^^^----------------^ + | ^^^^^^^^^---------------- | | | valid arguments are `assert_eq` or `debug` | @@ -231,10 +231,10 @@ LL | #[rustc_allow_const_fn_unstable(x(x, y, z))] | ^^^^^^^^^^ error[E0539]: malformed `used` attribute input - --> $DIR/args-checked.rs:53:1 + --> $DIR/args-checked.rs:53:3 | LL | #[used(always = 5)] - | ^^^^^^^----------^^ + | ^^^^^----------^ | | | valid arguments are `compiler` or `linker` | @@ -251,10 +251,10 @@ LL + #[used] | error[E0539]: malformed `used` attribute input - --> $DIR/args-checked.rs:55:1 + --> $DIR/args-checked.rs:55:3 | LL | #[used(always(x, y, z))] - | ^^^^^^^---------------^^ + | ^^^^^---------------^ | | | valid arguments are `compiler` or `linker` | @@ -271,10 +271,10 @@ LL + #[used] | error[E0565]: malformed `rustc_must_implement_one_of` attribute input - --> $DIR/args-checked.rs:59:1 + --> $DIR/args-checked.rs:59:3 | LL | #[rustc_must_implement_one_of(eq = 5, neq)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^^^^^ | | | expected a valid identifier here | @@ -285,10 +285,10 @@ LL + #[rustc_must_implement_one_of(function1, function2, ...)] | error[E0565]: malformed `rustc_must_implement_one_of` attribute input - --> $DIR/args-checked.rs:61:1 + --> $DIR/args-checked.rs:61:3 | LL | #[rustc_must_implement_one_of(eq(x, y, z), neq)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^ | | | expected a valid identifier here | @@ -299,18 +299,18 @@ LL + #[rustc_must_implement_one_of(function1, function2, ...)] | error[E0565]: malformed `rustc_dump_layout` attribute input - --> $DIR/args-checked.rs:67:1 + --> $DIR/args-checked.rs:67:3 | LL | #[rustc_dump_layout(debug = 5)] - | ^^^^^^^^^^^^^^^^^^^^---------^^ + | ^^^^^^^^^^^^^^^^^^---------^ | | | didn't expect a literal here error[E0565]: malformed `rustc_dump_layout` attribute input - --> $DIR/args-checked.rs:69:1 + --> $DIR/args-checked.rs:69:3 | LL | #[rustc_dump_layout(debug(x, y, z))] - | ^^^^^^^^^^^^^^^^^^^^--------------^^ + | ^^^^^^^^^^^^^^^^^^--------------^ | | | didn't expect a literal here diff --git a/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr b/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr index d66f36a8bde39..9200d1978312f 100644 --- a/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr +++ b/tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr @@ -7,10 +7,10 @@ LL | #[inline] = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `inline` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:12:5 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:12:7 | LL | #[inline(XYZ)] - | ^^^^^^^^^---^^ + | ^^^^^^^---^ | | | valid arguments are `always` or `never` | @@ -36,38 +36,38 @@ LL | #[inline(XYZ)] = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `repr` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:17:5 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:17:7 | LL | #[repr(nothing)] - | ^^^^^^^-------^^ + | ^^^^^-------^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:21:5 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:21:7 | LL | #[repr(something_not_real)] - | ^^^^^^^------------------^^ + | ^^^^^------------------^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:27:5 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:27:7 | LL | #[repr] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0539]: malformed `inline` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:33:5 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:33:7 | LL | #[inline(ABC)] - | ^^^^^^^^^---^^ + | ^^^^^^^---^ | | | valid arguments are `always` or `never` | @@ -93,10 +93,10 @@ LL | #[inline(ABC)] = help: the `inline` attribute can only be applied to functions error[E0539]: malformed `repr` attribute input - --> $DIR/attribute-on-wrong-item-inline-repr.rs:38:14 + --> $DIR/attribute-on-wrong-item-inline-repr.rs:38:16 | LL | let _z = #[repr] 1; - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit diff --git a/tests/ui/attributes/crate-type-delimited.stderr b/tests/ui/attributes/crate-type-delimited.stderr index a94cf7fa60a5f..fc0d70df88cb9 100644 --- a/tests/ui/attributes/crate-type-delimited.stderr +++ b/tests/ui/attributes/crate-type-delimited.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-delimited.rs:2:1 + --> $DIR/crate-type-delimited.rs:2:4 | LL | #![crate_type(lib)] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form diff --git a/tests/ui/attributes/crate-type-empty.stderr b/tests/ui/attributes/crate-type-empty.stderr index 8833235d78d7f..608a787331403 100644 --- a/tests/ui/attributes/crate-type-empty.stderr +++ b/tests/ui/attributes/crate-type-empty.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-empty.rs:2:1 + --> $DIR/crate-type-empty.rs:2:4 | LL | #![crate_type] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: for more information, visit help: must be of the form diff --git a/tests/ui/attributes/crate-type-non-crate.stderr b/tests/ui/attributes/crate-type-non-crate.stderr index 8edfebdd918df..2453eef2b0145 100644 --- a/tests/ui/attributes/crate-type-non-crate.stderr +++ b/tests/ui/attributes/crate-type-non-crate.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:5:1 + --> $DIR/crate-type-non-crate.rs:5:3 | LL | #[crate_type] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -11,10 +11,10 @@ LL | #[crate_type = "crate type"] | ++++++++++++++ error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:7:1 + --> $DIR/crate-type-non-crate.rs:7:3 | LL | #[crate_type(lib)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -24,10 +24,10 @@ LL + #[crate_type = "crate type"] | error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:8:1 + --> $DIR/crate-type-non-crate.rs:8:3 | LL | #[crate_type("lib")] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -48,10 +48,10 @@ LL | #[crate_type = "lib"] | + + error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:12:1 + --> $DIR/crate-type-non-crate.rs:12:3 | LL | #[crate_type(foo)] - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -61,10 +61,10 @@ LL + #[crate_type = "crate type"] | error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:13:1 + --> $DIR/crate-type-non-crate.rs:13:3 | LL | #[crate_type("foo")] - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -85,10 +85,10 @@ LL | #[crate_type = "foo"] | + + error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:17:1 + --> $DIR/crate-type-non-crate.rs:17:3 | LL | #[crate_type(1)] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -98,10 +98,10 @@ LL + #[crate_type = "crate type"] | error[E0539]: malformed `crate_type` attribute input - --> $DIR/crate-type-non-crate.rs:18:1 + --> $DIR/crate-type-non-crate.rs:18:3 | LL | #[crate_type = 1] - | ^^^^^^^^^^^^^^^-^ + | ^^^^^^^^^^^^^- | | | expected a string literal here | diff --git a/tests/ui/attributes/expected-word.stderr b/tests/ui/attributes/expected-word.stderr index ce7b581ef4eb0..bcc7283c80470 100644 --- a/tests/ui/attributes/expected-word.stderr +++ b/tests/ui/attributes/expected-word.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `cold` attribute input - --> $DIR/expected-word.rs:1:1 + --> $DIR/expected-word.rs:1:3 | LL | #[cold = true] - | ^^^^^^^------^ + | ^^^^^------ | | | didn't expect any arguments here | diff --git a/tests/ui/attributes/inline/invalid-inline.stderr b/tests/ui/attributes/inline/invalid-inline.stderr index 6a784de39cccd..5dc55b2f1752a 100644 --- a/tests/ui/attributes/inline/invalid-inline.stderr +++ b/tests/ui/attributes/inline/invalid-inline.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `inline` attribute input - --> $DIR/invalid-inline.rs:3:1 + --> $DIR/invalid-inline.rs:3:3 | LL | #[inline(please,no)] - | ^^^^^^^^-----------^ + | ^^^^^^----------- | | | expected a single argument here | @@ -20,10 +20,10 @@ LL + #[inline] | error[E0805]: malformed `inline` attribute input - --> $DIR/invalid-inline.rs:7:1 + --> $DIR/invalid-inline.rs:7:3 | LL | #[inline()] - | ^^^^^^^^--^ + | ^^^^^^-- | | | expected an argument here | diff --git a/tests/ui/attributes/instruction-set.stderr b/tests/ui/attributes/instruction-set.stderr index a0e9a56eac2c4..09dd73d6c078c 100644 --- a/tests/ui/attributes/instruction-set.stderr +++ b/tests/ui/attributes/instruction-set.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `instruction_set` attribute input - --> $DIR/instruction-set.rs:21:1 + --> $DIR/instruction-set.rs:21:3 | LL | #[instruction_set(arm)] - | ^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^---^ | | | valid arguments are `arm::a32` or `arm::t32` | @@ -20,10 +20,10 @@ LL | #[instruction_set(arm::)] | ^^ expected identifier error[E0539]: malformed `instruction_set` attribute input - --> $DIR/instruction-set.rs:31:1 + --> $DIR/instruction-set.rs:31:3 | LL | #[instruction_set(arm::magic)] - | ^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^^^^-----^ | | | valid arguments are `a32` or `t32` | diff --git a/tests/ui/attributes/instrument_fn.stderr b/tests/ui/attributes/instrument_fn.stderr index bf33a205554e4..c6d0887fcd9fa 100644 --- a/tests/ui/attributes/instrument_fn.stderr +++ b/tests/ui/attributes/instrument_fn.stderr @@ -75,10 +75,10 @@ LL | #[instrument_fn = "off"] = help: the `instrument_fn` attribute can only be applied to functions with a body error[E0805]: malformed `instrument_fn` attribute input - --> $DIR/instrument_fn.rs:37:1 + --> $DIR/instrument_fn.rs:37:3 | LL | #[instrument_fn(entry = "on")] - | ^^^^^^^^^^^^^^^--------------^ + | ^^^^^^^^^^^^^-------------- | | | expected a single argument here | @@ -89,10 +89,10 @@ LL + #[instrument_fn = "on|off"] | error[E0539]: malformed `instrument_fn` attribute input - --> $DIR/instrument_fn.rs:40:1 + --> $DIR/instrument_fn.rs:40:3 | LL | #[instrument_fn] - | ^^^^^^^^^^^^^^^^ valid arguments are "on" or "off" + | ^^^^^^^^^^^^^ valid arguments are "on" or "off" | help: must be of the form | @@ -100,10 +100,10 @@ LL | #[instrument_fn = "on|off"] | ++++++++++ error[E0539]: malformed `instrument_fn` attribute input - --> $DIR/instrument_fn.rs:43:1 + --> $DIR/instrument_fn.rs:43:3 | LL | #[instrument_fn = 1] - | ^^^^^^^^^^^^^^^^^^-^ + | ^^^^^^^^^^^^^^^^- | | | valid arguments are "on" or "off" | diff --git a/tests/ui/attributes/invalid-debugger-visualizer-option.stderr b/tests/ui/attributes/invalid-debugger-visualizer-option.stderr index 11acd53f354d6..f1c0384b0d1f9 100644 --- a/tests/ui/attributes/invalid-debugger-visualizer-option.stderr +++ b/tests/ui/attributes/invalid-debugger-visualizer-option.stderr @@ -5,10 +5,10 @@ LL | #![debugger_visualizer(natvis_file = "../foo.random")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `debugger_visualizer` attribute input - --> $DIR/invalid-debugger-visualizer-option.rs:4:1 + --> $DIR/invalid-debugger-visualizer-option.rs:4:4 | LL | #![debugger_visualizer(random_file = "../foo.random")] - | ^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^^^^^^^ | | | valid arguments are `natvis_file` or `gdb_script_file` | diff --git a/tests/ui/attributes/invalid-macro-use.stderr b/tests/ui/attributes/invalid-macro-use.stderr index f02c77bf327e7..e5bcdbd683cf7 100644 --- a/tests/ui/attributes/invalid-macro-use.stderr +++ b/tests/ui/attributes/invalid-macro-use.stderr @@ -11,10 +11,10 @@ LL | #[macro_use(b)] | ^ error[E0539]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:4:1 + --> $DIR/invalid-macro-use.rs:4:3 | LL | #[macro_use = 5] - | ^^^^^^^^^^^^---^ + | ^^^^^^^^^^--- | | | expected a list or no arguments here | @@ -29,10 +29,10 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:10:1 + --> $DIR/invalid-macro-use.rs:10:3 | LL | #[macro_use(5)] - | ^^^^^^^^^^^^-^^ + | ^^^^^^^^^^-^ | | | expected a valid identifier here | @@ -47,10 +47,10 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:16:1 + --> $DIR/invalid-macro-use.rs:16:3 | LL | #[macro_use(a = "b")] - | ^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^-----^ | | | didn't expect any arguments here | @@ -65,10 +65,10 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:22:1 + --> $DIR/invalid-macro-use.rs:22:3 | LL | #[macro_use(a(b))] - | ^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^---^ | | | didn't expect any arguments here | @@ -83,10 +83,10 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:28:1 + --> $DIR/invalid-macro-use.rs:28:3 | LL | #[macro_use(a::b)] - | ^^^^^^^^^^^^----^^ + | ^^^^^^^^^^----^ | | | expected a valid identifier here | diff --git a/tests/ui/attributes/invalid-reprs.stderr b/tests/ui/attributes/invalid-reprs.stderr index 3cc52f552e1cc..b1d878f44d0f0 100644 --- a/tests/ui/attributes/invalid-reprs.stderr +++ b/tests/ui/attributes/invalid-reprs.stderr @@ -20,10 +20,10 @@ LL + use std::process::id; | error[E0539]: malformed `repr` attribute input - --> $DIR/invalid-reprs.rs:2:13 + --> $DIR/invalid-reprs.rs:2:15 | LL | let y = #[repr(uwu(4))] - | ^^^^^^^------^^ + | ^^^^^------^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index f6998a590f6c9..1b31d90ae0ec3 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg` attribute input - --> $DIR/malformed-attrs.rs:109:1 + --> $DIR/malformed-attrs.rs:109:3 | LL | #[cfg] - | ^^^^^^ expected this to be a list + | ^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -11,10 +11,10 @@ LL | #[cfg(predicate)] | +++++++++++ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/malformed-attrs.rs:111:1 + --> $DIR/malformed-attrs.rs:111:3 | LL | #[cfg_attr] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -127,12 +127,10 @@ LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `windows_subsystem` attribute input - --> $DIR/malformed-attrs.rs:26:1 + --> $DIR/malformed-attrs.rs:26:4 | LL | #![windows_subsystem] - | ^^^-----------------^ - | | - | expected this to be of the form `windows_subsystem = "..."` + | ^^^^^^^^^^^^^^^^^ expected this to be of the form `windows_subsystem = "..."` | = note: for more information, visit help: try changing it to one of the following valid forms of the attribute @@ -143,10 +141,10 @@ LL | #![windows_subsystem = "windows"] | +++++++++++ error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:29:1 + --> $DIR/malformed-attrs.rs:29:3 | LL | #[unsafe(export_name)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ | help: must be of the form | @@ -166,10 +164,10 @@ LL | #[allow_internal_unstable] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `rustc_confusables` attribute input - --> $DIR/malformed-attrs.rs:36:1 + --> $DIR/malformed-attrs.rs:36:3 | LL | #[rustc_confusables] - | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -185,18 +183,18 @@ LL | #[rustc_confusables] = help: the `rustc_confusables` attribute can only be applied to inherent methods error[E0539]: malformed `deprecated` attribute input - --> $DIR/malformed-attrs.rs:39:1 + --> $DIR/malformed-attrs.rs:39:3 | LL | #[deprecated = 5] - | ^^^^^^^^^^^^^^^-^ + | ^^^^^^^^^^^^^- | | | expected a string literal here error[E0539]: malformed `rustc_macro_transparency` attribute input - --> $DIR/malformed-attrs.rs:43:1 + --> $DIR/malformed-attrs.rs:43:3 | LL | #[rustc_macro_transparency] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ | help: try changing it to one of the following valid forms of the attribute | @@ -216,18 +214,18 @@ LL | #[rustc_macro_transparency] = help: the `rustc_macro_transparency` attribute can only be applied to macro defs error[E0539]: malformed `repr` attribute input - --> $DIR/malformed-attrs.rs:46:1 + --> $DIR/malformed-attrs.rs:46:3 | LL | #[repr] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0565]: malformed `rustc_as_ptr` attribute input - --> $DIR/malformed-attrs.rs:48:1 + --> $DIR/malformed-attrs.rs:48:3 | LL | #[rustc_as_ptr = 5] - | ^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^--- | | | didn't expect any arguments here | @@ -238,10 +236,10 @@ LL + #[rustc_as_ptr] | error[E0539]: malformed `rustc_align` attribute input - --> $DIR/malformed-attrs.rs:53:1 + --> $DIR/malformed-attrs.rs:53:3 | LL | #[rustc_align] - | ^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -249,10 +247,10 @@ LL | #[rustc_align()] | ++++++++++++++++++++++ error[E0539]: malformed `optimize` attribute input - --> $DIR/malformed-attrs.rs:55:1 + --> $DIR/malformed-attrs.rs:55:3 | LL | #[optimize] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -264,10 +262,10 @@ LL | #[optimize(speed)] | +++++++ error[E0805]: malformed `optimize` attribute input - --> $DIR/malformed-attrs.rs:57:1 + --> $DIR/malformed-attrs.rs:57:3 | LL | #[optimize(none, none)] - | ^^^^^^^^^^------------^ + | ^^^^^^^^------------ | | | expected a single argument here | @@ -284,10 +282,10 @@ LL + #[optimize(speed)] | error[E0805]: malformed `optimize` attribute input - --> $DIR/malformed-attrs.rs:59:1 + --> $DIR/malformed-attrs.rs:59:3 | LL | #[optimize(none, speed)] - | ^^^^^^^^^^-------------^ + | ^^^^^^^^------------- | | | expected a single argument here | @@ -304,10 +302,10 @@ LL + #[optimize(speed)] | error[E0565]: malformed `cold` attribute input - --> $DIR/malformed-attrs.rs:61:1 + --> $DIR/malformed-attrs.rs:61:3 | LL | #[cold = 1] - | ^^^^^^^---^ + | ^^^^^--- | | | didn't expect any arguments here | @@ -318,10 +316,10 @@ LL + #[cold] | error[E0539]: malformed `must_use` attribute input - --> $DIR/malformed-attrs.rs:63:1 + --> $DIR/malformed-attrs.rs:63:3 | LL | #[must_use()] - | ^^^^^^^^^^--^ + | ^^^^^^^^-- | | | didn't expect a list here | @@ -336,10 +334,10 @@ LL + #[must_use] | error[E0565]: malformed `no_mangle` attribute input - --> $DIR/malformed-attrs.rs:65:1 + --> $DIR/malformed-attrs.rs:65:3 | LL | #[no_mangle = 1] - | ^^^^^^^^^^^^---^ + | ^^^^^^^^^^--- | | | didn't expect any arguments here | @@ -350,10 +348,10 @@ LL + #[no_mangle] | error[E0565]: malformed `naked` attribute input - --> $DIR/malformed-attrs.rs:67:1 + --> $DIR/malformed-attrs.rs:67:3 | LL | #[unsafe(naked())] - | ^^^^^^^^^^^^^^--^^ + | ^^^^^^^^^^^^--^ | | | didn't expect any arguments here | @@ -364,10 +362,10 @@ LL + #[unsafe(naked)] | error[E0565]: malformed `track_caller` attribute input - --> $DIR/malformed-attrs.rs:69:1 + --> $DIR/malformed-attrs.rs:69:3 | LL | #[track_caller()] - | ^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^-- | | | didn't expect any arguments here | @@ -378,10 +376,10 @@ LL + #[track_caller] | error[E0539]: malformed `export_name` attribute input - --> $DIR/malformed-attrs.rs:71:1 + --> $DIR/malformed-attrs.rs:71:3 | LL | #[export_name()] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ | help: must be of the form | @@ -390,10 +388,10 @@ LL + #[export_name = "name"] | error[E0805]: malformed `used` attribute input - --> $DIR/malformed-attrs.rs:73:1 + --> $DIR/malformed-attrs.rs:73:3 | LL | #[used()] - | ^^^^^^--^ + | ^^^^-- | | | expected an argument here | @@ -416,10 +414,10 @@ LL | #[used()] = help: the `used` attribute can only be applied to statics error[E0539]: malformed `crate_name` attribute input - --> $DIR/malformed-attrs.rs:76:1 + --> $DIR/malformed-attrs.rs:76:3 | LL | #[crate_name] - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^ | help: must be of the form | @@ -427,10 +425,10 @@ LL | #[crate_name = "name"] | ++++++++ error[E0539]: malformed `target_feature` attribute input - --> $DIR/malformed-attrs.rs:81:1 + --> $DIR/malformed-attrs.rs:81:3 | LL | #[target_feature] - | ^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -438,10 +436,10 @@ LL | #[target_feature(enable = "feat1, feat2")] | +++++++++++++++++++++++++ error[E0565]: malformed `export_stable` attribute input - --> $DIR/malformed-attrs.rs:83:1 + --> $DIR/malformed-attrs.rs:83:3 | LL | #[export_stable = 1] - | ^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^--- | | | didn't expect any arguments here | @@ -452,18 +450,18 @@ LL + #[export_stable] | error[E0539]: malformed `link` attribute input - --> $DIR/malformed-attrs.rs:85:1 + --> $DIR/malformed-attrs.rs:85:3 | LL | #[link] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0539]: malformed `link_name` attribute input - --> $DIR/malformed-attrs.rs:89:1 + --> $DIR/malformed-attrs.rs:89:3 | LL | #[link_name] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -472,10 +470,10 @@ LL | #[link_name = "name"] | ++++++++ error[E0539]: malformed `link_section` attribute input - --> $DIR/malformed-attrs.rs:93:1 + --> $DIR/malformed-attrs.rs:93:3 | LL | #[link_section] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form @@ -484,10 +482,10 @@ LL | #[link_section = "name"] | ++++++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/malformed-attrs.rs:95:1 + --> $DIR/malformed-attrs.rs:95:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -497,16 +495,16 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `sanitize` attribute input - --> $DIR/malformed-attrs.rs:97:1 + --> $DIR/malformed-attrs.rs:97:3 | LL | #[sanitize] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list error[E0565]: malformed `no_implicit_prelude` attribute input - --> $DIR/malformed-attrs.rs:102:1 + --> $DIR/malformed-attrs.rs:102:3 | LL | #[no_implicit_prelude = 23] - | ^^^^^^^^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^^^^^^^^---- | | | didn't expect any arguments here | @@ -517,10 +515,10 @@ LL + #[no_implicit_prelude] | error[E0565]: malformed `proc_macro` attribute input - --> $DIR/malformed-attrs.rs:106:1 + --> $DIR/malformed-attrs.rs:106:3 | LL | #[proc_macro = 18] - | ^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^---- | | | didn't expect any arguments here | @@ -531,10 +529,10 @@ LL + #[proc_macro] | error[E0539]: malformed `instruction_set` attribute input - --> $DIR/malformed-attrs.rs:113:1 + --> $DIR/malformed-attrs.rs:113:3 | LL | #[instruction_set] - | ^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -543,10 +541,10 @@ LL | #[instruction_set(set)] | +++++ error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/malformed-attrs.rs:115:1 + --> $DIR/malformed-attrs.rs:115:3 | LL | #[patchable_function_entry] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -554,10 +552,10 @@ LL | #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0565]: malformed `coroutine` attribute input - --> $DIR/malformed-attrs.rs:118:5 + --> $DIR/malformed-attrs.rs:118:7 | LL | #[coroutine = 63] || {} - | ^^^^^^^^^^^^----^ + | ^^^^^^^^^^---- | | | didn't expect any arguments here | @@ -568,10 +566,10 @@ LL + #[coroutine] || {} | error[E0565]: malformed `proc_macro_attribute` attribute input - --> $DIR/malformed-attrs.rs:123:1 + --> $DIR/malformed-attrs.rs:123:3 | LL | #[proc_macro_attribute = 19] - | ^^^^^^^^^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^^^^^^^^^---- | | | didn't expect any arguments here | @@ -582,10 +580,10 @@ LL + #[proc_macro_attribute] | error[E0539]: malformed `must_use` attribute input - --> $DIR/malformed-attrs.rs:126:1 + --> $DIR/malformed-attrs.rs:126:3 | LL | #[must_use = 1] - | ^^^^^^^^^^^^^-^ + | ^^^^^^^^^^^- | | | expected a string literal here | @@ -600,10 +598,10 @@ LL + #[must_use] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/malformed-attrs.rs:130:1 + --> $DIR/malformed-attrs.rs:130:3 | LL | #[proc_macro_derive] - | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: try changing it to one of the following valid forms of the attribute @@ -614,10 +612,10 @@ LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | ++++++++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `must_not_suspend` attribute input - --> $DIR/malformed-attrs.rs:135:1 + --> $DIR/malformed-attrs.rs:135:3 | LL | #[must_not_suspend()] - | ^^^^^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^^^^^-- | | | didn't expect a list here | @@ -630,10 +628,10 @@ LL + #[must_not_suspend] | error[E0539]: malformed `cfi_encoding` attribute input - --> $DIR/malformed-attrs.rs:137:1 + --> $DIR/malformed-attrs.rs:137:3 | LL | #[cfi_encoding = ""] - | ^^^^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^^^^-- | | | string is not allowed to be empty | @@ -643,10 +641,10 @@ LL | #[cfi_encoding = "encoding"] | ++++++++ error[E0565]: malformed `marker` attribute input - --> $DIR/malformed-attrs.rs:156:1 + --> $DIR/malformed-attrs.rs:156:3 | LL | #[marker = 3] - | ^^^^^^^^^---^ + | ^^^^^^^--- | | | didn't expect any arguments here | @@ -657,10 +655,10 @@ LL + #[marker] | error[E0565]: malformed `fundamental` attribute input - --> $DIR/malformed-attrs.rs:158:1 + --> $DIR/malformed-attrs.rs:158:3 | LL | #[fundamental()] - | ^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^-- | | | didn't expect any arguments here | @@ -671,10 +669,10 @@ LL + #[fundamental] | error[E0565]: malformed `ffi_pure` attribute input - --> $DIR/malformed-attrs.rs:166:5 + --> $DIR/malformed-attrs.rs:166:7 | LL | #[unsafe(ffi_pure = 1)] - | ^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^---^ | | | didn't expect any arguments here | @@ -685,10 +683,10 @@ LL + #[unsafe(ffi_pure)] | error[E0539]: malformed `link_ordinal` attribute input - --> $DIR/malformed-attrs.rs:168:5 + --> $DIR/malformed-attrs.rs:168:7 | LL | #[link_ordinal] - | ^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -697,10 +695,10 @@ LL | #[link_ordinal(ordinal)] | +++++++++ error[E0565]: malformed `ffi_const` attribute input - --> $DIR/malformed-attrs.rs:172:5 + --> $DIR/malformed-attrs.rs:172:7 | LL | #[unsafe(ffi_const = 1)] - | ^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^---^ | | | didn't expect any arguments here | @@ -711,16 +709,16 @@ LL + #[unsafe(ffi_const)] | error[E0539]: malformed `linkage` attribute input - --> $DIR/malformed-attrs.rs:174:5 + --> $DIR/malformed-attrs.rs:174:7 | LL | #[linkage] - | ^^^^^^^^^^ expected this to be of the form `linkage = "..."` + | ^^^^^^^ expected this to be of the form `linkage = "..."` error[E0539]: malformed `debugger_visualizer` attribute input - --> $DIR/malformed-attrs.rs:189:1 + --> $DIR/malformed-attrs.rs:189:3 | LL | #[debugger_visualizer] - | ^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -729,10 +727,10 @@ LL | #[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")] | ++++++++++++++++++++++++++++++++++++++++++++++ error[E0565]: malformed `automatically_derived` attribute input - --> $DIR/malformed-attrs.rs:191:1 + --> $DIR/malformed-attrs.rs:191:3 | LL | #[automatically_derived = 18] - | ^^^^^^^^^^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^^^^^^^^^^---- | | | didn't expect any arguments here | @@ -743,10 +741,10 @@ LL + #[automatically_derived] | error[E0565]: malformed `non_exhaustive` attribute input - --> $DIR/malformed-attrs.rs:199:1 + --> $DIR/malformed-attrs.rs:199:3 | LL | #[non_exhaustive = 1] - | ^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^--- | | | didn't expect any arguments here | @@ -757,10 +755,10 @@ LL + #[non_exhaustive] | error[E0565]: malformed `thread_local` attribute input - --> $DIR/malformed-attrs.rs:205:1 + --> $DIR/malformed-attrs.rs:205:3 | LL | #[thread_local()] - | ^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^-- | | | didn't expect any arguments here | @@ -771,10 +769,10 @@ LL + #[thread_local] | error[E0565]: malformed `no_link` attribute input - --> $DIR/malformed-attrs.rs:209:1 + --> $DIR/malformed-attrs.rs:209:3 | LL | #[no_link()] - | ^^^^^^^^^--^ + | ^^^^^^^-- | | | didn't expect any arguments here | @@ -785,10 +783,10 @@ LL + #[no_link] | error[E0539]: malformed `macro_use` attribute input - --> $DIR/malformed-attrs.rs:211:1 + --> $DIR/malformed-attrs.rs:211:3 | LL | #[macro_use = 1] - | ^^^^^^^^^^^^---^ + | ^^^^^^^^^^--- | | | expected a list or no arguments here | @@ -803,10 +801,10 @@ LL + #[macro_use] | error[E0539]: malformed `macro_export` attribute input - --> $DIR/malformed-attrs.rs:216:1 + --> $DIR/malformed-attrs.rs:216:3 | LL | #[macro_export = 18] - | ^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^---- | | | expected a list or no arguments here | @@ -829,10 +827,10 @@ LL | #[allow_internal_unsafe = 1] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0565]: malformed `allow_internal_unsafe` attribute input - --> $DIR/malformed-attrs.rs:218:1 + --> $DIR/malformed-attrs.rs:218:3 | LL | #[allow_internal_unsafe = 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^^^^^--- | | | didn't expect any arguments here | diff --git a/tests/ui/attributes/malformed-fn-align.stderr b/tests/ui/attributes/malformed-fn-align.stderr index a6b3d1b196b68..48d6676f5a7e4 100644 --- a/tests/ui/attributes/malformed-fn-align.stderr +++ b/tests/ui/attributes/malformed-fn-align.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `rustc_align` attribute input - --> $DIR/malformed-fn-align.rs:10:5 + --> $DIR/malformed-fn-align.rs:10:7 | LL | #[rustc_align] - | ^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -10,10 +10,10 @@ LL | #[rustc_align()] | ++++++++++++++++++++++ error[E0805]: malformed `rustc_align` attribute input - --> $DIR/malformed-fn-align.rs:13:5 + --> $DIR/malformed-fn-align.rs:13:7 | LL | #[rustc_align(1, 2)] - | ^^^^^^^^^^^^^------^ + | ^^^^^^^^^^^------ | | | expected a single argument here | @@ -24,10 +24,10 @@ LL + #[rustc_align()] | error[E0539]: malformed `rustc_align` attribute input - --> $DIR/malformed-fn-align.rs:17:1 + --> $DIR/malformed-fn-align.rs:17:3 | LL | #[rustc_align = 16] - | ^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^---- | | | expected this to be a list | diff --git a/tests/ui/attributes/malformed-must_use.stderr b/tests/ui/attributes/malformed-must_use.stderr index d4797baa1b0b9..1669b01c6df0f 100644 --- a/tests/ui/attributes/malformed-must_use.stderr +++ b/tests/ui/attributes/malformed-must_use.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `must_use` attribute input - --> $DIR/malformed-must_use.rs:1:1 + --> $DIR/malformed-must_use.rs:1:3 | LL | #[must_use()] - | ^^^^^^^^^^--^ + | ^^^^^^^^-- | | | didn't expect a list here | diff --git a/tests/ui/attributes/malformed-no-std.stderr b/tests/ui/attributes/malformed-no-std.stderr index 1d74bbef81529..eec74b589f127 100644 --- a/tests/ui/attributes/malformed-no-std.stderr +++ b/tests/ui/attributes/malformed-no-std.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `no_std` attribute input - --> $DIR/malformed-no-std.rs:3:1 + --> $DIR/malformed-no-std.rs:3:4 | LL | #![no_std = "foo"] - | ^^^^^^^^^^-------^ + | ^^^^^^^------- | | | didn't expect any arguments here | @@ -13,10 +13,10 @@ LL + #![no_std] | error[E0565]: malformed `no_std` attribute input - --> $DIR/malformed-no-std.rs:5:1 + --> $DIR/malformed-no-std.rs:5:4 | LL | #![no_std("bar")] - | ^^^^^^^^^-------^ + | ^^^^^^------- | | | didn't expect any arguments here | @@ -27,10 +27,10 @@ LL + #![no_std] | error[E0565]: malformed `no_std` attribute input - --> $DIR/malformed-no-std.rs:8:1 + --> $DIR/malformed-no-std.rs:8:4 | LL | #![no_std(foo = "bar")] - | ^^^^^^^^^-------------^ + | ^^^^^^------------- | | | didn't expect any arguments here | @@ -41,10 +41,10 @@ LL + #![no_std] | error[E0565]: malformed `no_core` attribute input - --> $DIR/malformed-no-std.rs:11:1 + --> $DIR/malformed-no-std.rs:11:4 | LL | #![no_core = "foo"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^------- | | | didn't expect any arguments here | @@ -55,10 +55,10 @@ LL + #![no_core] | error[E0565]: malformed `no_core` attribute input - --> $DIR/malformed-no-std.rs:13:1 + --> $DIR/malformed-no-std.rs:13:4 | LL | #![no_core("bar")] - | ^^^^^^^^^^-------^ + | ^^^^^^^------- | | | didn't expect any arguments here | @@ -81,10 +81,10 @@ LL | #![no_core = "foo"] | ^^^^^^^^^^^^^^^^^^^ error[E0565]: malformed `no_core` attribute input - --> $DIR/malformed-no-std.rs:16:1 + --> $DIR/malformed-no-std.rs:16:4 | LL | #![no_core(foo = "bar")] - | ^^^^^^^^^^-------------^ + | ^^^^^^^------------- | | | didn't expect any arguments here | diff --git a/tests/ui/attributes/malformed-reprs.stderr b/tests/ui/attributes/malformed-reprs.stderr index 9250fb83f6d58..e92b6e845b1e0 100644 --- a/tests/ui/attributes/malformed-reprs.stderr +++ b/tests/ui/attributes/malformed-reprs.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `repr` attribute input - --> $DIR/malformed-reprs.rs:4:1 + --> $DIR/malformed-reprs.rs:4:4 | LL | #![repr] - | ^^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit diff --git a/tests/ui/attributes/malformed-static-align.stderr b/tests/ui/attributes/malformed-static-align.stderr index d42c743493ab6..6363cbcd31882 100644 --- a/tests/ui/attributes/malformed-static-align.stderr +++ b/tests/ui/attributes/malformed-static-align.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `rustc_align_static` attribute input - --> $DIR/malformed-static-align.rs:4:1 + --> $DIR/malformed-static-align.rs:4:3 | LL | #[rustc_align_static = 16] - | ^^^^^^^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^^^^^^^---- | | | expected this to be a list | diff --git a/tests/ui/attributes/malformed-unstable-removed.stderr b/tests/ui/attributes/malformed-unstable-removed.stderr index a92a19ef6e8c7..3631cab4054cf 100644 --- a/tests/ui/attributes/malformed-unstable-removed.stderr +++ b/tests/ui/attributes/malformed-unstable-removed.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `unstable_removed` attribute input - --> $DIR/malformed-unstable-removed.rs:3:1 + --> $DIR/malformed-unstable-removed.rs:3:4 | LL | #![unstable_removed(feature = "old_feature")] - | ^^^^^^^^^^^^^^^^^^^-------------------------^ + | ^^^^^^^^^^^^^^^^------------------------- | | | missing argument `reason = "..."` | @@ -13,10 +13,10 @@ LL + #![unstable_removed(feature = "name", reason = "...", link = "...", since = | error[E0539]: malformed `unstable_removed` attribute input - --> $DIR/malformed-unstable-removed.rs:6:1 + --> $DIR/malformed-unstable-removed.rs:6:4 | LL | #![unstable_removed(invalid = "old_feature")] - | ^^^^^^^^^^^^^^^^^^^^-----------------------^^ + | ^^^^^^^^^^^^^^^^^-----------------------^ | | | valid arguments are `feature`, `reason`, `link` or `since` | @@ -27,10 +27,10 @@ LL + #![unstable_removed(feature = "name", reason = "...", link = "...", since = | error[E0565]: malformed `unstable_removed` attribute input - --> $DIR/malformed-unstable-removed.rs:9:1 + --> $DIR/malformed-unstable-removed.rs:9:4 | LL | #![unstable_removed("invalid literal")] - | ^^^^^^^^^^^^^^^^^^^^-----------------^^ + | ^^^^^^^^^^^^^^^^^-----------------^ | | | didn't expect a literal here | @@ -41,10 +41,10 @@ LL + #![unstable_removed(feature = "name", reason = "...", link = "...", since = | error[E0539]: malformed `unstable_removed` attribute input - --> $DIR/malformed-unstable-removed.rs:12:1 + --> $DIR/malformed-unstable-removed.rs:12:4 | LL | #![unstable_removed = "invalid literal"] - | ^^^^^^^^^^^^^^^^^^^^-------------------^ + | ^^^^^^^^^^^^^^^^^------------------- | | | expected this to be a list | diff --git a/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr b/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr index a55268991d2ba..5f7e923b390b1 100644 --- a/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr +++ b/tests/ui/attributes/repr-align-in-trait-issue-132391.stderr @@ -7,10 +7,10 @@ LL | #[repr(align)] = help: the `repr(align(...))` attribute can only be applied to data types error[E0539]: malformed `repr` attribute input - --> $DIR/repr-align-in-trait-issue-132391.rs:2:5 + --> $DIR/repr-align-in-trait-issue-132391.rs:2:7 | LL | #[repr(align)] - | ^^^^^^^-----^^ + | ^^^^^-----^ | | | expected this to be a list | diff --git a/tests/ui/attributes/rustc_confusables.stderr b/tests/ui/attributes/rustc_confusables.stderr index d5c72dbb4d9d6..cbf59cd8c1cd1 100644 --- a/tests/ui/attributes/rustc_confusables.stderr +++ b/tests/ui/attributes/rustc_confusables.stderr @@ -5,10 +5,10 @@ LL | #[rustc_confusables()] | ^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `rustc_confusables` attribute input - --> $DIR/rustc_confusables.rs:34:5 + --> $DIR/rustc_confusables.rs:34:7 | LL | #[rustc_confusables] - | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -16,10 +16,10 @@ LL | #[rustc_confusables("name1", "name2", ...)] | +++++++++++++++++++++++ error[E0539]: malformed `rustc_confusables` attribute input - --> $DIR/rustc_confusables.rs:39:5 + --> $DIR/rustc_confusables.rs:39:7 | LL | #[rustc_confusables(invalid_meta_item)] - | ^^^^^^^^^^^^^^^^^^^^-----------------^^ + | ^^^^^^^^^^^^^^^^^^-----------------^ | | | expected a string literal here | diff --git a/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr b/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr index ae91af030a941..3f59d24865c81 100644 --- a/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr +++ b/tests/ui/attributes/rustc_skip_during_method_dispatch.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:3:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:3:3 | LL | #[rustc_skip_during_method_dispatch] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -10,10 +10,10 @@ LL | #[rustc_skip_during_method_dispatch(array, boxed_slice)] | ++++++++++++++++++++ error[E0539]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:7:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:7:3 | LL | #[rustc_skip_during_method_dispatch = "array"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------- | | | expected this to be a list | @@ -24,10 +24,10 @@ LL + #[rustc_skip_during_method_dispatch(array, boxed_slice)] | error[E0539]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:11:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:11:3 | LL | #[rustc_skip_during_method_dispatch()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- | | | expected at least 1 argument here | @@ -37,10 +37,10 @@ LL | #[rustc_skip_during_method_dispatch(array, boxed_slice)] | ++++++++++++++++++ error[E0538]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:15:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:15:3 | LL | #[rustc_skip_during_method_dispatch(array, boxed_slice, array)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^ | | | found `array` used as a key more than once | @@ -51,10 +51,10 @@ LL + #[rustc_skip_during_method_dispatch(array, boxed_slice)] | error[E0539]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:19:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:19:3 | LL | #[rustc_skip_during_method_dispatch(slice)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^ | | | valid arguments are `array` or `boxed_slice` | @@ -64,10 +64,10 @@ LL | #[rustc_skip_during_method_dispatch(array, boxed_slice)] | +++++++++++++ error[E0565]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:23:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:23:3 | LL | #[rustc_skip_during_method_dispatch(array = true)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^ | | | didn't expect any arguments here | @@ -78,10 +78,10 @@ LL + #[rustc_skip_during_method_dispatch(array, boxed_slice)] | error[E0565]: malformed `rustc_skip_during_method_dispatch` attribute input - --> $DIR/rustc_skip_during_method_dispatch.rs:27:1 + --> $DIR/rustc_skip_during_method_dispatch.rs:27:3 | LL | #[rustc_skip_during_method_dispatch("array")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^ | | | didn't expect a literal here | diff --git a/tests/ui/attributes/unroll/invalid-unroll.stderr b/tests/ui/attributes/unroll/invalid-unroll.stderr index 1980be101362d..9d25fa2c42d66 100644 --- a/tests/ui/attributes/unroll/invalid-unroll.stderr +++ b/tests/ui/attributes/unroll/invalid-unroll.stderr @@ -1,24 +1,24 @@ error[E0539]: malformed `unroll` attribute input - --> $DIR/invalid-unroll.rs:5:5 + --> $DIR/invalid-unroll.rs:5:7 | LL | #[unroll(please)] - | ^^^^^^^^^------^^ + | ^^^^^^^------^ | | | valid arguments are `full` or `never` error[E0539]: malformed `unroll` attribute input - --> $DIR/invalid-unroll.rs:8:5 + --> $DIR/invalid-unroll.rs:8:7 | LL | #[unroll("never")] - | ^^^^^^^^^-------^^ + | ^^^^^^^-------^ | | | valid arguments are `full` or `never` error[E0805]: malformed `unroll` attribute input - --> $DIR/invalid-unroll.rs:11:5 + --> $DIR/invalid-unroll.rs:11:7 | LL | #[unroll()] - | ^^^^^^^^--^ + | ^^^^^^-- | | | expected an argument here @@ -35,10 +35,10 @@ LL + #[unroll(1)] | error[E0539]: malformed `unroll` attribute input - --> $DIR/invalid-unroll.rs:17:5 + --> $DIR/invalid-unroll.rs:17:7 | LL | #[unroll(1.5)] - | ^^^^^^^^^---^^ + | ^^^^^^^---^ | | | valid arguments are `full` or `never` diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr index 4527cf676f78a..bf4d8ad34f35b 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr @@ -91,10 +91,10 @@ LL | #[proc_macro_derive(r#unsafe(Foo))] | ++ error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/proc-unsafe-attributes.rs:12:1 + --> $DIR/proc-unsafe-attributes.rs:12:3 | LL | #[proc_macro_derive(unsafe(Foo))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-----^ | | | didn't expect any arguments here | diff --git a/tests/ui/attributes/used_with_multi_args.stderr b/tests/ui/attributes/used_with_multi_args.stderr index 308f0519b8c83..f403dace4efe5 100644 --- a/tests/ui/attributes/used_with_multi_args.stderr +++ b/tests/ui/attributes/used_with_multi_args.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `used` attribute input - --> $DIR/used_with_multi_args.rs:3:1 + --> $DIR/used_with_multi_args.rs:3:3 | LL | #[used(compiler, linker)] - | ^^^^^^------------------^ + | ^^^^------------------ | | | expected a single argument here | diff --git a/tests/ui/cfg/cfg-path-error.stderr b/tests/ui/cfg/cfg-path-error.stderr index 8f5ff3f025892..1aaaa335d1ad9 100644 --- a/tests/ui/cfg/cfg-path-error.stderr +++ b/tests/ui/cfg/cfg-path-error.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-path-error.rs:6:1 + --> $DIR/cfg-path-error.rs:6:3 | LL | #[cfg(any(foo, foo::bar))] - | ^^^^^^^^^^^^^^^--------^^^ + | ^^^^^^^^^^^^^--------^^ | | | expected a valid identifier here | @@ -14,10 +14,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-path-error.rs:12:1 + --> $DIR/cfg-path-error.rs:12:3 | LL | #[cfg(any(foo::bar, foo))] - | ^^^^^^^^^^--------^^^^^^^^ + | ^^^^^^^^--------^^^^^^^ | | | expected a valid identifier here | @@ -29,10 +29,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-path-error.rs:18:1 + --> $DIR/cfg-path-error.rs:18:3 | LL | #[cfg(all(foo, foo::bar))] - | ^^^^^^^^^^^^^^^--------^^^ + | ^^^^^^^^^^^^^--------^^ | | | expected a valid identifier here | @@ -44,10 +44,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-path-error.rs:24:1 + --> $DIR/cfg-path-error.rs:24:3 | LL | #[cfg(all(foo::bar, foo))] - | ^^^^^^^^^^--------^^^^^^^^ + | ^^^^^^^^--------^^^^^^^ | | | expected a valid identifier here | diff --git a/tests/ui/cfg/cfg-target-compact-errors.stderr b/tests/ui/cfg/cfg-target-compact-errors.stderr index 7fb4fa4d49bf0..6f5783b750803 100644 --- a/tests/ui/cfg/cfg-target-compact-errors.stderr +++ b/tests/ui/cfg/cfg-target-compact-errors.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:5:1 + --> $DIR/cfg-target-compact-errors.rs:5:3 | LL | #[cfg(target(o::o))] - | ^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^----^^ | | | expected a valid identifier here | @@ -14,10 +14,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:5:1 + --> $DIR/cfg-target-compact-errors.rs:5:3 | LL | #[cfg(target(o::o))] - | ^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^----^^ | | | expected this to be of the form `... = "..."` | @@ -29,10 +29,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:14:1 + --> $DIR/cfg-target-compact-errors.rs:14:3 | LL | #[cfg(target(os = 8))] - | ^^^^^^^^^^^^^^^^^^-^^^ + | ^^^^^^^^^^^^^^^^-^^ | | | expected a string literal here | @@ -44,10 +44,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:20:1 + --> $DIR/cfg-target-compact-errors.rs:20:3 | LL | #[cfg(target(os = "linux", pointer(width = "64")))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^---------------------^^ | | | expected this to be of the form `... = "..."` | @@ -59,10 +59,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:26:1 + --> $DIR/cfg-target-compact-errors.rs:26:3 | LL | #[cfg(target(true))] - | ^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^----^^ | | | expected this to be of the form `... = "..."` | @@ -74,10 +74,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-target-compact-errors.rs:32:1 + --> $DIR/cfg-target-compact-errors.rs:32:3 | LL | #[cfg(target(clippy::os = "linux"))] - | ^^^^^^^^^^^^^----------^^^^^^^^^^^^^ + | ^^^^^^^^^^^----------^^^^^^^^^^^^ | | | expected a valid identifier here | diff --git a/tests/ui/cfg/path-kw-as-cfg-pred.stderr b/tests/ui/cfg/path-kw-as-cfg-pred.stderr index 0fd9d1b9b5fc5..02128acb281e4 100644 --- a/tests/ui/cfg/path-kw-as-cfg-pred.stderr +++ b/tests/ui/cfg/path-kw-as-cfg-pred.stderr @@ -119,10 +119,10 @@ LL | #[cfg_attr(r#_, cfg(r#_))] | ^^^ error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:20:1 + --> $DIR/path-kw-as-cfg-pred.rs:20:3 | LL | #[cfg(crate)] - | ^^^^^^-----^^ + | ^^^^-----^ | | | expected a valid identifier here | @@ -134,10 +134,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:22:1 + --> $DIR/path-kw-as-cfg-pred.rs:22:3 | LL | #[cfg(super)] - | ^^^^^^-----^^ + | ^^^^-----^ | | | expected a valid identifier here | @@ -149,10 +149,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:24:1 + --> $DIR/path-kw-as-cfg-pred.rs:24:3 | LL | #[cfg(self)] - | ^^^^^^----^^ + | ^^^^----^ | | | expected a valid identifier here | @@ -164,10 +164,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:26:1 + --> $DIR/path-kw-as-cfg-pred.rs:26:3 | LL | #[cfg(Self)] - | ^^^^^^----^^ + | ^^^^----^ | | | expected a valid identifier here | @@ -179,10 +179,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:28:1 + --> $DIR/path-kw-as-cfg-pred.rs:28:3 | LL | #[cfg_attr(crate, path = "foo")] - | ^^^^^^^^^^^-----^^^^^^^^^^^^^^^^ + | ^^^^^^^^^-----^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -194,10 +194,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:30:1 + --> $DIR/path-kw-as-cfg-pred.rs:30:3 | LL | #[cfg_attr(super, path = "foo")] - | ^^^^^^^^^^^-----^^^^^^^^^^^^^^^^ + | ^^^^^^^^^-----^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -209,10 +209,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:32:1 + --> $DIR/path-kw-as-cfg-pred.rs:32:3 | LL | #[cfg_attr(self, path = "foo")] - | ^^^^^^^^^^^----^^^^^^^^^^^^^^^^ + | ^^^^^^^^^----^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -224,10 +224,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:34:1 + --> $DIR/path-kw-as-cfg-pred.rs:34:3 | LL | #[cfg_attr(Self, path = "foo")] - | ^^^^^^^^^^^----^^^^^^^^^^^^^^^^ + | ^^^^^^^^^----^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -363,10 +363,10 @@ LL | #[cfg_attr(true, cfg(_))] | ^ expected identifier, found reserved identifier error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:90:1 + --> $DIR/path-kw-as-cfg-pred.rs:90:3 | LL | #[cfg(r#crate)] - | ^^^^^^-------^^ + | ^^^^-------^ | | | expected a valid identifier here | @@ -378,10 +378,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:93:1 + --> $DIR/path-kw-as-cfg-pred.rs:93:3 | LL | #[cfg(r#super)] - | ^^^^^^-------^^ + | ^^^^-------^ | | | expected a valid identifier here | @@ -393,10 +393,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:96:1 + --> $DIR/path-kw-as-cfg-pred.rs:96:3 | LL | #[cfg(r#self)] - | ^^^^^^------^^ + | ^^^^------^ | | | expected a valid identifier here | @@ -408,10 +408,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:99:1 + --> $DIR/path-kw-as-cfg-pred.rs:99:3 | LL | #[cfg(r#Self)] - | ^^^^^^------^^ + | ^^^^------^ | | | expected a valid identifier here | @@ -423,10 +423,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:102:1 + --> $DIR/path-kw-as-cfg-pred.rs:102:3 | LL | #[cfg_attr(r#crate, cfg(r#crate))] - | ^^^^^^^^^^^-------^^^^^^^^^^^^^^^^ + | ^^^^^^^^^-------^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -438,10 +438,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:106:1 + --> $DIR/path-kw-as-cfg-pred.rs:106:3 | LL | #[cfg_attr(r#super, cfg(r#super))] - | ^^^^^^^^^^^-------^^^^^^^^^^^^^^^^ + | ^^^^^^^^^-------^^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -453,10 +453,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:110:1 + --> $DIR/path-kw-as-cfg-pred.rs:110:3 | LL | #[cfg_attr(r#self, cfg(r#self))] - | ^^^^^^^^^^^------^^^^^^^^^^^^^^^ + | ^^^^^^^^^------^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -468,10 +468,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:114:1 + --> $DIR/path-kw-as-cfg-pred.rs:114:3 | LL | #[cfg_attr(r#Self, cfg(r#Self))] - | ^^^^^^^^^^^------^^^^^^^^^^^^^^^ + | ^^^^^^^^^------^^^^^^^^^^^^^^ | | | expected a valid identifier here | @@ -483,10 +483,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:9:9 + --> $DIR/path-kw-as-cfg-pred.rs:9:11 | LL | #[cfg($crate)] - | ^^^^^^------^^ + | ^^^^------^ | | | expected a valid identifier here ... @@ -502,10 +502,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/path-kw-as-cfg-pred.rs:11:9 + --> $DIR/path-kw-as-cfg-pred.rs:11:11 | LL | #[cfg_attr($crate, path = "foo")] - | ^^^^^^^^^^^------^^^^^^^^^^^^^^^^ + | ^^^^^^^^^------^^^^^^^^^^^^^^^ | | | expected a valid identifier here ... diff --git a/tests/ui/cfg/suggest-any-or-all.stderr b/tests/ui/cfg/suggest-any-or-all.stderr index 35dbe93cebebf..b157b4cfe20df 100644 --- a/tests/ui/cfg/suggest-any-or-all.stderr +++ b/tests/ui/cfg/suggest-any-or-all.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `cfg` attribute input - --> $DIR/suggest-any-or-all.rs:1:1 + --> $DIR/suggest-any-or-all.rs:1:3 | LL | #[cfg(foo, bar)] - | ^^^^^----------^ + | ^^^---------- | | | expected a single argument here | @@ -19,10 +19,10 @@ LL + #[cfg(any(foo, bar))] | error[E0805]: malformed `cfg` attribute input - --> $DIR/suggest-any-or-all.rs:5:1 + --> $DIR/suggest-any-or-all.rs:5:3 | LL | #[cfg()] - | ^^^^^--^ + | ^^^-- | | | expected an argument here | diff --git a/tests/ui/compile-flags/invalid/print-file-names-request-malformed-crate-name-1.stderr b/tests/ui/compile-flags/invalid/print-file-names-request-malformed-crate-name-1.stderr index eaf8d07262eb4..2a812e8531b99 100644 --- a/tests/ui/compile-flags/invalid/print-file-names-request-malformed-crate-name-1.stderr +++ b/tests/ui/compile-flags/invalid/print-file-names-request-malformed-crate-name-1.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `crate_name` attribute input - --> $DIR/print-file-names-request-malformed-crate-name-1.rs:4:1 + --> $DIR/print-file-names-request-malformed-crate-name-1.rs:4:4 | LL | #![crate_name] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^ | help: must be of the form | diff --git a/tests/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr b/tests/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr index 5e15ecd66bcd6..20178a88a52a4 100644 --- a/tests/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-invalid-predicate.rs:1:1 + --> $DIR/cfg-attr-invalid-predicate.rs:1:3 | LL | #[cfg(foo(bar))] - | ^^^^^^--------^^ + | ^^^^--------^ | | | valid arguments are `any`, `all`, `not` or `target` | diff --git a/tests/ui/conditional-compilation/cfg-attr-parse.stderr b/tests/ui/conditional-compilation/cfg-attr-parse.stderr index 71fce8a2f347b..22a961c5ea0d3 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parse.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-parse.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg-attr-parse.rs:4:1 + --> $DIR/cfg-attr-parse.rs:4:3 | LL | #[cfg_attr()] - | ^^^^^^^^^^--^ + | ^^^^^^^^-- | | | expected at least 1 argument here | diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr index 97792a9a151d7..b4ec634adeb35 100644 --- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:1:1 + --> $DIR/cfg-attr-syntax-validation.rs:1:3 | LL | #[cfg] - | ^^^^^^ expected this to be a list + | ^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -11,10 +11,10 @@ LL | #[cfg(predicate)] | +++++++++++ error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:7:1 + --> $DIR/cfg-attr-syntax-validation.rs:7:3 | LL | #[cfg = 10] - | ^^^^^^----^ + | ^^^^---- | | | expected this to be a list | @@ -26,10 +26,10 @@ LL + #[cfg(predicate)] | error[E0805]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:13:1 + --> $DIR/cfg-attr-syntax-validation.rs:13:3 | LL | #[cfg()] - | ^^^^^--^ + | ^^^-- | | | expected an argument here | @@ -40,10 +40,10 @@ LL | #[cfg(false)] | +++++ error[E0805]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:19:1 + --> $DIR/cfg-attr-syntax-validation.rs:19:3 | LL | #[cfg(a, b)] - | ^^^^^------^ + | ^^^------ | | | expected a single argument here | @@ -60,10 +60,10 @@ LL + #[cfg(any(a, b))] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:25:1 + --> $DIR/cfg-attr-syntax-validation.rs:25:3 | LL | #[cfg("str")] - | ^^^^^^-----^^ + | ^^^^-----^ | | | expected a valid identifier here | @@ -75,10 +75,10 @@ LL + #[cfg(predicate)] | error[E0565]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:31:1 + --> $DIR/cfg-attr-syntax-validation.rs:31:3 | LL | #[cfg(a::b)] - | ^^^^^^----^^ + | ^^^^----^ | | | expected a valid identifier here | @@ -90,10 +90,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:37:1 + --> $DIR/cfg-attr-syntax-validation.rs:37:3 | LL | #[cfg(a())] - | ^^^^^^---^^ + | ^^^^---^ | | | valid arguments are `any`, `all`, `not` or `target` | @@ -105,10 +105,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:42:1 + --> $DIR/cfg-attr-syntax-validation.rs:42:3 | LL | #[cfg(a = 10)] - | ^^^^^^^^^^--^^ + | ^^^^^^^^--^ | | | expected a string literal here | @@ -120,10 +120,10 @@ LL + #[cfg(predicate)] | error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:47:1 + --> $DIR/cfg-attr-syntax-validation.rs:47:3 | LL | #[cfg(a = b"hi")] - | ^^^^^^^^^^-^^^^^^ + | ^^^^^^^^-^^^^^ | | | help: consider removing the prefix | diff --git a/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr index 6e557120f8256..f21c791cdf7f4 100644 --- a/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr +++ b/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:1:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:1:3 | LL | #[cfg_attr] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -11,10 +11,10 @@ LL | #[cfg_attr(predicate, attr1, attr2, ...)] | ++++++++++++++++++++++++++++++ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:5:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:5:3 | LL | #[cfg_attr = 10] - | ^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -24,10 +24,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:9:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:9:3 | LL | #[cfg_attr()] - | ^^^^^^^^^^--^ + | ^^^^^^^^-- | | | expected at least 1 argument here | @@ -38,10 +38,10 @@ LL | #[cfg_attr(predicate, attr1, attr2, ...)] | ++++++++++++++++++++++++++++ error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:13:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:13:3 | LL | #[cfg_attr("str")] - | ^^^^^^^^^^^-----^^ + | ^^^^^^^^^-----^ | | | expected a valid identifier here | @@ -53,10 +53,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0565]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:16:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:16:3 | LL | #[cfg_attr(a::b)] - | ^^^^^^^^^^^----^^ + | ^^^^^^^^^----^ | | | expected a valid identifier here | @@ -68,10 +68,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:19:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:19:3 | LL | #[cfg_attr(a())] - | ^^^^^^^^^^^---^^ + | ^^^^^^^^^---^ | | | valid arguments are `any`, `all`, `not` or `target` | @@ -83,10 +83,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:22:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:22:3 | LL | #[cfg_attr(a = 10)] - | ^^^^^^^^^^^^^^^--^^ + | ^^^^^^^^^^^^^--^ | | | expected a string literal here | @@ -98,10 +98,10 @@ LL + #[cfg_attr(predicate, attr1, attr2, ...)] | error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-attr-syntax-validation.rs:25:1 + --> $DIR/cfg_attr-attr-syntax-validation.rs:25:3 | LL | #[cfg_attr(a = b"hi")] - | ^^^^^^^^^^^^^^^-^^^^^^ + | ^^^^^^^^^^^^^-^^^^^ | | | help: consider removing the prefix | diff --git a/tests/ui/conditional-compilation/cfg_attr-invalid-predicate-inner.stderr b/tests/ui/conditional-compilation/cfg_attr-invalid-predicate-inner.stderr index 3b97cd9607409..9c2abb586bedc 100644 --- a/tests/ui/conditional-compilation/cfg_attr-invalid-predicate-inner.stderr +++ b/tests/ui/conditional-compilation/cfg_attr-invalid-predicate-inner.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-invalid-predicate-inner.rs:3:1 + --> $DIR/cfg_attr-invalid-predicate-inner.rs:3:4 | LL | #![cfg_attr(a())] - | ^^^^^^^^^^^^---^^ + | ^^^^^^^^^---^ | | | valid arguments are `any`, `all`, `not` or `target` | @@ -14,10 +14,10 @@ LL + #![cfg_attr(predicate, attr1, attr2, ...)] | error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/cfg_attr-invalid-predicate-inner.rs:3:1 + --> $DIR/cfg_attr-invalid-predicate-inner.rs:3:4 | LL | #![cfg_attr(a())] - | ^^^^^^^^^^^^---^^ + | ^^^^^^^^^---^ | | | valid arguments are `any`, `all`, `not` or `target` | diff --git a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr index 69e3ccc7da3cc..4fe55374f0048 100644 --- a/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr +++ b/tests/ui/const-generics/invalid-rustc_legacy_const_generics-arguments.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:12:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:12:3 | LL | #[rustc_legacy_const_generics(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | expected an integer literal here | @@ -13,10 +13,10 @@ LL + #[rustc_legacy_const_generics(N)] | error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:15:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:15:3 | LL | #[rustc_legacy_const_generics(1, a, 2, b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^^^ | | | expected an integer literal here | @@ -27,10 +27,10 @@ LL + #[rustc_legacy_const_generics(N)] | error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:15:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:15:3 | LL | #[rustc_legacy_const_generics(1, a, 2, b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | expected an integer literal here | @@ -57,10 +57,10 @@ LL | #[rustc_legacy_const_generics(0usize)] = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:23:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:23:3 | LL | #[rustc_legacy_const_generics(0usize)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^ | | | expected an integer literal here | @@ -87,10 +87,10 @@ LL | #[rustc_legacy_const_generics(0)] = help: the `rustc_legacy_const_generics` attribute can only be applied to functions error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:41:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:41:3 | LL | #[rustc_legacy_const_generics] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -98,10 +98,10 @@ LL | #[rustc_legacy_const_generics(N)] | +++ error[E0539]: malformed `rustc_legacy_const_generics` attribute input - --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:44:1 + --> $DIR/invalid-rustc_legacy_const_generics-arguments.rs:44:3 | LL | #[rustc_legacy_const_generics = 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- | | | expected this to be a list | diff --git a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr index ee4011b9d773c..f3b5cbf22282f 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:1 + --> $DIR/bad-attr-ice.rs:11:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr index 8a99e0f4fc63c..4b0330fee8ca3 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr @@ -9,10 +9,10 @@ LL | #[coverage] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:1 + --> $DIR/bad-attr-ice.rs:11:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | diff --git a/tests/ui/coverage-attr/bad-syntax.stderr b/tests/ui/coverage-attr/bad-syntax.stderr index 522dd06e87b08..ee082951d101b 100644 --- a/tests/ui/coverage-attr/bad-syntax.stderr +++ b/tests/ui/coverage-attr/bad-syntax.stderr @@ -23,10 +23,10 @@ LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:17:1 + --> $DIR/bad-syntax.rs:17:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -36,10 +36,10 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:20:1 + --> $DIR/bad-syntax.rs:20:3 | LL | #[coverage = true] - | ^^^^^^^^^^^------^ + | ^^^^^^^^^------ | | | expected this to be a list | @@ -53,10 +53,10 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:23:1 + --> $DIR/bad-syntax.rs:23:3 | LL | #[coverage()] - | ^^^^^^^^^^--^ + | ^^^^^^^^-- | | | expected an argument here | @@ -68,10 +68,10 @@ LL | #[coverage(on)] | ++ error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:26:1 + --> $DIR/bad-syntax.rs:26:3 | LL | #[coverage(off, off)] - | ^^^^^^^^^^----------^ + | ^^^^^^^^---------- | | | expected a single argument here | @@ -85,10 +85,10 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:29:1 + --> $DIR/bad-syntax.rs:29:3 | LL | #[coverage(off, on)] - | ^^^^^^^^^^---------^ + | ^^^^^^^^--------- | | | expected a single argument here | @@ -102,10 +102,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:32:1 + --> $DIR/bad-syntax.rs:32:3 | LL | #[coverage(bogus)] - | ^^^^^^^^^^^-----^^ + | ^^^^^^^^^-----^ | | | valid arguments are `on` or `off` | @@ -119,10 +119,10 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:35:1 + --> $DIR/bad-syntax.rs:35:3 | LL | #[coverage(bogus, off)] - | ^^^^^^^^^^------------^ + | ^^^^^^^^------------ | | | expected a single argument here | @@ -136,10 +136,10 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:38:1 + --> $DIR/bad-syntax.rs:38:3 | LL | #[coverage(off, bogus)] - | ^^^^^^^^^^------------^ + | ^^^^^^^^------------ | | | expected a single argument here | diff --git a/tests/ui/coverage-attr/name-value.stderr b/tests/ui/coverage-attr/name-value.stderr index 02421774e9363..7eff78dd80d26 100644 --- a/tests/ui/coverage-attr/name-value.stderr +++ b/tests/ui/coverage-attr/name-value.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:12:1 + --> $DIR/name-value.rs:12:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -16,10 +16,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:17:5 + --> $DIR/name-value.rs:17:8 | LL | #![coverage = "off"] - | ^^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -33,10 +33,10 @@ LL + #![coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:21:1 + --> $DIR/name-value.rs:21:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -58,10 +58,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:26:1 + --> $DIR/name-value.rs:26:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -75,10 +75,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:29:5 + --> $DIR/name-value.rs:29:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -100,10 +100,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:35:1 + --> $DIR/name-value.rs:35:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -125,10 +125,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:39:5 + --> $DIR/name-value.rs:39:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -150,10 +150,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:44:5 + --> $DIR/name-value.rs:44:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -175,10 +175,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:50:1 + --> $DIR/name-value.rs:50:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -192,10 +192,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:53:5 + --> $DIR/name-value.rs:53:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -217,10 +217,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:58:5 + --> $DIR/name-value.rs:58:7 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | @@ -242,10 +242,10 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:64:1 + --> $DIR/name-value.rs:64:3 | LL | #[coverage = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list | diff --git a/tests/ui/coverage-attr/subword.stderr b/tests/ui/coverage-attr/subword.stderr index 32a09a10c8492..401c1cec958e4 100644 --- a/tests/ui/coverage-attr/subword.stderr +++ b/tests/ui/coverage-attr/subword.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:8:1 + --> $DIR/subword.rs:8:3 | LL | #[coverage(yes(milord))] - | ^^^^^^^^^^^-----------^^ + | ^^^^^^^^^-----------^ | | | valid arguments are `on` or `off` | @@ -16,10 +16,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:11:1 + --> $DIR/subword.rs:11:3 | LL | #[coverage(no(milord))] - | ^^^^^^^^^^^----------^^ + | ^^^^^^^^^----------^ | | | valid arguments are `on` or `off` | @@ -33,10 +33,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:14:1 + --> $DIR/subword.rs:14:3 | LL | #[coverage(yes = "milord")] - | ^^^^^^^^^^^--------------^^ + | ^^^^^^^^^--------------^ | | | valid arguments are `on` or `off` | @@ -50,10 +50,10 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:17:1 + --> $DIR/subword.rs:17:3 | LL | #[coverage(no = "milord")] - | ^^^^^^^^^^^-------------^^ + | ^^^^^^^^^-------------^ | | | valid arguments are `on` or `off` | diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index a7cdb1e7c7723..4946cefc51fc2 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:12:1 + --> $DIR/word-only.rs:12:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -12,10 +12,10 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:17:5 + --> $DIR/word-only.rs:17:8 | LL | #![coverage] - | ^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -25,10 +25,10 @@ LL | #![coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:21:1 + --> $DIR/word-only.rs:21:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -46,10 +46,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:26:1 + --> $DIR/word-only.rs:26:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -59,10 +59,10 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:29:5 + --> $DIR/word-only.rs:29:7 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -80,10 +80,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:35:1 + --> $DIR/word-only.rs:35:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -101,10 +101,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:39:5 + --> $DIR/word-only.rs:39:7 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -122,10 +122,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:44:5 + --> $DIR/word-only.rs:44:7 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -143,10 +143,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:50:1 + --> $DIR/word-only.rs:50:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -156,10 +156,10 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:53:5 + --> $DIR/word-only.rs:53:7 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -177,10 +177,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:58:5 + --> $DIR/word-only.rs:58:7 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | @@ -198,10 +198,10 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:64:1 + --> $DIR/word-only.rs:64:3 | LL | #[coverage] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: try changing it to one of the following valid forms of the attribute | diff --git a/tests/ui/deprecation/deprecation-sanity.stderr b/tests/ui/deprecation/deprecation-sanity.stderr index b11b3bae3e18d..c4b04438397e5 100644 --- a/tests/ui/deprecation/deprecation-sanity.stderr +++ b/tests/ui/deprecation/deprecation-sanity.stderr @@ -1,58 +1,58 @@ error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:6:5 + --> $DIR/deprecation-sanity.rs:6:7 | LL | #[deprecated(since = "a", note = "a", reason)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^ | | | valid arguments are `since` or `note` error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:9:5 + --> $DIR/deprecation-sanity.rs:9:7 | LL | #[deprecated(since = "a", note)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^----^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^----^ | | | expected this to be of the form `note = "..."` error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:12:5 + --> $DIR/deprecation-sanity.rs:12:7 | LL | #[deprecated(since, note = "a")] - | ^^^^^^^^^^^^^-----^^^^^^^^^^^^^^ + | ^^^^^^^^^^^-----^^^^^^^^^^^^^ | | | expected this to be of the form `since = "..."` error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:15:5 + --> $DIR/deprecation-sanity.rs:15:7 | LL | #[deprecated(since = "a", note(b))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-------^ | | | expected this to be of the form `note = "..."` error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:18:5 + --> $DIR/deprecation-sanity.rs:18:7 | LL | #[deprecated(since(b), note = "a")] - | ^^^^^^^^^^^^^--------^^^^^^^^^^^^^^ + | ^^^^^^^^^^^--------^^^^^^^^^^^^^ | | | expected this to be of the form `since = "..."` error[E0539]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:21:5 + --> $DIR/deprecation-sanity.rs:21:7 | LL | #[deprecated(note = b"test")] - | ^^^^^^^^^^^^^^^^^^^^-^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^-^^^^^^^ | | | help: consider removing the prefix | = note: expected a normal string literal, not a byte string literal error[E0565]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:24:5 + --> $DIR/deprecation-sanity.rs:24:7 | LL | #[deprecated("test")] - | ^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^------^ | | | didn't expect a literal here | @@ -63,10 +63,10 @@ LL + #[deprecated = "test"] | error[E0565]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:27:5 + --> $DIR/deprecation-sanity.rs:27:7 | LL | #[deprecated("1.2.3")] - | ^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^-------^ | | | didn't expect a literal here | @@ -88,10 +88,10 @@ LL | #[deprecated(since = "a", note = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0538]: malformed `deprecated` attribute input - --> $DIR/deprecation-sanity.rs:35:1 + --> $DIR/deprecation-sanity.rs:35:3 | LL | #[deprecated(since = "a", since = "b", note = "c")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^ | | | found `since` used as a key more than once diff --git a/tests/ui/deprecation/invalid-literal.stderr b/tests/ui/deprecation/invalid-literal.stderr index 6f25aebc315ee..666e0fbeefd89 100644 --- a/tests/ui/deprecation/invalid-literal.stderr +++ b/tests/ui/deprecation/invalid-literal.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `deprecated` attribute input - --> $DIR/invalid-literal.rs:1:1 + --> $DIR/invalid-literal.rs:1:3 | LL | #[deprecated = b"test"] - | ^^^^^^^^^^^^^^^-^^^^^^^ + | ^^^^^^^^^^^^^-^^^^^^ | | | help: consider removing the prefix | diff --git a/tests/ui/error-codes/E0458.stderr b/tests/ui/error-codes/E0458.stderr index e56c9473d287e..2886915b35aa4 100644 --- a/tests/ui/error-codes/E0458.stderr +++ b/tests/ui/error-codes/E0458.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `link` attribute input - --> $DIR/E0458.rs:1:1 + --> $DIR/E0458.rs:1:3 | LL | #[link(kind = "wonderful_unicorn")] extern "C" {} - | ^^^^^^^^^^^^^^-------------------^^ + | ^^^^^^^^^^^^-------------------^ | | | valid arguments are "static", "dylib", "framework", "raw-dylib" or "link-arg" | diff --git a/tests/ui/error-codes/E0539.stderr b/tests/ui/error-codes/E0539.stderr index 18ed1c23b40ab..47e24d6ce46bc 100644 --- a/tests/ui/error-codes/E0539.stderr +++ b/tests/ui/error-codes/E0539.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `deprecated` attribute input - --> $DIR/E0539.rs:2:1 + --> $DIR/E0539.rs:2:3 | LL | #[deprecated(since = b"1.29", note = "hi")] - | ^^^^^^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^ | | | help: consider removing the prefix | diff --git a/tests/ui/error-codes/E0540.stderr b/tests/ui/error-codes/E0540.stderr index 53f696807a68a..4ba75859a0816 100644 --- a/tests/ui/error-codes/E0540.stderr +++ b/tests/ui/error-codes/E0540.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `inline` attribute input - --> $DIR/E0540.rs:1:1 + --> $DIR/E0540.rs:1:3 | LL | #[inline()] - | ^^^^^^^^--^ + | ^^^^^^-- | | | expected an argument here | diff --git a/tests/ui/error-codes/E0565-1.stderr b/tests/ui/error-codes/E0565-1.stderr index 0c500d2cbf231..25131fa8b0659 100644 --- a/tests/ui/error-codes/E0565-1.stderr +++ b/tests/ui/error-codes/E0565-1.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `deprecated` attribute input - --> $DIR/E0565-1.rs:2:1 + --> $DIR/E0565-1.rs:2:3 | LL | #[deprecated("since")] - | ^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^-------^ | | | didn't expect a literal here | diff --git a/tests/ui/error-codes/E0565.stderr b/tests/ui/error-codes/E0565.stderr index 7d22501d74a36..5aa3ee2abe7c3 100644 --- a/tests/ui/error-codes/E0565.stderr +++ b/tests/ui/error-codes/E0565.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `repr` attribute input - --> $DIR/E0565.rs:2:1 + --> $DIR/E0565.rs:2:3 | LL | #[repr("C")] - | ^^^^^^^---^^ + | ^^^^^---^ | | | expected a valid identifier here | diff --git a/tests/ui/extern/issue-47725.stderr b/tests/ui/extern/issue-47725.stderr index 7447dcc1d9483..2dd8a2191d89b 100644 --- a/tests/ui/extern/issue-47725.stderr +++ b/tests/ui/extern/issue-47725.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `link_name` attribute input - --> $DIR/issue-47725.rs:20:1 + --> $DIR/issue-47725.rs:20:3 | LL | #[link_name] - | ^^^^^^^^^^^^ + | ^^^^^^^^^ | = note: for more information, visit help: must be of the form diff --git a/tests/ui/feature-gates/feature-gate-fn_align.stderr b/tests/ui/feature-gates/feature-gate-fn_align.stderr index bd3540a70039d..b371ef7d4426c 100644 --- a/tests/ui/feature-gates/feature-gate-fn_align.stderr +++ b/tests/ui/feature-gates/feature-gate-fn_align.stderr @@ -19,10 +19,10 @@ LL | #[rustc_align] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0539]: malformed `rustc_align` attribute input - --> $DIR/feature-gate-fn_align.rs:12:5 + --> $DIR/feature-gate-fn_align.rs:12:7 | LL | #[rustc_align] - | ^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^ expected this to be a list | help: must be of the form | diff --git a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr index 9187c0ae4b55a..67f0b832866ca 100644 --- a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr +++ b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr @@ -39,10 +39,10 @@ LL | #[optimize(banana)] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0539]: malformed `optimize` attribute input - --> $DIR/feature-gate-optimize_attribute.rs:12:1 + --> $DIR/feature-gate-optimize_attribute.rs:12:3 | LL | #[optimize(banana)] - | ^^^^^^^^^^^------^^ + | ^^^^^^^^^------^ | | | valid arguments are `size`, `speed` or `none` | diff --git a/tests/ui/feature-gates/gated-bad-feature.stderr b/tests/ui/feature-gates/gated-bad-feature.stderr index d5cce2267cec4..7a811f5694321 100644 --- a/tests/ui/feature-gates/gated-bad-feature.stderr +++ b/tests/ui/feature-gates/gated-bad-feature.stderr @@ -7,10 +7,10 @@ LL | #![feature(test_removed_feature)] = note: removed in 1.0.0 error[E0565]: malformed `feature` attribute input - --> $DIR/gated-bad-feature.rs:1:1 + --> $DIR/gated-bad-feature.rs:1:4 | LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ | | | didn't expect any arguments here | @@ -21,10 +21,10 @@ LL + #![feature(feature1, feature2, ...)] | error[E0565]: malformed `feature` attribute input - --> $DIR/gated-bad-feature.rs:1:1 + --> $DIR/gated-bad-feature.rs:1:4 | LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^ | | | didn't expect any arguments here | @@ -35,10 +35,10 @@ LL + #![feature(feature1, feature2, ...)] | error[E0539]: malformed `feature` attribute input - --> $DIR/gated-bad-feature.rs:6:1 + --> $DIR/gated-bad-feature.rs:6:4 | LL | #![feature] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^ expected this to be a list | help: must be of the form | @@ -46,10 +46,10 @@ LL | #![feature(feature1, feature2, ...)] | +++++++++++++++++++++++++ error[E0539]: malformed `feature` attribute input - --> $DIR/gated-bad-feature.rs:7:1 + --> $DIR/gated-bad-feature.rs:7:4 | LL | #![feature = "foo"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^------- | | | expected this to be a list | diff --git a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr index 0b92a279a9809..b7149ed18234b 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-macro_use.stderr @@ -17,10 +17,10 @@ LL | #![macro_use(my_macro)] | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `macro_use` attribute input - --> $DIR/issue-43106-gating-of-macro_use.rs:17:5 + --> $DIR/issue-43106-gating-of-macro_use.rs:17:7 | LL | #[macro_use = "2700"] struct S; - | ^^^^^^^^^^^^--------^ + | ^^^^^^^^^^-------- | | | expected a list or no arguments here | diff --git a/tests/ui/force-inlining/invalid.stderr b/tests/ui/force-inlining/invalid.stderr index d3e0e8dfa98e9..cabaabee8a4ec 100644 --- a/tests/ui/force-inlining/invalid.stderr +++ b/tests/ui/force-inlining/invalid.stderr @@ -5,10 +5,10 @@ LL | fn barqux(#[rustc_force_inline] _x: u32) {} | ^^^^^^^^^^^^^^^^^^^^^ error[E0805]: malformed `rustc_force_inline` attribute input - --> $DIR/invalid.rs:15:1 + --> $DIR/invalid.rs:15:3 | LL | #[rustc_force_inline(bar, baz)] - | ^^^^^^^^^^^^^^^^^^^^----------^ + | ^^^^^^^^^^^^^^^^^^---------- | | | expected a single argument here | @@ -25,10 +25,10 @@ LL + #[rustc_force_inline] | error[E0539]: malformed `rustc_force_inline` attribute input - --> $DIR/invalid.rs:20:1 + --> $DIR/invalid.rs:20:3 | LL | #[rustc_force_inline(2)] - | ^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^-^ | | | expected a string literal here | @@ -45,10 +45,10 @@ LL + #[rustc_force_inline] | error[E0539]: malformed `rustc_force_inline` attribute input - --> $DIR/invalid.rs:25:1 + --> $DIR/invalid.rs:25:3 | LL | #[rustc_force_inline = 2] - | ^^^^^^^^^^^^^^^^^^^^^^^-^ + | ^^^^^^^^^^^^^^^^^^^^^- | | | expected a string literal here | diff --git a/tests/ui/internal-lints/query_stability_incorrect.stderr b/tests/ui/internal-lints/query_stability_incorrect.stderr index 5dafcbfb2490a..4347e548b2deb 100644 --- a/tests/ui/internal-lints/query_stability_incorrect.stderr +++ b/tests/ui/internal-lints/query_stability_incorrect.stderr @@ -7,10 +7,10 @@ LL | #[rustc_lint_query_instability] = help: the `rustc_lint_query_instability` attribute can only be applied to functions error[E0565]: malformed `rustc_lint_query_instability` attribute input - --> $DIR/query_stability_incorrect.rs:10:5 + --> $DIR/query_stability_incorrect.rs:10:7 | LL | #[rustc_lint_query_instability(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- | | | didn't expect any arguments here | diff --git a/tests/ui/link-native-libs/issue-43925.stderr b/tests/ui/link-native-libs/issue-43925.stderr index 2605305bfd923..385510b30fc7a 100644 --- a/tests/ui/link-native-libs/issue-43925.stderr +++ b/tests/ui/link-native-libs/issue-43925.stderr @@ -8,10 +8,10 @@ LL | #[link(name = "foo", cfg("rlib"))] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0565]: malformed `link` attribute input - --> $DIR/issue-43925.rs:1:1 + --> $DIR/issue-43925.rs:1:3 | LL | #[link(name = "foo", cfg("rlib"))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^------^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^------^^ | | | expected a valid identifier here | diff --git a/tests/ui/link-native-libs/issue-43926.stderr b/tests/ui/link-native-libs/issue-43926.stderr index 161754f32003a..ceec5bb5a3568 100644 --- a/tests/ui/link-native-libs/issue-43926.stderr +++ b/tests/ui/link-native-libs/issue-43926.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `link` attribute input - --> $DIR/issue-43926.rs:1:1 + --> $DIR/issue-43926.rs:1:3 | LL | #[link(name = "foo", cfg())] - | ^^^^^^^^^^^^^^^^^^^^^^^^--^^ + | ^^^^^^^^^^^^^^^^^^^^^^--^ | | | expected an argument here | diff --git a/tests/ui/link-native-libs/link-attr-validation-early.stderr b/tests/ui/link-native-libs/link-attr-validation-early.stderr index 4bf88e150f45e..141e50a98fac4 100644 --- a/tests/ui/link-native-libs/link-attr-validation-early.stderr +++ b/tests/ui/link-native-libs/link-attr-validation-early.stderr @@ -1,16 +1,16 @@ error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-early.rs:2:1 + --> $DIR/link-attr-validation-early.rs:2:3 | LL | #[link] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-early.rs:3:1 + --> $DIR/link-attr-validation-early.rs:3:3 | LL | #[link = "foo"] - | ^^^^^^^-------^ + | ^^^^^------- | | | expected this to be a list | diff --git a/tests/ui/link-native-libs/link-attr-validation-late.stderr b/tests/ui/link-native-libs/link-attr-validation-late.stderr index 50bed93cef439..c3085cdacd122 100644 --- a/tests/ui/link-native-libs/link-attr-validation-late.stderr +++ b/tests/ui/link-native-libs/link-attr-validation-late.stderr @@ -1,178 +1,178 @@ error[E0565]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:4:1 + --> $DIR/link-attr-validation-late.rs:4:3 | LL | #[link(name = "...", "literal")] - | ^^^^^^^^^^^^^^^^^^^^^---------^^ + | ^^^^^^^^^^^^^^^^^^^---------^ | | | didn't expect a literal here | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:5:1 + --> $DIR/link-attr-validation-late.rs:5:3 | LL | #[link(name = "...", unknown)] - | ^^^^^^^^^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^^^^^^^^^-------^ | | | valid arguments are "name", "kind", "modifiers", "cfg", "wasm_import_module" or "import_name_type" | = note: for more information, visit error[E0538]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:9:1 + --> $DIR/link-attr-validation-late.rs:9:3 | LL | #[link(name = "foo", name = "bar")] - | ^^^^^^^^^^^^^^^^^^^^^------------^^ + | ^^^^^^^^^^^^^^^^^^^------------^ | | | found `name` used as a key more than once | = note: for more information, visit error[E0538]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:10:1 + --> $DIR/link-attr-validation-late.rs:10:3 | LL | #[link(name = "...", kind = "dylib", kind = "bar")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------^ | | | found `kind` used as a key more than once | = note: for more information, visit error[E0538]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:11:1 + --> $DIR/link-attr-validation-late.rs:11:3 | LL | #[link(name = "...", modifiers = "+verbatim", modifiers = "bar")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^ | | | found `modifiers` used as a key more than once | = note: for more information, visit error[E0538]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:12:1 + --> $DIR/link-attr-validation-late.rs:12:3 | LL | #[link(name = "...", cfg(false), cfg(false))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------^ | | | found `cfg` used as a key more than once | = note: for more information, visit error[E0538]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:13:1 + --> $DIR/link-attr-validation-late.rs:13:3 | LL | #[link(wasm_import_module = "foo", wasm_import_module = "bar")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------^ | | | found `wasm_import_module` used as a key more than once | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:17:1 + --> $DIR/link-attr-validation-late.rs:17:3 | LL | #[link(name)] - | ^^^^^^^----^^ + | ^^^^^----^ | | | expected this to be of the form `name = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:18:1 + --> $DIR/link-attr-validation-late.rs:18:3 | LL | #[link(name())] - | ^^^^^^^------^^ + | ^^^^^------^ | | | expected this to be of the form `name = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:19:1 + --> $DIR/link-attr-validation-late.rs:19:3 | LL | #[link(name = "...", kind)] - | ^^^^^^^^^^^^^^^^^^^^^----^^ + | ^^^^^^^^^^^^^^^^^^^----^ | | | expected this to be of the form `kind = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:20:1 + --> $DIR/link-attr-validation-late.rs:20:3 | LL | #[link(name = "...", kind())] - | ^^^^^^^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^^^^^^^------^ | | | expected this to be of the form `kind = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:21:1 + --> $DIR/link-attr-validation-late.rs:21:3 | LL | #[link(name = "...", modifiers)] - | ^^^^^^^^^^^^^^^^^^^^^---------^^ + | ^^^^^^^^^^^^^^^^^^^---------^ | | | expected this to be of the form `modifiers = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:22:1 + --> $DIR/link-attr-validation-late.rs:22:3 | LL | #[link(name = "...", modifiers())] - | ^^^^^^^^^^^^^^^^^^^^^-----------^^ + | ^^^^^^^^^^^^^^^^^^^-----------^ | | | expected this to be of the form `modifiers = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:23:1 + --> $DIR/link-attr-validation-late.rs:23:3 | LL | #[link(name = "...", cfg)] - | ^^^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^^^---^ | | | expected this to be a list | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:24:1 + --> $DIR/link-attr-validation-late.rs:24:3 | LL | #[link(name = "...", cfg = "literal")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^-----------^ | | | expected this to be a list | = note: for more information, visit error[E0565]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:25:1 + --> $DIR/link-attr-validation-late.rs:25:3 | LL | #[link(name = "...", cfg("literal"))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^---------^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^---------^^ | | | expected a valid identifier here | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:26:1 + --> $DIR/link-attr-validation-late.rs:26:3 | LL | #[link(name = "...", wasm_import_module)] - | ^^^^^^^^^^^^^^^^^^^^^------------------^^ + | ^^^^^^^^^^^^^^^^^^^------------------^ | | | expected this to be of the form `wasm_import_module = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:27:1 + --> $DIR/link-attr-validation-late.rs:27:3 | LL | #[link(name = "...", wasm_import_module())] - | ^^^^^^^^^^^^^^^^^^^^^--------------------^^ + | ^^^^^^^^^^^^^^^^^^^--------------------^ | | | expected this to be of the form `wasm_import_module = "..."` | @@ -191,10 +191,10 @@ LL | #[link(name = "...", modifiers = "no-plus-minus")] | ^^^^^^^^^^^^^^^ error[E0539]: malformed `link` attribute input - --> $DIR/link-attr-validation-late.rs:33:1 + --> $DIR/link-attr-validation-late.rs:33:3 | LL | #[link(name = "...", modifiers = "+unknown")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------^ | | | valid arguments are "bundle", "export-symbols", "verbatim", "whole-archive" or "as-needed" | diff --git a/tests/ui/link-native-libs/modifiers-override-4.stderr b/tests/ui/link-native-libs/modifiers-override-4.stderr index 12b0d89c79a7f..b9bf299bb507b 100644 --- a/tests/ui/link-native-libs/modifiers-override-4.stderr +++ b/tests/ui/link-native-libs/modifiers-override-4.stderr @@ -1,7 +1,8 @@ error[E0538]: malformed `link` attribute input - --> $DIR/modifiers-override-4.rs:2:1 + --> $DIR/modifiers-override-4.rs:2:3 | -LL | / #[link( +LL | #[link( + | ___^ LL | | LL | | name = "bar", LL | | kind = "static", @@ -9,7 +10,7 @@ LL | | kind = "static", LL | | modifiers = "+bundle" | | --------------------- found `modifiers` used as a key more than once LL | | )] - | |__^ + | |_^ | = note: for more information, visit diff --git a/tests/ui/linkage-attr/linkage3.stderr b/tests/ui/linkage-attr/linkage3.stderr index 564090e9538f0..aa25cd39ba291 100644 --- a/tests/ui/linkage-attr/linkage3.stderr +++ b/tests/ui/linkage-attr/linkage3.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `linkage` attribute input - --> $DIR/linkage3.rs:6:5 + --> $DIR/linkage3.rs:6:7 | LL | #[linkage = "foo"] - | ^^^^^^^^^^^^-----^ + | ^^^^^^^^^^----- | | | valid arguments are `available_externally`, `common`, `extern_weak`, `external`, `internal`, `linkonce`, `linkonce_odr`, `weak` or `weak_odr` diff --git a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-invalid-format.stderr b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-invalid-format.stderr index 01d081cc3041c..daf61b8379cad 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-invalid-format.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-invalid-format.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `link` attribute input - --> $DIR/import-name-type-invalid-format.rs:9:1 + --> $DIR/import-name-type-invalid-format.rs:9:3 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = 6)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | expected a string literal here | diff --git a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-multiple.stderr b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-multiple.stderr index ef909ad7278b7..0d87b730f4c80 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-multiple.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-multiple.stderr @@ -1,8 +1,8 @@ error[E0538]: malformed `link` attribute input - --> $DIR/import-name-type-multiple.rs:10:1 + --> $DIR/import-name-type-multiple.rs:10:3 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------^ | | | found `import_name_type` used as a key more than once | diff --git a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-unknown-value.stderr b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-unknown-value.stderr index 577ec8e7764c3..d3df6af095f93 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-unknown-value.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/import-name-type-unknown-value.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `link` attribute input - --> $DIR/import-name-type-unknown-value.rs:9:1 + --> $DIR/import-name-type-unknown-value.rs:9:3 | LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------^ | | | valid arguments are "decorated", "noprefix" or "undecorated" | diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr index 6b9afae354ef0..1a91ace0e3f23 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-invalid-format.rs:3:5 + --> $DIR/link-ordinal-invalid-format.rs:3:7 | LL | #[link_ordinal("JustMonika")] - | ^^^^^^^^^^^^^^^------------^^ + | ^^^^^^^^^^^^^------------^ | | | expected an integer literal here | @@ -14,10 +14,10 @@ LL + #[link_ordinal(ordinal)] | error[E0539]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-invalid-format.rs:6:5 + --> $DIR/link-ordinal-invalid-format.rs:6:7 | LL | #[link_ordinal("JustMonika")] - | ^^^^^^^^^^^^^^^------------^^ + | ^^^^^^^^^^^^^------------^ | | | expected an integer literal here | diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr index 8777fa28b7c65..65a9e8aefeac6 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-missing-argument.rs:3:5 + --> $DIR/link-ordinal-missing-argument.rs:3:7 | LL | #[link_ordinal()] - | ^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^-- | | | expected an argument here | @@ -13,10 +13,10 @@ LL | #[link_ordinal(ordinal)] | +++++++ error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-missing-argument.rs:8:5 + --> $DIR/link-ordinal-missing-argument.rs:8:7 | LL | #[link_ordinal()] - | ^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^-- | | | expected an argument here | diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr index 6337409b80841..152c30f8cf641 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr @@ -1,8 +1,8 @@ error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-too-many-arguments.rs:3:5 + --> $DIR/link-ordinal-too-many-arguments.rs:3:7 | LL | #[link_ordinal(3, 4)] - | ^^^^^^^^^^^^^^------^ + | ^^^^^^^^^^^^------ | | | expected a single argument here | @@ -14,10 +14,10 @@ LL + #[link_ordinal(ordinal)] | error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-too-many-arguments.rs:8:5 + --> $DIR/link-ordinal-too-many-arguments.rs:8:7 | LL | #[link_ordinal(3, 4)] - | ^^^^^^^^^^^^^^------^ + | ^^^^^^^^^^^^------ | | | expected a single argument here | diff --git a/tests/ui/macros/macro-use-bad-args-1.stderr b/tests/ui/macros/macro-use-bad-args-1.stderr index d1b6b39e4ec17..ab279c9c75bed 100644 --- a/tests/ui/macros/macro-use-bad-args-1.stderr +++ b/tests/ui/macros/macro-use-bad-args-1.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `macro_use` attribute input - --> $DIR/macro-use-bad-args-1.rs:4:1 + --> $DIR/macro-use-bad-args-1.rs:4:3 | LL | #[macro_use(foo(bar))] - | ^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^-----^ | | | didn't expect any arguments here | diff --git a/tests/ui/macros/macro-use-bad-args-2.stderr b/tests/ui/macros/macro-use-bad-args-2.stderr index f5b577a1ca934..822c4d26d157c 100644 --- a/tests/ui/macros/macro-use-bad-args-2.stderr +++ b/tests/ui/macros/macro-use-bad-args-2.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `macro_use` attribute input - --> $DIR/macro-use-bad-args-2.rs:4:1 + --> $DIR/macro-use-bad-args-2.rs:4:3 | LL | #[macro_use(foo="bar")] - | ^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^------^ | | | didn't expect any arguments here | diff --git a/tests/ui/macros/tokenstream-ice-issue-149954.stderr b/tests/ui/macros/tokenstream-ice-issue-149954.stderr index 8dda4e7dbec46..b1a589e76c323 100644 --- a/tests/ui/macros/tokenstream-ice-issue-149954.stderr +++ b/tests/ui/macros/tokenstream-ice-issue-149954.stderr @@ -38,10 +38,10 @@ LL | A: A<{ struct A> ; enum A }> | + error[E0539]: malformed `cfg` attribute input - --> $DIR/tokenstream-ice-issue-149954.rs:10:36 + --> $DIR/tokenstream-ice-issue-149954.rs:10:38 | LL | A: A<{ struct A> ; enum A } - | ^^^^^^ expected this to be a list + | ^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -50,10 +50,10 @@ LL | A: A<{ struct A> ; enum A } | +++++++++++ error[E0539]: malformed `cfg` attribute input - --> $DIR/tokenstream-ice-issue-149954.rs:10:36 + --> $DIR/tokenstream-ice-issue-149954.rs:10:38 | LL | A: A<{ struct A> ; enum A } - | ^^^^^^ expected this to be a list + | ^^^ expected this to be a list | = note: for more information, visit = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/malformed/malformed-regressions.stderr b/tests/ui/malformed/malformed-regressions.stderr index 9ce4638ab6d37..c98c6fc720478 100644 --- a/tests/ui/malformed/malformed-regressions.stderr +++ b/tests/ui/malformed/malformed-regressions.stderr @@ -1,16 +1,16 @@ error[E0539]: malformed `link` attribute input - --> $DIR/malformed-regressions.rs:8:1 + --> $DIR/malformed-regressions.rs:8:3 | LL | #[link] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/malformed-regressions.rs:11:1 + --> $DIR/malformed-regressions.rs:11:3 | LL | #[link = ""] - | ^^^^^^^----^ + | ^^^^^---- | | | expected this to be a list | diff --git a/tests/ui/malformed/malformed-special-attrs.stderr b/tests/ui/malformed/malformed-special-attrs.stderr index 9a16f2e73def7..65e7bf3d91f92 100644 --- a/tests/ui/malformed/malformed-special-attrs.stderr +++ b/tests/ui/malformed/malformed-special-attrs.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/malformed-special-attrs.rs:3:1 + --> $DIR/malformed-special-attrs.rs:3:3 | LL | #[cfg_attr] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form @@ -11,10 +11,10 @@ LL | #[cfg_attr(predicate, attr1, attr2, ...)] | ++++++++++++++++++++++++++++++ error[E0539]: malformed `cfg_attr` attribute input - --> $DIR/malformed-special-attrs.rs:6:1 + --> $DIR/malformed-special-attrs.rs:6:3 | LL | #[cfg_attr = ""] - | ^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: must be of the form diff --git a/tests/ui/marker_trait_attr/marker-attribute-with-values.stderr b/tests/ui/marker_trait_attr/marker-attribute-with-values.stderr index fa19adc84cab1..2af039845c2a7 100644 --- a/tests/ui/marker_trait_attr/marker-attribute-with-values.stderr +++ b/tests/ui/marker_trait_attr/marker-attribute-with-values.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `marker` attribute input - --> $DIR/marker-attribute-with-values.rs:3:1 + --> $DIR/marker-attribute-with-values.rs:3:3 | LL | #[marker(always)] - | ^^^^^^^^--------^ + | ^^^^^^-------- | | | didn't expect any arguments here | @@ -13,10 +13,10 @@ LL + #[marker] | error[E0565]: malformed `marker` attribute input - --> $DIR/marker-attribute-with-values.rs:6:1 + --> $DIR/marker-attribute-with-values.rs:6:3 | LL | #[marker("never")] - | ^^^^^^^^---------^ + | ^^^^^^--------- | | | didn't expect any arguments here | @@ -27,10 +27,10 @@ LL + #[marker] | error[E0565]: malformed `marker` attribute input - --> $DIR/marker-attribute-with-values.rs:9:1 + --> $DIR/marker-attribute-with-values.rs:9:3 | LL | #[marker(key = "value")] - | ^^^^^^^^---------------^ + | ^^^^^^--------------- | | | didn't expect any arguments here | diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index f93db6ab29a23..f437ee8b66b46 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -137,10 +137,10 @@ LL | #[must_use = "string"suffix] | ^^^^^^^^^^^^^^ invalid suffix `suffix` error[E0539]: malformed `must_use` attribute input - --> $DIR/bad-lit-suffixes.rs:34:1 + --> $DIR/bad-lit-suffixes.rs:34:3 | LL | #[must_use = "string"suffix] - | ^^^^^^^^^^^^^--------------^ + | ^^^^^^^^^^^-------------- | | | expected a string literal here | diff --git a/tests/ui/patchable-function-entry/patchable-function-entry-attribute.stderr b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.stderr index c3f09ff12384a..8fe6e0e050843 100644 --- a/tests/ui/patchable-function-entry/patchable-function-entry-attribute.stderr +++ b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:4:1 + --> $DIR/patchable-function-entry-attribute.rs:4:3 | LL | #[patchable_function_entry(prefix_nops = 256, entry_nops = 0)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^^^^^^^^^^^^^^^ | | | expected an integer literal in the range of 0..=255 | @@ -13,10 +13,10 @@ LL + #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:8:1 + --> $DIR/patchable-function-entry-attribute.rs:8:3 | LL | #[patchable_function_entry(prefix_nops = "stringvalue", entry_nops = 0)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^^^^^^^^^^^^^^^ | | | expected an integer literal here | @@ -27,10 +27,10 @@ LL + #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:12:1 + --> $DIR/patchable-function-entry-attribute.rs:12:3 | LL | #[patchable_function_entry] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | @@ -38,10 +38,10 @@ LL | #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:16:1 + --> $DIR/patchable-function-entry-attribute.rs:16:3 | LL | #[patchable_function_entry(prefix_nops = 10, something = 0)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^^^^ | | | valid arguments are `prefix_nops` or `entry_nops` | @@ -52,10 +52,10 @@ LL + #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:20:1 + --> $DIR/patchable-function-entry-attribute.rs:20:3 | LL | #[patchable_function_entry()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^^^^^^^^^^^^^-- | | | expected at least 1 argument here | @@ -65,10 +65,10 @@ LL | #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | ++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0538]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:24:1 + --> $DIR/patchable-function-entry-attribute.rs:24:3 | LL | #[patchable_function_entry(prefix_nops = 255, prefix_nops = 255)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^ | | | found `prefix_nops` used as a key more than once | @@ -79,10 +79,10 @@ LL + #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | error[E0539]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:28:1 + --> $DIR/patchable-function-entry-attribute.rs:28:3 | LL | #[patchable_function_entry(section = 255)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ | | | expected a string literal here | @@ -93,10 +93,10 @@ LL + #[patchable_function_entry(prefix_nops = m, entry_nops = n, section = "sect | error[E0538]: malformed `patchable_function_entry` attribute input - --> $DIR/patchable-function-entry-attribute.rs:32:1 + --> $DIR/patchable-function-entry-attribute.rs:32:3 | LL | #[patchable_function_entry(section = "foo", section = "bar")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^^ | | | found `section` used as a key more than once | diff --git a/tests/ui/proc-macro/attribute.stderr b/tests/ui/proc-macro/attribute.stderr index cf80df7c382e5..35e248729887a 100644 --- a/tests/ui/proc-macro/attribute.stderr +++ b/tests/ui/proc-macro/attribute.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:9:1 + --> $DIR/attribute.rs:9:3 | LL | #[proc_macro_derive] - | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^ expected this to be a list | = note: for more information, visit help: try changing it to one of the following valid forms of the attribute @@ -13,10 +13,10 @@ LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | ++++++++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:15:1 + --> $DIR/attribute.rs:15:3 | LL | #[proc_macro_derive = ""] - | ^^^^^^^^^^^^^^^^^^^^----^ + | ^^^^^^^^^^^^^^^^^^---- | | | expected this to be a list | @@ -31,10 +31,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:21:1 + --> $DIR/attribute.rs:21:3 | LL | #[proc_macro_derive(d3, a, b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^-^^^^ | | | the only valid argument here is `attributes` | @@ -49,10 +49,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:27:1 + --> $DIR/attribute.rs:27:3 | LL | #[proc_macro_derive(d4, attributes(a), b)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | didn't expect any arguments here | @@ -67,10 +67,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:33:1 + --> $DIR/attribute.rs:33:3 | LL | #[proc_macro_derive("a")] - | ^^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^^---^ | | | didn't expect a literal here | @@ -85,10 +85,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:39:1 + --> $DIR/attribute.rs:39:3 | LL | #[proc_macro_derive(d6 = "")] - | ^^^^^^^^^^^^^^^^^^^^^^^----^^ + | ^^^^^^^^^^^^^^^^^^^^^----^ | | | didn't expect any arguments here | @@ -103,10 +103,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:45:1 + --> $DIR/attribute.rs:45:3 | LL | #[proc_macro_derive(m::d7)] - | ^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^-----^ | | | expected a valid identifier here | @@ -121,10 +121,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:51:1 + --> $DIR/attribute.rs:51:3 | LL | #[proc_macro_derive(d8(a))] - | ^^^^^^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^^^^^^---^ | | | didn't expect any arguments here | @@ -139,10 +139,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:57:1 + --> $DIR/attribute.rs:57:3 | LL | #[proc_macro_derive(self)] - | ^^^^^^^^^^^^^^^^^^^^----^^ + | ^^^^^^^^^^^^^^^^^^----^ | | | expected a valid identifier here | @@ -157,10 +157,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:66:1 + --> $DIR/attribute.rs:66:3 | LL | #[proc_macro_derive(d11, a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^^^^^^^^^^-^ | | | the only valid argument here is `attributes` | @@ -175,10 +175,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:72:1 + --> $DIR/attribute.rs:72:3 | LL | #[proc_macro_derive(d12, attributes)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^----------^ | | | expected this to be a list | @@ -193,10 +193,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:78:1 + --> $DIR/attribute.rs:78:3 | LL | #[proc_macro_derive(d13, attributes("a"))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^ | | | expected a valid identifier here | @@ -211,10 +211,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:84:1 + --> $DIR/attribute.rs:84:3 | LL | #[proc_macro_derive(d14, attributes(a = ""))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^ | | | didn't expect any arguments here | @@ -229,10 +229,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:90:1 + --> $DIR/attribute.rs:90:3 | LL | #[proc_macro_derive(d15, attributes(m::a))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^ | | | expected a valid identifier here | @@ -247,10 +247,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:96:1 + --> $DIR/attribute.rs:96:3 | LL | #[proc_macro_derive(d16, attributes(a(b)))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^ | | | didn't expect any arguments here | @@ -265,10 +265,10 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:102:1 + --> $DIR/attribute.rs:102:3 | LL | #[proc_macro_derive(d17, attributes(self))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^ | | | expected a valid identifier here | diff --git a/tests/ui/proc-macro/invalid-attributes.stderr b/tests/ui/proc-macro/invalid-attributes.stderr index 244d62fd23bfc..b853d0b5921e7 100644 --- a/tests/ui/proc-macro/invalid-attributes.stderr +++ b/tests/ui/proc-macro/invalid-attributes.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `proc_macro` attribute input - --> $DIR/invalid-attributes.rs:10:1 + --> $DIR/invalid-attributes.rs:10:3 | LL | #[proc_macro = "test"] - | ^^^^^^^^^^^^^--------^ + | ^^^^^^^^^^^-------- | | | didn't expect any arguments here | @@ -13,10 +13,10 @@ LL + #[proc_macro] | error[E0565]: malformed `proc_macro` attribute input - --> $DIR/invalid-attributes.rs:15:1 + --> $DIR/invalid-attributes.rs:15:3 | LL | #[proc_macro()] - | ^^^^^^^^^^^^--^ + | ^^^^^^^^^^-- | | | didn't expect any arguments here | @@ -27,10 +27,10 @@ LL + #[proc_macro] | error[E0565]: malformed `proc_macro` attribute input - --> $DIR/invalid-attributes.rs:20:1 + --> $DIR/invalid-attributes.rs:20:3 | LL | #[proc_macro(x)] - | ^^^^^^^^^^^^---^ + | ^^^^^^^^^^--- | | | didn't expect any arguments here | @@ -41,10 +41,10 @@ LL + #[proc_macro] | error[E0565]: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:25:1 + --> $DIR/invalid-attributes.rs:25:3 | LL | #[proc_macro_attribute = "test"] - | ^^^^^^^^^^^^^^^^^^^^^^^--------^ + | ^^^^^^^^^^^^^^^^^^^^^-------- | | | didn't expect any arguments here | @@ -55,10 +55,10 @@ LL + #[proc_macro_attribute] | error[E0565]: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:30:1 + --> $DIR/invalid-attributes.rs:30:3 | LL | #[proc_macro_attribute()] - | ^^^^^^^^^^^^^^^^^^^^^^--^ + | ^^^^^^^^^^^^^^^^^^^^-- | | | didn't expect any arguments here | @@ -69,10 +69,10 @@ LL + #[proc_macro_attribute] | error[E0565]: malformed `proc_macro_attribute` attribute input - --> $DIR/invalid-attributes.rs:35:1 + --> $DIR/invalid-attributes.rs:35:3 | LL | #[proc_macro_attribute(x)] - | ^^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^^^--- | | | didn't expect any arguments here | diff --git a/tests/ui/recursion/recursion_limit/invalid_digit_type.stderr b/tests/ui/recursion/recursion_limit/invalid_digit_type.stderr index 4683198b5fc4e..ba37c05bd9559 100644 --- a/tests/ui/recursion/recursion_limit/invalid_digit_type.stderr +++ b/tests/ui/recursion/recursion_limit/invalid_digit_type.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `recursion_limit` attribute input - --> $DIR/invalid_digit_type.rs:1:1 + --> $DIR/invalid_digit_type.rs:1:4 | LL | #![recursion_limit = 123] - | ^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^--- | | | expected a string literal here | diff --git a/tests/ui/recursion/recursion_limit/no-value.stderr b/tests/ui/recursion/recursion_limit/no-value.stderr index 4305956be7987..f644d58179692 100644 --- a/tests/ui/recursion/recursion_limit/no-value.stderr +++ b/tests/ui/recursion/recursion_limit/no-value.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `recursion_limit` attribute input - --> $DIR/no-value.rs:3:1 + --> $DIR/no-value.rs:3:4 | LL | #![recursion_limit] - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ | = note: for more information, visit help: must be of the form diff --git a/tests/ui/repr/invalid_repr_list_help.stderr b/tests/ui/repr/invalid_repr_list_help.stderr index 82bf12f3f4dbc..17e6e99c82f4f 100644 --- a/tests/ui/repr/invalid_repr_list_help.stderr +++ b/tests/ui/repr/invalid_repr_list_help.stderr @@ -1,48 +1,48 @@ error[E0539]: malformed `repr` attribute input - --> $DIR/invalid_repr_list_help.rs:4:1 + --> $DIR/invalid_repr_list_help.rs:4:3 | LL | #[repr(uwu)] - | ^^^^^^^---^^ + | ^^^^^---^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/invalid_repr_list_help.rs:7:1 + --> $DIR/invalid_repr_list_help.rs:7:3 | LL | #[repr(uwu = "a")] - | ^^^^^^^---------^^ + | ^^^^^---------^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/invalid_repr_list_help.rs:10:1 + --> $DIR/invalid_repr_list_help.rs:10:3 | LL | #[repr(uwu(4))] - | ^^^^^^^------^^ + | ^^^^^------^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/invalid_repr_list_help.rs:15:1 + --> $DIR/invalid_repr_list_help.rs:15:3 | LL | #[repr(uwu, u8)] - | ^^^^^^^---^^^^^^ + | ^^^^^---^^^^^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/invalid_repr_list_help.rs:20:1 + --> $DIR/invalid_repr_list_help.rs:20:3 | LL | #[repr(uwu)] - | ^^^^^^^---^^ + | ^^^^^---^ | | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | diff --git a/tests/ui/repr/malformed-repr-hints.stderr b/tests/ui/repr/malformed-repr-hints.stderr index 5911d11fc87af..1fa2c689717c6 100644 --- a/tests/ui/repr/malformed-repr-hints.stderr +++ b/tests/ui/repr/malformed-repr-hints.stderr @@ -1,98 +1,98 @@ error[E0805]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:6:1 + --> $DIR/malformed-repr-hints.rs:6:3 | LL | #[repr(packed())] - | ^^^^^^^^^^^^^--^^ + | ^^^^^^^^^^^--^ | | | expected an argument here | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:10:1 + --> $DIR/malformed-repr-hints.rs:10:3 | LL | #[repr(align)] - | ^^^^^^^-----^^ + | ^^^^^-----^ | | | expected this to be a list | = note: for more information, visit error[E0805]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:14:1 + --> $DIR/malformed-repr-hints.rs:14:3 | LL | #[repr(align(2, 4))] - | ^^^^^^^^^^^^------^^ + | ^^^^^^^^^^------^ | | | expected a single argument here | = note: for more information, visit error[E0805]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:18:1 + --> $DIR/malformed-repr-hints.rs:18:3 | LL | #[repr(align())] - | ^^^^^^^^^^^^--^^ + | ^^^^^^^^^^--^ | | | expected an argument here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:23:1 + --> $DIR/malformed-repr-hints.rs:23:3 | LL | #[repr(Rust(u8))] - | ^^^^^^^^^^^----^^ + | ^^^^^^^^^----^ | | | didn't expect any arguments here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:25:1 + --> $DIR/malformed-repr-hints.rs:25:3 | LL | #[repr(Rust(0))] - | ^^^^^^^^^^^---^^ + | ^^^^^^^^^---^ | | | didn't expect any arguments here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:27:1 + --> $DIR/malformed-repr-hints.rs:27:3 | LL | #[repr(Rust = 0)] - | ^^^^^^^^^^^^---^^ + | ^^^^^^^^^^---^ | | | didn't expect any arguments here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:31:1 + --> $DIR/malformed-repr-hints.rs:31:3 | LL | #[repr(i8())] - | ^^^^^^^^^--^^ + | ^^^^^^^--^ | | | didn't expect any arguments here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:35:1 + --> $DIR/malformed-repr-hints.rs:35:3 | LL | #[repr(u32(42))] - | ^^^^^^^^^^----^^ + | ^^^^^^^^----^ | | | didn't expect any arguments here | = note: for more information, visit error[E0565]: malformed `repr` attribute input - --> $DIR/malformed-repr-hints.rs:39:1 + --> $DIR/malformed-repr-hints.rs:39:3 | LL | #[repr(i64 = 2)] - | ^^^^^^^^^^^---^^ + | ^^^^^^^^^---^ | | | didn't expect any arguments here | diff --git a/tests/ui/repr/repr-align-assign.stderr b/tests/ui/repr/repr-align-assign.stderr index f81cdf532fdaf..10c43a1a3df4c 100644 --- a/tests/ui/repr/repr-align-assign.stderr +++ b/tests/ui/repr/repr-align-assign.stderr @@ -1,18 +1,18 @@ error[E0539]: malformed `repr` attribute input - --> $DIR/repr-align-assign.rs:3:1 + --> $DIR/repr-align-assign.rs:3:3 | LL | #[repr(align=8)] - | ^^^^^^^^^^^^--^^ + | ^^^^^^^^^^--^ | | | expected this to be a list | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/repr-align-assign.rs:6:1 + --> $DIR/repr-align-assign.rs:6:3 | LL | #[repr(align="8")] - | ^^^^^^^^^^^^----^^ + | ^^^^^^^^^^----^ | | | expected this to be a list | diff --git a/tests/ui/repr/repr.stderr b/tests/ui/repr/repr.stderr index a842590c9639e..1f1af31a82d3c 100644 --- a/tests/ui/repr/repr.stderr +++ b/tests/ui/repr/repr.stderr @@ -1,26 +1,26 @@ error[E0539]: malformed `repr` attribute input - --> $DIR/repr.rs:1:1 + --> $DIR/repr.rs:1:3 | LL | #[repr] - | ^^^^^^^ expected this to be a list + | ^^^^ expected this to be a list | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/repr.rs:4:1 + --> $DIR/repr.rs:4:3 | LL | #[repr = "B"] - | ^^^^^^^-----^ + | ^^^^^----- | | | expected this to be a list | = note: for more information, visit error[E0539]: malformed `repr` attribute input - --> $DIR/repr.rs:7:1 + --> $DIR/repr.rs:7:3 | LL | #[repr = "C"] - | ^^^^^^^-----^ + | ^^^^^----- | | | expected this to be a list | diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr index de6fdb9b47658..09a6d30a0d9f1 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `non_exhaustive` attribute input - --> $DIR/invalid-attribute.rs:1:1 + --> $DIR/invalid-attribute.rs:1:3 | LL | #[non_exhaustive(anything)] - | ^^^^^^^^^^^^^^^^----------^ + | ^^^^^^^^^^^^^^---------- | | | didn't expect any arguments here | diff --git a/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr index 41e6085368dd1..24c738b6ea8d3 100644 --- a/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr +++ b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `track_caller` attribute input - --> $DIR/error-odd-syntax.rs:1:1 + --> $DIR/error-odd-syntax.rs:1:3 | LL | #[track_caller(1)] - | ^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^--- | | | didn't expect any arguments here | diff --git a/tests/ui/rustdoc/check-doc-alias-attr.stderr b/tests/ui/rustdoc/check-doc-alias-attr.stderr index d9e785ee0f1fe..2d9145a28e8e8 100644 --- a/tests/ui/rustdoc/check-doc-alias-attr.stderr +++ b/tests/ui/rustdoc/check-doc-alias-attr.stderr @@ -5,10 +5,10 @@ LL | #[doc(alias)] | ^^^^^ error[E0539]: malformed `doc` attribute input - --> $DIR/check-doc-alias-attr.rs:8:1 + --> $DIR/check-doc-alias-attr.rs:8:3 | LL | #[doc(alias = 0)] - | ^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^-^ | | | expected a string literal here @@ -57,10 +57,10 @@ LL | #[doc(alias = "")] | ^^ error[E0539]: malformed `doc` attribute input - --> $DIR/check-doc-alias-attr.rs:19:1 + --> $DIR/check-doc-alias-attr.rs:19:3 | LL | #[doc(alias(0))] - | ^^^^^^^^^^^^-^^^ + | ^^^^^^^^^^-^^ | | | expected a string literal here diff --git a/tests/ui/sanitize-attr/invalid-sanitize.stderr b/tests/ui/sanitize-attr/invalid-sanitize.stderr index 699902ffea05c..9ede1dc5e0db4 100644 --- a/tests/ui/sanitize-attr/invalid-sanitize.stderr +++ b/tests/ui/sanitize-attr/invalid-sanitize.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `sanitize` attribute input - --> $DIR/invalid-sanitize.rs:4:1 + --> $DIR/invalid-sanitize.rs:4:3 | LL | #[sanitize(brontosaurus = "off")] - | ^^^^^^^^^^^------------^^^^^^^^^^ + | ^^^^^^^^^------------^^^^^^^^^ | | | valid arguments are "address", "kernel_address", "cfi", "kcfi", "memory", "memtag", "shadow_call_stack", "thread", "hwaddress", "kernel_hwaddress" or "realtime" @@ -31,32 +31,32 @@ LL | #[sanitize(address = "on")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0539]: malformed `sanitize` attribute input - --> $DIR/invalid-sanitize.rs:15:1 + --> $DIR/invalid-sanitize.rs:15:3 | LL | #[sanitize(address = "bogus")] - | ^^^^^^^^^^^^^^^^^^^^^-------^^ + | ^^^^^^^^^^^^^^^^^^^-------^ | | | valid arguments are "on" or "off" error[E0539]: malformed `sanitize` attribute input - --> $DIR/invalid-sanitize.rs:18:1 + --> $DIR/invalid-sanitize.rs:18:3 | LL | #[sanitize = "off"] - | ^^^^^^^^^^^-------^ + | ^^^^^^^^^------- | | | expected this to be a list error[E0539]: malformed `sanitize` attribute input - --> $DIR/invalid-sanitize.rs:21:1 + --> $DIR/invalid-sanitize.rs:21:3 | LL | #[sanitize] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list error[E0539]: malformed `sanitize` attribute input - --> $DIR/invalid-sanitize.rs:24:1 + --> $DIR/invalid-sanitize.rs:24:3 | LL | #[sanitize(realtime = "on")] - | ^^^^^^^^^^^^^^^^^^^^^^----^^ + | ^^^^^^^^^^^^^^^^^^^^----^ | | | valid arguments are "nonblocking", "blocking" or "caller" diff --git a/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr b/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr index c692892af11cc..620957e6e95d4 100644 --- a/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr +++ b/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `cfi_encoding` attribute input - --> $DIR/invalid-attr-encoding.rs:10:1 + --> $DIR/invalid-attr-encoding.rs:10:3 | LL | #[cfi_encoding] - | ^^^^^^^^^^^^^^^ expected this to be of the form `cfi_encoding = "..."` + | ^^^^^^^^^^^^ expected this to be of the form `cfi_encoding = "..."` | help: must be of the form | diff --git a/tests/ui/scalable-vectors/invalid.stderr b/tests/ui/scalable-vectors/invalid.stderr index 34deb1a13c827..72199dd123b2a 100644 --- a/tests/ui/scalable-vectors/invalid.stderr +++ b/tests/ui/scalable-vectors/invalid.stderr @@ -5,7 +5,7 @@ LL | fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `rustc_scalable_vector` attribute cannot be used on extern crates - --> $DIR/invalid.rs:10:1 + --> $DIR/invalid.rs:10:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on use statements - --> $DIR/invalid.rs:14:1 + --> $DIR/invalid.rs:14:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on statics - --> $DIR/invalid.rs:18:1 + --> $DIR/invalid.rs:18:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on constants - --> $DIR/invalid.rs:22:1 + --> $DIR/invalid.rs:22:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on modules - --> $DIR/invalid.rs:26:1 + --> $DIR/invalid.rs:26:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on foreign modules - --> $DIR/invalid.rs:31:1 + --> $DIR/invalid.rs:31:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on foreign statics - --> $DIR/invalid.rs:34:5 + --> $DIR/invalid.rs:34:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -61,7 +61,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on foreign types - --> $DIR/invalid.rs:37:5 + --> $DIR/invalid.rs:37:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -69,7 +69,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on foreign functions - --> $DIR/invalid.rs:40:5 + --> $DIR/invalid.rs:40:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -77,7 +77,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on type aliases - --> $DIR/invalid.rs:45:1 + --> $DIR/invalid.rs:45:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -85,7 +85,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on enums - --> $DIR/invalid.rs:49:1 + --> $DIR/invalid.rs:49:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -93,7 +93,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on type parameters - --> $DIR/invalid.rs:51:10 + --> $DIR/invalid.rs:51:12 | LL | enum Bar<#[rustc_scalable_vector(4)] T> { | ^^^^^^^^^^^^^^^^^^^^^ @@ -101,7 +101,7 @@ LL | enum Bar<#[rustc_scalable_vector(4)] T> { = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on enum variants - --> $DIR/invalid.rs:53:5 + --> $DIR/invalid.rs:53:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -109,7 +109,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on struct fields - --> $DIR/invalid.rs:59:5 + --> $DIR/invalid.rs:59:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +117,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on unions - --> $DIR/invalid.rs:64:1 + --> $DIR/invalid.rs:64:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -125,7 +125,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on traits - --> $DIR/invalid.rs:71:1 + --> $DIR/invalid.rs:71:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -133,7 +133,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on associated types - --> $DIR/invalid.rs:74:5 + --> $DIR/invalid.rs:74:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -141,7 +141,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on associated consts - --> $DIR/invalid.rs:77:5 + --> $DIR/invalid.rs:77:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -149,7 +149,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on provided trait methods - --> $DIR/invalid.rs:80:5 + --> $DIR/invalid.rs:80:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -157,7 +157,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on trait aliases - --> $DIR/invalid.rs:85:1 + --> $DIR/invalid.rs:85:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -165,7 +165,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on inherent impl blocks - --> $DIR/invalid.rs:89:1 + --> $DIR/invalid.rs:89:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -173,7 +173,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on inherent methods - --> $DIR/invalid.rs:92:5 + --> $DIR/invalid.rs:92:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -181,7 +181,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on trait impl blocks - --> $DIR/invalid.rs:97:1 + --> $DIR/invalid.rs:97:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -189,7 +189,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on macro defs - --> $DIR/invalid.rs:104:1 + --> $DIR/invalid.rs:104:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -197,7 +197,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on functions - --> $DIR/invalid.rs:108:1 + --> $DIR/invalid.rs:108:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -205,7 +205,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on function params - --> $DIR/invalid.rs:110:11 + --> $DIR/invalid.rs:110:13 | LL | fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} | ^^^^^^^^^^^^^^^^^^^^^ @@ -213,7 +213,7 @@ LL | fn barqux(#[rustc_scalable_vector(4)] _x: u32) {} = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on functions - --> $DIR/invalid.rs:114:1 + --> $DIR/invalid.rs:114:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -221,7 +221,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on functions - --> $DIR/invalid.rs:118:1 + --> $DIR/invalid.rs:118:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -229,7 +229,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on functions - --> $DIR/invalid.rs:122:1 + --> $DIR/invalid.rs:122:3 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -237,7 +237,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on closures - --> $DIR/invalid.rs:127:14 + --> $DIR/invalid.rs:127:16 | LL | let _x = #[rustc_scalable_vector(4)] || { }; | ^^^^^^^^^^^^^^^^^^^^^ @@ -245,7 +245,7 @@ LL | let _x = #[rustc_scalable_vector(4)] || { }; = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on expressions - --> $DIR/invalid.rs:129:14 + --> $DIR/invalid.rs:129:16 | LL | let _y = #[rustc_scalable_vector(4)] 3 + 4; | ^^^^^^^^^^^^^^^^^^^^^ @@ -253,7 +253,7 @@ LL | let _y = #[rustc_scalable_vector(4)] 3 + 4; = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on statements - --> $DIR/invalid.rs:131:5 + --> $DIR/invalid.rs:131:7 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -261,7 +261,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error: the `rustc_scalable_vector` attribute cannot be used on match arms - --> $DIR/invalid.rs:136:9 + --> $DIR/invalid.rs:136:11 | LL | #[rustc_scalable_vector(4)] | ^^^^^^^^^^^^^^^^^^^^^ @@ -269,7 +269,7 @@ LL | #[rustc_scalable_vector(4)] = help: the `rustc_scalable_vector` attribute can only be applied to structs error[E0539]: malformed `rustc_scalable_vector` attribute input - --> $DIR/invalid.rs:143:1 + --> $DIR/invalid.rs:143:3 | LL | #[rustc_scalable_vector("4")] | ^^^^^^^^^^^^^^^^^^^^^^---^ @@ -286,7 +286,7 @@ LL + #[rustc_scalable_vector] | error[E0805]: malformed `rustc_scalable_vector` attribute input - --> $DIR/invalid.rs:147:1 + --> $DIR/invalid.rs:147:3 | LL | #[rustc_scalable_vector(4, 2)] | ^^^^^^^^^^^^^^^^^^^^^------ @@ -303,7 +303,7 @@ LL + #[rustc_scalable_vector] | error[E0539]: malformed `rustc_scalable_vector` attribute input - --> $DIR/invalid.rs:151:1 + --> $DIR/invalid.rs:151:3 | LL | #[rustc_scalable_vector(count = "4")] | ^^^^^^^^^^^^^^^^^^^^^^-----------^ @@ -323,7 +323,7 @@ error: element count in `rustc_scalable_vector` is too large: `65536` --> $DIR/invalid.rs:155:1 | LL | #[rustc_scalable_vector(65536)] - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the value may not exceed `u16::MAX` diff --git a/tests/ui/span/E0539.stderr b/tests/ui/span/E0539.stderr index 34d81b73cb519..4f2217a476cf6 100644 --- a/tests/ui/span/E0539.stderr +++ b/tests/ui/span/E0539.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `inline` attribute input - --> $DIR/E0539.rs:1:1 + --> $DIR/E0539.rs:1:3 | LL | #[inline(unknown)] - | ^^^^^^^^^-------^^ + | ^^^^^^^-------^ | | | valid arguments are `always` or `never` | diff --git a/tests/ui/stability-attribute/stability-attribute-sanity-2.stderr b/tests/ui/stability-attribute/stability-attribute-sanity-2.stderr index e798b6d6f6a08..7200d1606a9b4 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity-2.stderr +++ b/tests/ui/stability-attribute/stability-attribute-sanity-2.stderr @@ -1,8 +1,8 @@ error[E0538]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity-2.rs:7:1 + --> $DIR/stability-attribute-sanity-2.rs:7:3 | LL | #[stable(feature = "a", feature = "b", since = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^^^^^^^^^^^^^^^^^ | | | found `feature` used as a key more than once | @@ -13,10 +13,10 @@ LL + #[stable(feature = "name", since = "version")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity-2.rs:10:1 + --> $DIR/stability-attribute-sanity-2.rs:10:3 | LL | #[stable(feature = "a", sinse = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^---------------^^ + | ^^^^^^^^^^^^^^^^^^^^^^---------------^ | | | valid arguments are `feature` or `since` | diff --git a/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr b/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr index 9e82a4daa50ed..1f2ae10e07ac5 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr +++ b/tests/ui/stability-attribute/stability-attribute-sanity-4.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `unstable` attribute input - --> $DIR/stability-attribute-sanity-4.rs:8:5 + --> $DIR/stability-attribute-sanity-4.rs:8:7 | LL | #[unstable] - | ^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^ expected this to be a list | help: must be of the form | @@ -10,10 +10,10 @@ LL | #[unstable(feature = "name", reason = "...", issue = "N")] | +++++++++++++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `unstable` attribute input - --> $DIR/stability-attribute-sanity-4.rs:11:5 + --> $DIR/stability-attribute-sanity-4.rs:11:7 | LL | #[unstable = "b"] - | ^^^^^^^^^^^-----^ + | ^^^^^^^^^----- | | | expected this to be a list | @@ -24,10 +24,10 @@ LL + #[unstable(feature = "name", reason = "...", issue = "N")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity-4.rs:14:5 + --> $DIR/stability-attribute-sanity-4.rs:14:7 | LL | #[stable] - | ^^^^^^^^^ expected this to be a list + | ^^^^^^ expected this to be a list | help: must be of the form | @@ -35,10 +35,10 @@ LL | #[stable(feature = "name", since = "version")] | +++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity-4.rs:17:5 + --> $DIR/stability-attribute-sanity-4.rs:17:7 | LL | #[stable = "a"] - | ^^^^^^^^^-----^ + | ^^^^^^^----- | | | expected this to be a list | diff --git a/tests/ui/stability-attribute/stability-attribute-sanity.stderr b/tests/ui/stability-attribute/stability-attribute-sanity.stderr index 55b318c51ab93..ba17980c177e2 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/tests/ui/stability-attribute/stability-attribute-sanity.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity.rs:8:5 + --> $DIR/stability-attribute-sanity.rs:8:7 | LL | #[stable(feature = "a", since = "4.4.4", reason)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------^ | | | valid arguments are `feature` or `since` | @@ -13,10 +13,10 @@ LL + #[stable(feature = "name", since = "version")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity.rs:11:5 + --> $DIR/stability-attribute-sanity.rs:11:7 | LL | #[stable(feature = "a", since)] - | ^^^^^^^^^^^^^^^^^^^^^^^^-----^^ + | ^^^^^^^^^^^^^^^^^^^^^^-----^ | | | expected this to be of the form `since = "..."` | @@ -27,10 +27,10 @@ LL + #[stable(feature = "name", since = "version")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity.rs:14:5 + --> $DIR/stability-attribute-sanity.rs:14:7 | LL | #[stable(feature, since = "3.3.3")] - | ^^^^^^^^^-------^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^-------^^^^^^^^^^^^^^^^^^ | | | expected this to be of the form `feature = "..."` | @@ -41,10 +41,10 @@ LL + #[stable(feature = "name", since = "version")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity.rs:17:5 + --> $DIR/stability-attribute-sanity.rs:17:7 | LL | #[stable(feature = "a", since(b))] - | ^^^^^^^^^^^^^^^^^^^^^^^^--------^^ + | ^^^^^^^^^^^^^^^^^^^^^^--------^ | | | expected this to be of the form `since = "..."` | @@ -55,10 +55,10 @@ LL + #[stable(feature = "name", since = "version")] | error[E0539]: malformed `stable` attribute input - --> $DIR/stability-attribute-sanity.rs:20:5 + --> $DIR/stability-attribute-sanity.rs:20:7 | LL | #[stable(feature(b), since = "3.3.3")] - | ^^^^^^^^^----------^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^----------^^^^^^^^^^^^^^^^^^ | | | expected this to be of the form `feature = "..."` | diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index 79259fae936fd..5e8afb2449837 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -23,10 +23,10 @@ LL | #[target_feature(enable = "sse2")] = help: the `target_feature` attribute can only be applied to functions error[E0539]: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:24:1 + --> $DIR/invalid-attribute.rs:24:3 | LL | #[target_feature = "+sse2"] - | ^^^^^^^^^^^^^^^^^---------^ + | ^^^^^^^^^^^^^^^--------- | | | expected this to be a list | @@ -37,10 +37,10 @@ LL + #[target_feature(enable = "feat1, feat2")] | error[E0539]: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:30:1 + --> $DIR/invalid-attribute.rs:30:3 | LL | #[target_feature(bar)] - | ^^^^^^^^^^^^^^^^^---^^ + | ^^^^^^^^^^^^^^^---^ | | | expected this to be of the form `enable = "..."` | @@ -51,10 +51,10 @@ LL + #[target_feature(enable = "feat1, feat2")] | error[E0539]: malformed `target_feature` attribute input - --> $DIR/invalid-attribute.rs:33:1 + --> $DIR/invalid-attribute.rs:33:3 | LL | #[target_feature(disable = "baz")] - | ^^^^^^^^^^^^^^^^^-------^^^^^^^^^^ + | ^^^^^^^^^^^^^^^-------^^^^^^^^^ | | | the only valid argument here is `enable` | diff --git a/tests/ui/test-attrs/test-should-panic-attr.stderr b/tests/ui/test-attrs/test-should-panic-attr.stderr index 327444d9885c8..c04293e0872a4 100644 --- a/tests/ui/test-attrs/test-should-panic-attr.stderr +++ b/tests/ui/test-attrs/test-should-panic-attr.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:11:1 + --> $DIR/test-should-panic-attr.rs:11:3 | LL | #[should_panic(expected)] - | ^^^^^^^^^^^^^^^--------^^ + | ^^^^^^^^^^^^^--------^ | | | expected this to be of the form `expected = "..."` | @@ -19,10 +19,10 @@ LL + #[should_panic] | error[E0539]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:20:1 + --> $DIR/test-should-panic-attr.rs:20:3 | LL | #[should_panic(expect)] - | ^^^^^^^^^^^^^^^------^^ + | ^^^^^^^^^^^^^------^ | | | expected this to be of the form `expected = "..."` | @@ -39,10 +39,10 @@ LL + #[should_panic] | error[E0539]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:29:1 + --> $DIR/test-should-panic-attr.rs:29:3 | LL | #[should_panic(expected(foo, bar))] - | ^^^^^^^^^^^^^^^------------------^^ + | ^^^^^^^^^^^^^------------------^ | | | expected this to be of the form `expected = "..."` | @@ -60,10 +60,10 @@ LL + #[should_panic] | error[E0805]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:38:1 + --> $DIR/test-should-panic-attr.rs:38:3 | LL | #[should_panic(expected = "foo", bar)] - | ^^^^^^^^^^^^^^-----------------------^ + | ^^^^^^^^^^^^----------------------- | | | expected a single argument here | diff --git a/tests/ui/tool-attributes/invalid-tool.stderr b/tests/ui/tool-attributes/invalid-tool.stderr index 499894a9200c3..b4e2c3e7eaccb 100644 --- a/tests/ui/tool-attributes/invalid-tool.stderr +++ b/tests/ui/tool-attributes/invalid-tool.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `register_tool` attribute input - --> $DIR/invalid-tool.rs:3:1 + --> $DIR/invalid-tool.rs:3:4 | LL | #![register_tool(1)] - | ^^^^^^^^^^^^^^^^^-^^ + | ^^^^^^^^^^^^^^-^ | | | expected a valid identifier here | diff --git a/tests/ui/tool-attributes/nested-disallowed.stderr b/tests/ui/tool-attributes/nested-disallowed.stderr index 3cc9c6868998a..eaa5d60ba9728 100644 --- a/tests/ui/tool-attributes/nested-disallowed.stderr +++ b/tests/ui/tool-attributes/nested-disallowed.stderr @@ -1,8 +1,8 @@ error[E0565]: malformed `register_tool` attribute input - --> $DIR/nested-disallowed.rs:2:1 + --> $DIR/nested-disallowed.rs:2:4 | LL | #![register_tool(foo::bar)] - | ^^^^^^^^^^^^^^^^^--------^^ + | ^^^^^^^^^^^^^^--------^ | | | expected a valid identifier here | diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr index c10108b04e325..06ad48fa67a81 100644 --- a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr +++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `rustc_must_implement_one_of` attribute input - --> $DIR/rustc_must_implement_one_of_misuse.rs:14:1 + --> $DIR/rustc_must_implement_one_of_misuse.rs:14:3 | LL | #[rustc_must_implement_one_of(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^--- | | | expected 2 or more items | @@ -13,10 +13,10 @@ LL + #[rustc_must_implement_one_of(function1, function2, ...)] | error[E0539]: malformed `rustc_must_implement_one_of` attribute input - --> $DIR/rustc_must_implement_one_of_misuse.rs:20:1 + --> $DIR/rustc_must_implement_one_of_misuse.rs:20:3 | LL | #[rustc_must_implement_one_of] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | help: must be of the form | diff --git a/tests/ui/wasm/wasm-import-module.stderr b/tests/ui/wasm/wasm-import-module.stderr index 6171f04f862cc..220579e6518dd 100644 --- a/tests/ui/wasm/wasm-import-module.stderr +++ b/tests/ui/wasm/wasm-import-module.stderr @@ -1,28 +1,28 @@ error[E0539]: malformed `link` attribute input - --> $DIR/wasm-import-module.rs:3:1 + --> $DIR/wasm-import-module.rs:3:3 | LL | #[link(name = "...", wasm_import_module)] - | ^^^^^^^^^^^^^^^^^^^^^------------------^^ + | ^^^^^^^^^^^^^^^^^^^------------------^ | | | expected this to be of the form `wasm_import_module = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/wasm-import-module.rs:6:1 + --> $DIR/wasm-import-module.rs:6:3 | LL | #[link(name = "...", wasm_import_module(x))] - | ^^^^^^^^^^^^^^^^^^^^^---------------------^^ + | ^^^^^^^^^^^^^^^^^^^---------------------^ | | | expected this to be of the form `wasm_import_module = "..."` | = note: for more information, visit error[E0539]: malformed `link` attribute input - --> $DIR/wasm-import-module.rs:9:1 + --> $DIR/wasm-import-module.rs:9:3 | LL | #[link(name = "...", wasm_import_module())] - | ^^^^^^^^^^^^^^^^^^^^^--------------------^^ + | ^^^^^^^^^^^^^^^^^^^--------------------^ | | | expected this to be of the form `wasm_import_module = "..."` | diff --git a/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr b/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr index c527ddefa8aec..7cf7ce5119267 100644 --- a/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr +++ b/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr @@ -1,8 +1,8 @@ error[E0539]: malformed `windows_subsystem` attribute input - --> $DIR/windows-subsystem-invalid.rs:1:1 + --> $DIR/windows-subsystem-invalid.rs:1:4 | LL | #![windows_subsystem = "wrong"] - | ^^^^^^^^^^^^^^^^^^^^^^^-------^ + | ^^^^^^^^^^^^^^^^^^^^------- | | | valid arguments are "console" or "windows" | From cd8a779c2f663d42fcaa95599911c7bad6ff0daf Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 24 Jul 2026 08:51:25 +1000 Subject: [PATCH 33/33] Mention attributes in the diagnostic output style guide --- src/doc/rustc-dev-guide/src/diagnostics.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doc/rustc-dev-guide/src/diagnostics.md b/src/doc/rustc-dev-guide/src/diagnostics.md index 651f86329c9e3..0928f27940885 100644 --- a/src/doc/rustc-dev-guide/src/diagnostics.md +++ b/src/doc/rustc-dev-guide/src/diagnostics.md @@ -158,6 +158,9 @@ use an error-level lint instead of a fixed error. compiler messages are an important learning tool. - When talking about the compiler, call it `the compiler`, not `Rust` or `rustc`. - Use the [Oxford comma](https://en.wikipedia.org/wiki/Serial_comma) when writing lists of items. +- When mentioning attributes, use this form whenever possible: "the `inline` attribute". + Don't include `#[`/`#![`/`]` delimiters or attribute arguments in the message or the span unless + they are relevant. ### Lint naming