diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 634afacf53900..f7f842393084b 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2216,12 +2216,7 @@ impl HumanEmitter { if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add = show_code_change { - for mut part in parts { - // If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the - // suggestion and snippet to look as if we just suggested to add - // `"b"`, which is typically much easier for the user to understand. - part.trim_trivial_replacements(sm); - + for part in parts { let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) { snippet } else { diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 6fce1fade2664..ceed0cd94fc91 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -71,7 +71,7 @@ use rustc_macros::{Decodable, Encodable}; pub use rustc_span::ErrorGuaranteed; pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker}; use rustc_span::source_map::SourceMap; -use rustc_span::{DUMMY_SP, Loc, Span}; +use rustc_span::{BytePos, DUMMY_SP, Loc, Span}; pub use snippet::Style; // Used by external projects such as `rust-gpu`. // See https://github.com/rust-lang/rust/pull/115393. @@ -237,10 +237,9 @@ impl SubstitutionPart { /// it with "abx" is, since the "c" character is lost. pub fn is_destructive_replacement(&self, sm: &SourceMap) -> bool { self.is_replacement(sm) - && !sm.span_to_snippet(self.span).is_ok_and(|snippet| { - self.snippet.trim_start().starts_with(snippet.trim_start()) - || self.snippet.trim_end().ends_with(snippet.trim_end()) - }) + && !sm + .span_to_snippet(self.span) + .is_ok_and(|snippet| as_substr(snippet.trim(), self.snippet.trim()).is_some()) } fn replaces_meaningful_content(&self, sm: &SourceMap) -> bool { @@ -257,16 +256,40 @@ impl SubstitutionPart { let Ok(snippet) = sm.span_to_snippet(self.span) else { return; }; - if self.snippet.starts_with(&snippet) { - self.span = self.span.shrink_to_hi(); - self.snippet = self.snippet[snippet.len()..].to_string(); - } else if self.snippet.ends_with(&snippet) { - self.span = self.span.shrink_to_lo(); - self.snippet = self.snippet[..self.snippet.len() - snippet.len()].to_string(); + + if let Some((prefix, substr, suffix)) = as_substr(&snippet, &self.snippet) { + self.span = Span::new( + self.span.lo() + BytePos(prefix as u32), + self.span.hi() - BytePos(suffix as u32), + self.span.ctxt(), + self.span.parent(), + ); + self.snippet = substr.to_string(); } } } +/// Given an original string like `AACC`, and a suggestion like `AABBCC`, try to detect +/// the case where a substring of the suggestion is "sandwiched" in the original, like +/// `BB` is. Return the length of the prefix, the "trimmed" suggestion, and the length +/// of the suffix. +fn as_substr<'a>(original: &'a str, suggestion: &'a str) -> Option<(usize, &'a str, usize)> { + let common_prefix = original + .chars() + .zip(suggestion.chars()) + .take_while(|(c1, c2)| c1 == c2) + .map(|(c, _)| c.len_utf8()) + .sum(); + let original = &original[common_prefix..]; + let suggestion = &suggestion[common_prefix..]; + if suggestion.ends_with(original) { + let common_suffix = original.len(); + Some((common_prefix, &suggestion[..suggestion.len() - original.len()], common_suffix)) + } else { + None + } +} + impl CodeSuggestion { /// Returns the assembled code suggestions, whether they should be shown with an underline /// and whether the substitution only differs in capitalization. @@ -380,7 +403,12 @@ impl CodeSuggestion { // or deleted code in order to point at the correct column *after* substitution. let mut acc = 0; let mut only_capitalization = false; - for part in &substitution.parts { + for part in &mut substitution.parts { + // If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the + // suggestion and snippet to look as if we just suggested to add + // `"b"`, which is typically much easier for the user to understand. + part.trim_trivial_replacements(sm); + only_capitalization |= is_case_difference(sm, &part.snippet, part.span); let cur_lo = sm.lookup_char_pos(part.span.lo()); if prev_hi.line == cur_lo.line { diff --git a/src/tools/clippy/tests/ui/async_yields_async.stderr b/src/tools/clippy/tests/ui/async_yields_async.stderr index 474914299d069..8c023d0d61f4a 100644 --- a/src/tools/clippy/tests/ui/async_yields_async.stderr +++ b/src/tools/clippy/tests/ui/async_yields_async.stderr @@ -14,9 +14,9 @@ LL | | }; = help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]` help: consider awaiting this value | -LL ~ async { -LL + 3 -LL + }.await +LL | async { +LL | 3 +LL ~ }.await | error: an async construct yields a type which is itself awaitable @@ -46,9 +46,9 @@ LL | | }; | help: consider awaiting this value | -LL ~ async { -LL + 3 -LL + }.await +LL | async { +LL | 3 +LL ~ }.await | error: an async construct yields a type which is itself awaitable diff --git a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr index 71f43af46c241..b8a0eedeb9ee8 100644 --- a/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr +++ b/src/tools/clippy/tests/ui/borrow_deref_ref_unfixable.stderr @@ -13,9 +13,8 @@ LL + let x: &str = s; | help: if you would like to deref, try using `&**` | -LL - let x: &str = &*s; -LL + let x: &str = &**s; - | +LL | let x: &str = &**s; + | + error: aborting due to 1 previous error diff --git a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr index c069c9d1672de..0238e3a91369b 100644 --- a/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr +++ b/src/tools/clippy/tests/ui/fn_to_numeric_cast_any.stderr @@ -8,9 +8,8 @@ LL | let _ = foo as i8; = help: to override `-D warnings` add `#[allow(clippy::fn_to_numeric_cast_any)]` help: did you mean to invoke the function? | -LL - let _ = foo as i8; -LL + let _ = foo() as i8; - | +LL | let _ = foo() as i8; + | ++ error: casting function pointer `foo` to `i16` --> tests/ui/fn_to_numeric_cast_any.rs:26:13 @@ -20,9 +19,8 @@ LL | let _ = foo as i16; | help: did you mean to invoke the function? | -LL - let _ = foo as i16; -LL + let _ = foo() as i16; - | +LL | let _ = foo() as i16; + | ++ error: casting function pointer `foo` to `i32` --> tests/ui/fn_to_numeric_cast_any.rs:28:13 @@ -32,9 +30,8 @@ LL | let _ = foo as i32; | help: did you mean to invoke the function? | -LL - let _ = foo as i32; -LL + let _ = foo() as i32; - | +LL | let _ = foo() as i32; + | ++ error: casting function pointer `foo` to `i64` --> tests/ui/fn_to_numeric_cast_any.rs:30:13 @@ -44,9 +41,8 @@ LL | let _ = foo as i64; | help: did you mean to invoke the function? | -LL - let _ = foo as i64; -LL + let _ = foo() as i64; - | +LL | let _ = foo() as i64; + | ++ error: casting function pointer `foo` to `i128` --> tests/ui/fn_to_numeric_cast_any.rs:32:13 @@ -56,9 +52,8 @@ LL | let _ = foo as i128; | help: did you mean to invoke the function? | -LL - let _ = foo as i128; -LL + let _ = foo() as i128; - | +LL | let _ = foo() as i128; + | ++ error: casting function pointer `foo` to `isize` --> tests/ui/fn_to_numeric_cast_any.rs:34:13 @@ -68,9 +63,8 @@ LL | let _ = foo as isize; | help: did you mean to invoke the function? | -LL - let _ = foo as isize; -LL + let _ = foo() as isize; - | +LL | let _ = foo() as isize; + | ++ error: casting function pointer `foo` to `u8` --> tests/ui/fn_to_numeric_cast_any.rs:37:13 @@ -80,9 +74,8 @@ LL | let _ = foo as u8; | help: did you mean to invoke the function? | -LL - let _ = foo as u8; -LL + let _ = foo() as u8; - | +LL | let _ = foo() as u8; + | ++ error: casting function pointer `foo` to `u16` --> tests/ui/fn_to_numeric_cast_any.rs:39:13 @@ -92,9 +85,8 @@ LL | let _ = foo as u16; | help: did you mean to invoke the function? | -LL - let _ = foo as u16; -LL + let _ = foo() as u16; - | +LL | let _ = foo() as u16; + | ++ error: casting function pointer `foo` to `u32` --> tests/ui/fn_to_numeric_cast_any.rs:41:13 @@ -104,9 +96,8 @@ LL | let _ = foo as u32; | help: did you mean to invoke the function? | -LL - let _ = foo as u32; -LL + let _ = foo() as u32; - | +LL | let _ = foo() as u32; + | ++ error: casting function pointer `foo` to `u64` --> tests/ui/fn_to_numeric_cast_any.rs:43:13 @@ -116,9 +107,8 @@ LL | let _ = foo as u64; | help: did you mean to invoke the function? | -LL - let _ = foo as u64; -LL + let _ = foo() as u64; - | +LL | let _ = foo() as u64; + | ++ error: casting function pointer `foo` to `u128` --> tests/ui/fn_to_numeric_cast_any.rs:45:13 @@ -128,9 +118,8 @@ LL | let _ = foo as u128; | help: did you mean to invoke the function? | -LL - let _ = foo as u128; -LL + let _ = foo() as u128; - | +LL | let _ = foo() as u128; + | ++ error: casting function pointer `foo` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:47:13 @@ -140,9 +129,8 @@ LL | let _ = foo as usize; | help: did you mean to invoke the function? | -LL - let _ = foo as usize; -LL + let _ = foo() as usize; - | +LL | let _ = foo() as usize; + | ++ error: casting function pointer `Struct::static_method` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:52:13 @@ -152,9 +140,8 @@ LL | let _ = Struct::static_method as usize; | help: did you mean to invoke the function? | -LL - let _ = Struct::static_method as usize; -LL + let _ = Struct::static_method() as usize; - | +LL | let _ = Struct::static_method() as usize; + | ++ error: casting function pointer `f` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:57:5 @@ -164,9 +151,8 @@ LL | f as usize | help: did you mean to invoke the function? | -LL - f as usize -LL + f() as usize - | +LL | f() as usize + | ++ error: casting function pointer `T::static_method` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:62:5 @@ -176,9 +162,8 @@ LL | T::static_method as usize | help: did you mean to invoke the function? | -LL - T::static_method as usize -LL + T::static_method() as usize - | +LL | T::static_method() as usize + | ++ error: casting function pointer `(clos as fn(u32) -> u32)` to `usize` --> tests/ui/fn_to_numeric_cast_any.rs:69:13 @@ -188,9 +173,8 @@ LL | let _ = (clos as fn(u32) -> u32) as usize; | help: did you mean to invoke the function? | -LL - let _ = (clos as fn(u32) -> u32) as usize; -LL + let _ = (clos as fn(u32) -> u32)() as usize; - | +LL | let _ = (clos as fn(u32) -> u32)() as usize; + | ++ error: casting function pointer `foo` to `*const ()` --> tests/ui/fn_to_numeric_cast_any.rs:74:13 @@ -200,9 +184,8 @@ LL | let _ = foo as *const (); | help: did you mean to invoke the function? | -LL - let _ = foo as *const (); -LL + let _ = foo() as *const (); - | +LL | let _ = foo() as *const (); + | ++ error: aborting due to 17 previous errors diff --git a/src/tools/clippy/tests/ui/implicit_hasher.stderr b/src/tools/clippy/tests/ui/implicit_hasher.stderr index 6e964c65a2e42..01d08a1bd9b2a 100644 --- a/src/tools/clippy/tests/ui/implicit_hasher.stderr +++ b/src/tools/clippy/tests/ui/implicit_hasher.stderr @@ -78,9 +78,8 @@ LL | pub fn map(map: &mut HashMap) {} | help: add a type parameter for `BuildHasher` | -LL - pub fn map(map: &mut HashMap) {} -LL + pub fn map(map: &mut HashMap) {} - | +LL | pub fn map(map: &mut HashMap) {} + | +++++++++++++++++++++++++++++ +++ error: parameter of type `HashSet` should be generalized over different hashers --> tests/ui/implicit_hasher.rs:70:22 @@ -90,9 +89,8 @@ LL | pub fn set(set: &mut HashSet) {} | help: add a type parameter for `BuildHasher` | -LL - pub fn set(set: &mut HashSet) {} -LL + pub fn set(set: &mut HashSet) {} - | +LL | pub fn set(set: &mut HashSet) {} + | +++++++++++++++++++++++++++++ +++ error: impl for `HashMap` should be generalized over different hashers --> tests/ui/implicit_hasher.rs:76:43 @@ -116,9 +114,8 @@ LL | pub async fn election_vote(_data: HashMap) {} | help: add a type parameter for `BuildHasher` | -LL - pub async fn election_vote(_data: HashMap) {} -LL + pub async fn election_vote(_data: HashMap) {} - | +LL | pub async fn election_vote(_data: HashMap) {} + | +++++++++++++++++++++++++++++ +++ error: aborting due to 9 previous errors diff --git a/src/tools/clippy/tests/ui/implicit_return.stderr b/src/tools/clippy/tests/ui/implicit_return.stderr index 7ea72307450c7..936a779fa747d 100644 --- a/src/tools/clippy/tests/ui/implicit_return.stderr +++ b/src/tools/clippy/tests/ui/implicit_return.stderr @@ -9,7 +9,7 @@ LL | true help: add `return` as shown | LL | return true - | + | ++++++ error: missing `return` statement --> tests/ui/implicit_return.rs:19:15 @@ -122,7 +122,7 @@ LL | format!("test {}", "test") help: add `return` as shown | LL | return format!("test {}", "test") - | + | ++++++ error: missing `return` statement --> tests/ui/implicit_return.rs:90:5 @@ -133,7 +133,7 @@ LL | m!(true, false) help: add `return` as shown | LL | return m!(true, false) - | + | ++++++ error: missing `return` statement --> tests/ui/implicit_return.rs:96:13 @@ -169,10 +169,8 @@ LL | | } | help: add `return` as shown | -LL ~ return loop { -LL + m!(true); -LL + } - | +LL | return loop { + | ++++++ error: missing `return` statement --> tests/ui/implicit_return.rs:130:5 @@ -183,7 +181,7 @@ LL | true help: add `return` as shown | LL | return true - | + | ++++++ error: aborting due to 16 previous errors diff --git a/src/tools/clippy/tests/ui/literals.stderr b/src/tools/clippy/tests/ui/literals.stderr index a9192825b3543..576b38a47d2de 100644 --- a/src/tools/clippy/tests/ui/literals.stderr +++ b/src/tools/clippy/tests/ui/literals.stderr @@ -99,9 +99,8 @@ LL + let fail8 = 123; | help: if you mean to use an octal constant, use `0o` | -LL - let fail8 = 0123; -LL + let fail8 = 0o123; - | +LL | let fail8 = 0o123; + | + error: integer type suffix should not be separated by an underscore --> tests/ui/literals.rs:48:16 diff --git a/src/tools/clippy/tests/ui/manual_flatten.stderr b/src/tools/clippy/tests/ui/manual_flatten.stderr index cf1b0a1c8bbf6..93f7f11b5e64c 100644 --- a/src/tools/clippy/tests/ui/manual_flatten.stderr +++ b/src/tools/clippy/tests/ui/manual_flatten.stderr @@ -196,11 +196,9 @@ LL | | } | |_________^ help: try | -LL ~ for n in vec![ -LL + -LL + Some(1), -LL + Some(2), -LL + Some(3) +LL | for n in vec![ +... +LL | Some(3) LL ~ ].iter().flatten() { | diff --git a/src/tools/clippy/tests/ui/octal_escapes.stderr b/src/tools/clippy/tests/ui/octal_escapes.stderr index c8a89ac8bea42..61c781e316ef3 100644 --- a/src/tools/clippy/tests/ui/octal_escapes.stderr +++ b/src/tools/clippy/tests/ui/octal_escapes.stderr @@ -14,9 +14,8 @@ LL + let _bad1 = "\x1b[0m"; | help: if a null escape is intended, disambiguate using | -LL - let _bad1 = "\033[0m"; -LL + let _bad1 = "\x0033[0m"; - | +LL | let _bad1 = "\x0033[0m"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:6:19 @@ -31,9 +30,8 @@ LL + let _bad2 = b"\x1b[0m"; | help: if a null escape is intended, disambiguate using | -LL - let _bad2 = b"\033[0m"; -LL + let _bad2 = b"\x0033[0m"; - | +LL | let _bad2 = b"\x0033[0m"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:7:20 @@ -48,9 +46,8 @@ LL + let _bad3 = "\\\x1b[0m"; | help: if a null escape is intended, disambiguate using | -LL - let _bad3 = "\\\033[0m"; -LL + let _bad3 = "\\\x0033[0m"; - | +LL | let _bad3 = "\\\x0033[0m"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:9:18 @@ -65,9 +62,8 @@ LL + let _bad4 = "\x0a34567"; | help: if a null escape is intended, disambiguate using | -LL - let _bad4 = "\01234567"; -LL + let _bad4 = "\x001234567"; - | +LL | let _bad4 = "\x001234567"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:10:20 @@ -77,14 +73,12 @@ LL | let _bad5 = "\0\03"; | help: if an octal escape is intended, use a hex escape instead | -LL - let _bad5 = "\0\03"; -LL + let _bad5 = "\0\x03"; - | +LL | let _bad5 = "\0\x03"; + | + help: if a null escape is intended, disambiguate using | -LL - let _bad5 = "\0\03"; -LL + let _bad5 = "\0\x0003"; - | +LL | let _bad5 = "\0\x0003"; + | +++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:11:23 @@ -99,9 +93,8 @@ LL + let _bad6 = "Text-\x2d\077-MoreText"; | help: if a null escape is intended, disambiguate using | -LL - let _bad6 = "Text-\055\077-MoreText"; -LL + let _bad6 = "Text-\x0055\077-MoreText"; - | +LL | let _bad6 = "Text-\x0055\077-MoreText"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:11:27 @@ -116,9 +109,8 @@ LL + let _bad6 = "Text-\055\x3f-MoreText"; | help: if a null escape is intended, disambiguate using | -LL - let _bad6 = "Text-\055\077-MoreText"; -LL + let _bad6 = "Text-\055\x0077-MoreText"; - | +LL | let _bad6 = "Text-\055\x0077-MoreText"; + | ++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:14:31 @@ -128,14 +120,12 @@ LL | let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; | help: if an octal escape is intended, use a hex escape instead | -LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; -LL + let _bad7 = "EvenMoreText-\x01\02-ShortEscapes"; - | +LL | let _bad7 = "EvenMoreText-\x01\02-ShortEscapes"; + | + help: if a null escape is intended, disambiguate using | -LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; -LL + let _bad7 = "EvenMoreText-\x0001\02-ShortEscapes"; - | +LL | let _bad7 = "EvenMoreText-\x0001\02-ShortEscapes"; + | +++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:14:34 @@ -145,14 +135,12 @@ LL | let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; | help: if an octal escape is intended, use a hex escape instead | -LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; -LL + let _bad7 = "EvenMoreText-\01\x02-ShortEscapes"; - | +LL | let _bad7 = "EvenMoreText-\01\x02-ShortEscapes"; + | + help: if a null escape is intended, disambiguate using | -LL - let _bad7 = "EvenMoreText-\01\02-ShortEscapes"; -LL + let _bad7 = "EvenMoreText-\01\x0002-ShortEscapes"; - | +LL | let _bad7 = "EvenMoreText-\01\x0002-ShortEscapes"; + | +++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:17:19 @@ -162,14 +150,12 @@ LL | let _bad8 = "锈\01锈"; | help: if an octal escape is intended, use a hex escape instead | -LL - let _bad8 = "锈\01锈"; -LL + let _bad8 = "锈\x01锈"; - | +LL | let _bad8 = "锈\x01锈"; + | + help: if a null escape is intended, disambiguate using | -LL - let _bad8 = "锈\01锈"; -LL + let _bad8 = "锈\x0001锈"; - | +LL | let _bad8 = "锈\x0001锈"; + | +++ error: octal-looking escape in a literal --> tests/ui/octal_escapes.rs:18:19 @@ -184,9 +170,8 @@ LL + let _bad9 = "锈\x09锈"; | help: if a null escape is intended, disambiguate using | -LL - let _bad9 = "锈\011锈"; -LL + let _bad9 = "锈\x0011锈"; - | +LL | let _bad9 = "锈\x0011锈"; + | ++ error: aborting due to 11 previous errors diff --git a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr index 74bbcfcca51e1..2c26565d5ef14 100644 --- a/src/tools/clippy/tests/ui/suspicious_to_owned.stderr +++ b/src/tools/clippy/tests/ui/suspicious_to_owned.stderr @@ -8,9 +8,8 @@ LL | let _ = cow.to_owned(); = help: to override `-D warnings` add `#[allow(clippy::suspicious_to_owned)]` help: depending on intent, either make the Cow an Owned variant | -LL - let _ = cow.to_owned(); -LL + let _ = cow.into_owned(); - | +LL | let _ = cow.into_owned(); + | ++ help: or clone the Cow itself | LL - let _ = cow.to_owned(); @@ -25,9 +24,8 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL - let _ = cow.to_owned(); -LL + let _ = cow.into_owned(); - | +LL | let _ = cow.into_owned(); + | ++ help: or clone the Cow itself | LL - let _ = cow.to_owned(); @@ -42,9 +40,8 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL - let _ = cow.to_owned(); -LL + let _ = cow.into_owned(); - | +LL | let _ = cow.into_owned(); + | ++ help: or clone the Cow itself | LL - let _ = cow.to_owned(); @@ -59,9 +56,8 @@ LL | let _ = cow.to_owned(); | help: depending on intent, either make the Cow an Owned variant | -LL - let _ = cow.to_owned(); -LL + let _ = cow.into_owned(); - | +LL | let _ = cow.into_owned(); + | ++ help: or clone the Cow itself | LL - let _ = cow.to_owned(); diff --git a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr index 6ef333f0cfd29..84a574017a9b7 100644 --- a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr +++ b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph-fix.stderr @@ -12,7 +12,7 @@ LL | | /// 200 characters so I needed to write something longeeeeeeer. = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]` help: add an empty line | -LL ~ /// A very short summary. +LL | /// A very short summary. LL + /// | diff --git a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr index 95f42349b9b35..8bc853132ec0b 100644 --- a/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr +++ b/src/tools/clippy/tests/ui/too_long_first_doc_paragraph.stderr @@ -12,8 +12,8 @@ LL | | //! 200 characters so I needed to write something longeeeeeeer. = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]` help: add an empty line | -LL ~ //! A very short summary. -LL + //! +LL | //! A very short summary. +LL ~ //! LL ~ //! A much longer explanation that goes into a lot more detail about | diff --git a/tests/ui/argument-suggestions/basic.stderr b/tests/ui/argument-suggestions/basic.stderr index 9a639d4b5e4ef..a71b6ab0e9949 100644 --- a/tests/ui/argument-suggestions/basic.stderr +++ b/tests/ui/argument-suggestions/basic.stderr @@ -42,9 +42,8 @@ LL | fn missing(_i: u32) {} | ^^^^^^^ ------- help: provide the argument | -LL - missing(); -LL + missing(/* u32 */); - | +LL | missing(/* u32 */); + | +++++++++ error[E0308]: arguments to this function are incorrect --> $DIR/basic.rs:23:5 @@ -98,9 +97,8 @@ LL | let closure = |x| x; | ^^^ help: provide the argument | -LL - closure(); -LL + closure(/* x */); - | +LL | closure(/* x */); + | +++++++ error: aborting due to 6 previous errors diff --git a/tests/ui/argument-suggestions/display-is-suggestable.stderr b/tests/ui/argument-suggestions/display-is-suggestable.stderr index bb5df1ec234cd..921cc12333870 100644 --- a/tests/ui/argument-suggestions/display-is-suggestable.stderr +++ b/tests/ui/argument-suggestions/display-is-suggestable.stderr @@ -11,9 +11,8 @@ LL | fn foo(x: &(dyn Display + Send)) {} | ^^^ ------------------------ help: provide the argument | -LL - foo(); -LL + foo(/* &dyn std::fmt::Display + Send */); - | +LL | foo(/* &dyn std::fmt::Display + Send */); + | +++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/extern-fn-arg-names.stderr b/tests/ui/argument-suggestions/extern-fn-arg-names.stderr index 62670316cd163..28500908e7ea3 100644 --- a/tests/ui/argument-suggestions/extern-fn-arg-names.stderr +++ b/tests/ui/argument-suggestions/extern-fn-arg-names.stderr @@ -17,9 +17,8 @@ LL | fn dstfn(src: i32, dst: err); | ^^^^^ --- help: provide the argument | -LL - dstfn(1); -LL + dstfn(1, /* dst */); - | +LL | dstfn(1, /* dst */); + | +++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/argument-suggestions/issue-97197.stderr b/tests/ui/argument-suggestions/issue-97197.stderr index acaf4f1510735..ae56e12c975f8 100644 --- a/tests/ui/argument-suggestions/issue-97197.stderr +++ b/tests/ui/argument-suggestions/issue-97197.stderr @@ -11,9 +11,8 @@ LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {} | ^ -------- -------- -------- -------- help: provide the arguments | -LL - g((), ()); -LL + g((), /* bool */, /* bool */, /* bool */, /* bool */, ()); - | +LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ()); + | +++++++++++++++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-98894.stderr b/tests/ui/argument-suggestions/issue-98894.stderr index 44353cb33388a..141355ff153bd 100644 --- a/tests/ui/argument-suggestions/issue-98894.stderr +++ b/tests/ui/argument-suggestions/issue-98894.stderr @@ -11,9 +11,8 @@ LL | (|_, ()| ())(if true {} else {return;}); | ^^^^^^^ help: provide the argument | -LL - (|_, ()| ())(if true {} else {return;}); -LL + (|_, ()| ())(if true {} else {return;}, ()); - | +LL | (|_, ()| ())(if true {} else {return;}, ()); + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-98897.stderr b/tests/ui/argument-suggestions/issue-98897.stderr index fd3ef467b1c39..a85e723368902 100644 --- a/tests/ui/argument-suggestions/issue-98897.stderr +++ b/tests/ui/argument-suggestions/issue-98897.stderr @@ -11,9 +11,8 @@ LL | (|_, ()| ())([return, ()]); | ^^^^^^^ help: provide the argument | -LL - (|_, ()| ())([return, ()]); -LL + (|_, ()| ())([return, ()], ()); - | +LL | (|_, ()| ())([return, ()], ()); + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/issue-99482.stderr b/tests/ui/argument-suggestions/issue-99482.stderr index b3c39604a99b0..972ab401958b0 100644 --- a/tests/ui/argument-suggestions/issue-99482.stderr +++ b/tests/ui/argument-suggestions/issue-99482.stderr @@ -11,9 +11,8 @@ LL | let f = |_: (), f: fn()| f; | ^^^^^^^^^^^^^^^^ help: provide the argument | -LL - let _f = f(main); -LL + let _f = f((), main); - | +LL | let _f = f((), main); + | +++ error: aborting due to 1 previous error diff --git a/tests/ui/argument-suggestions/missing_arguments.stderr b/tests/ui/argument-suggestions/missing_arguments.stderr index 264c485cbe1c3..9dc13c41113b6 100644 --- a/tests/ui/argument-suggestions/missing_arguments.stderr +++ b/tests/ui/argument-suggestions/missing_arguments.stderr @@ -11,9 +11,8 @@ LL | fn one_arg(_a: i32) {} | ^^^^^^^ ------- help: provide the argument | -LL - one_arg(); -LL + one_arg(/* i32 */); - | +LL | one_arg(/* i32 */); + | +++++++++ error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing_arguments.rs:14:3 diff --git a/tests/ui/associated-consts/associated-const-ambiguity-report.stderr b/tests/ui/associated-consts/associated-const-ambiguity-report.stderr index e68ba503c5059..041c9b485f0a3 100644 --- a/tests/ui/associated-consts/associated-const-ambiguity-report.stderr +++ b/tests/ui/associated-consts/associated-const-ambiguity-report.stderr @@ -16,12 +16,10 @@ LL | const ID: i32 = 1; | ^^^^^^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL - const X: i32 = ::ID; -LL + const X: i32 = ::ID; - | -LL - const X: i32 = ::ID; -LL + const X: i32 = ::ID; - | +LL | const X: i32 = ::ID; + | ++++++ +LL | const X: i32 = ::ID; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/associated-inherent-types/issue-109768.stderr b/tests/ui/associated-inherent-types/issue-109768.stderr index 18455f4669e91..59f8526a73e59 100644 --- a/tests/ui/associated-inherent-types/issue-109768.stderr +++ b/tests/ui/associated-inherent-types/issue-109768.stderr @@ -43,9 +43,8 @@ LL | struct Wrapper(T); | ^^^^^^^ help: provide the argument | -LL - const WRAPPED_ASSOC_3: Wrapper = Wrapper(); -LL + const WRAPPED_ASSOC_3: Wrapper = Wrapper(/* value */); - | +LL | const WRAPPED_ASSOC_3: Wrapper = Wrapper(/* value */); + | +++++++++++ error: aborting due to 4 previous errors diff --git a/tests/ui/associated-item/associated-item-enum.stderr b/tests/ui/associated-item/associated-item-enum.stderr index 49f168b854407..c3ce7c34d0569 100644 --- a/tests/ui/associated-item/associated-item-enum.stderr +++ b/tests/ui/associated-item/associated-item-enum.stderr @@ -9,9 +9,8 @@ LL | Enum::mispellable(); | help: there is an associated function `misspellable` with a similar name | -LL - Enum::mispellable(); -LL + Enum::misspellable(); - | +LL | Enum::misspellable(); + | + error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:18:11 @@ -24,9 +23,8 @@ LL | Enum::mispellable_trait(); | help: there is an associated function `misspellable_trait` with a similar name | -LL - Enum::mispellable_trait(); -LL + Enum::misspellable_trait(); - | +LL | Enum::misspellable_trait(); + | + error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope --> $DIR/associated-item-enum.rs:19:11 @@ -39,9 +37,8 @@ LL | Enum::MISPELLABLE; | help: there is an associated constant `MISSPELLABLE` with a similar name | -LL - Enum::MISPELLABLE; -LL + Enum::MISSPELLABLE; - | +LL | Enum::MISSPELLABLE; + | + error: aborting due to 3 previous errors diff --git a/tests/ui/binop/placement-syntax.stderr b/tests/ui/binop/placement-syntax.stderr index e398c0b0702ab..c07ee7184c775 100644 --- a/tests/ui/binop/placement-syntax.stderr +++ b/tests/ui/binop/placement-syntax.stderr @@ -6,9 +6,8 @@ LL | if x<-1 { | help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` | -LL - if x<-1 { -LL + if x< -1 { - | +LL | if x< -1 { + | + error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr b/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr index d953ed2ad3ef0..5cc5b87cd44b7 100644 --- a/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr +++ b/tests/ui/borrowck/borrowck-struct-update-with-dtor.stderr @@ -116,9 +116,8 @@ LL | let _s2 = T { ..s0 }; | help: clone the value from the field instead of using the functional record update syntax | -LL - let _s2 = T { ..s0 }; -LL + let _s2 = T { b: s0.b.clone(), ..s0 }; - | +LL | let _s2 = T { b: s0.b.clone(), ..s0 }; + | ++++++++++++++++ error[E0509]: cannot move out of type `T`, which implements the `Drop` trait --> $DIR/borrowck-struct-update-with-dtor.rs:47:32 diff --git a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr index 1e3570fc85570..a392177ffe2f3 100644 --- a/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr +++ b/tests/ui/borrowck/borrowck-unsafe-static-mutable-borrows.stderr @@ -9,9 +9,8 @@ LL | let sfoo: *mut Foo = &mut SFOO; = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer | -LL - let sfoo: *mut Foo = &mut SFOO; -LL + let sfoo: *mut Foo = &raw mut SFOO; - | +LL | let sfoo: *mut Foo = &raw mut SFOO; + | +++ warning: 1 warning emitted diff --git a/tests/ui/borrowck/issue-85765-closure.stderr b/tests/ui/borrowck/issue-85765-closure.stderr index fa4e544150877..cd2544ec5c952 100644 --- a/tests/ui/borrowck/issue-85765-closure.stderr +++ b/tests/ui/borrowck/issue-85765-closure.stderr @@ -6,9 +6,8 @@ LL | rofl.push(Vec::new()); | help: consider changing this binding's type | -LL - let rofl: &Vec> = &mut test; -LL + let rofl: &mut Vec> = &mut test; - | +LL | let rofl: &mut Vec> = &mut test; + | +++ error[E0594]: cannot assign to `*r`, which is behind a `&` reference --> $DIR/issue-85765-closure.rs:13:9 @@ -29,9 +28,8 @@ LL | *x = 1; | help: consider changing this binding's type | -LL - let x: &usize = &mut{0}; -LL + let x: &mut usize = &mut{0}; - | +LL | let x: &mut usize = &mut{0}; + | +++ error[E0594]: cannot assign to `*y`, which is behind a `&` reference --> $DIR/issue-85765-closure.rs:27:9 @@ -41,9 +39,8 @@ LL | *y = 1; | help: consider changing this binding's type | -LL - let y: &usize = &mut(0); -LL + let y: &mut usize = &mut(0); - | +LL | let y: &mut usize = &mut(0); + | +++ error: aborting due to 4 previous errors diff --git a/tests/ui/borrowck/issue-85765.stderr b/tests/ui/borrowck/issue-85765.stderr index 9354294f52b21..e252f3d44d976 100644 --- a/tests/ui/borrowck/issue-85765.stderr +++ b/tests/ui/borrowck/issue-85765.stderr @@ -6,9 +6,8 @@ LL | rofl.push(Vec::new()); | help: consider changing this binding's type | -LL - let rofl: &Vec> = &mut test; -LL + let rofl: &mut Vec> = &mut test; - | +LL | let rofl: &mut Vec> = &mut test; + | +++ error[E0594]: cannot assign to `*r`, which is behind a `&` reference --> $DIR/issue-85765.rs:12:5 @@ -29,9 +28,8 @@ LL | *x = 1; | help: consider changing this binding's type | -LL - let x: &usize = &mut{0}; -LL + let x: &mut usize = &mut{0}; - | +LL | let x: &mut usize = &mut{0}; + | +++ error[E0594]: cannot assign to `*y`, which is behind a `&` reference --> $DIR/issue-85765.rs:26:5 @@ -41,9 +39,8 @@ LL | *y = 1; | help: consider changing this binding's type | -LL - let y: &usize = &mut(0); -LL + let y: &mut usize = &mut(0); - | +LL | let y: &mut usize = &mut(0); + | +++ error: aborting due to 4 previous errors diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr index 061eae9729e2e..39dfb2548a3bb 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.stderr +++ b/tests/ui/c-variadic/variadic-ffi-1.stderr @@ -17,9 +17,8 @@ LL | fn foo(f: isize, x: u8, ...); | ^^^ - - help: provide the arguments | -LL - foo(); -LL + foo(/* isize */, /* u8 */); - | +LL | foo(/* isize */, /* u8 */); + | +++++++++++++++++++++ error[E0060]: this function takes at least 2 arguments but 1 argument was supplied --> $DIR/variadic-ffi-1.rs:23:9 @@ -34,9 +33,8 @@ LL | fn foo(f: isize, x: u8, ...); | ^^^ - help: provide the argument | -LL - foo(1); -LL + foo(1, /* u8 */); - | +LL | foo(1, /* u8 */); + | ++++++++++ error[E0308]: mismatched types --> $DIR/variadic-ffi-1.rs:25:56 diff --git a/tests/ui/cast/ice-cast-type-with-error-124848.stderr b/tests/ui/cast/ice-cast-type-with-error-124848.stderr index 402ee27386ddd..0b2ab1dfc4c17 100644 --- a/tests/ui/cast/ice-cast-type-with-error-124848.stderr +++ b/tests/ui/cast/ice-cast-type-with-error-124848.stderr @@ -48,9 +48,8 @@ LL | struct MyType<'a>(Cell>>, Pin); | ^^^^^^ help: provide the argument | -LL - let mut unpinned = MyType(Cell::new(None)); -LL + let mut unpinned = MyType(Cell::new(None), /* value */); - | +LL | let mut unpinned = MyType(Cell::new(None), /* value */); + | +++++++++++++ error[E0606]: casting `&MyType<'_>` as `*const Cell>>` is invalid --> $DIR/ice-cast-type-with-error-124848.rs:14:20 diff --git a/tests/ui/conditional-compilation/cfg-attr-parse.stderr b/tests/ui/conditional-compilation/cfg-attr-parse.stderr index 1605761e59195..76f199caace37 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parse.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-parse.stderr @@ -7,9 +7,8 @@ LL | #[cfg_attr()] = note: for more information, visit help: missing condition and attribute | -LL - #[cfg_attr()] -LL + #[cfg_attr(condition, attribute, other_attribute, ...)] - | +LL | #[cfg_attr(condition, attribute, other_attribute, ...)] + | ++++++++++++++++++++++++++++++++++++++++++ error: expected `,`, found end of `cfg_attr` input --> $DIR/cfg-attr-parse.rs:8:17 diff --git a/tests/ui/consts/const_let_assign2.stderr b/tests/ui/consts/const_let_assign2.stderr index be0ffefc80dee..0d76f142d174d 100644 --- a/tests/ui/consts/const_let_assign2.stderr +++ b/tests/ui/consts/const_let_assign2.stderr @@ -9,9 +9,8 @@ LL | let ptr = unsafe { &mut BB }; = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer | -LL - let ptr = unsafe { &mut BB }; -LL + let ptr = unsafe { &raw mut BB }; - | +LL | let ptr = unsafe { &raw mut BB }; + | +++ warning: 1 warning emitted diff --git a/tests/ui/coroutine/issue-102645.stderr b/tests/ui/coroutine/issue-102645.stderr index bec0518d8c602..be16674668ead 100644 --- a/tests/ui/coroutine/issue-102645.stderr +++ b/tests/ui/coroutine/issue-102645.stderr @@ -8,9 +8,8 @@ note: method defined here --> $SRC_DIR/core/src/ops/coroutine.rs:LL:COL help: provide the argument | -LL - Pin::new(&mut b).resume(); -LL + Pin::new(&mut b).resume(()); - | +LL | Pin::new(&mut b).resume(()); + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/coroutine/resume-arg-outlives.stderr b/tests/ui/coroutine/resume-arg-outlives.stderr index 0150009c8fa23..045c77e8d054c 100644 --- a/tests/ui/coroutine/resume-arg-outlives.stderr +++ b/tests/ui/coroutine/resume-arg-outlives.stderr @@ -9,9 +9,8 @@ LL | generator | help: consider changing `impl Coroutine<&'not_static str> + 'static`'s explicit `'static` bound to the lifetime of argument `s` | -LL - fn demo<'not_static>(s: &'not_static str) -> Pin + 'static>> { -LL + fn demo<'not_static>(s: &'not_static str) -> Pin + 'not_static>> { - | +LL | fn demo<'not_static>(s: &'not_static str) -> Pin + 'not_static>> { + | ++++ help: alternatively, add an explicit `'static` bound to this reference | LL - fn demo<'not_static>(s: &'not_static str) -> Pin + 'static>> { diff --git a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr index a8a70e363b7e6..dc84394fe3c0c 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr @@ -6,12 +6,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: aborting due to 1 previous error diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr index 6443fafef3e41..49b8974bfdfb8 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr @@ -6,12 +6,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error[E0658]: the `#[coverage]` attribute is an experimental feature --> $DIR/bad-attr-ice.rs:11:1 diff --git a/tests/ui/coverage-attr/bad-syntax.stderr b/tests/ui/coverage-attr/bad-syntax.stderr index 3123066e7bf97..fa500b542097d 100644 --- a/tests/ui/coverage-attr/bad-syntax.stderr +++ b/tests/ui/coverage-attr/bad-syntax.stderr @@ -6,12 +6,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:20:1 @@ -36,12 +34,10 @@ LL | #[coverage()] | help: the following are the possible correct uses | -LL - #[coverage()] -LL + #[coverage(off)] - | -LL - #[coverage()] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++ +LL | #[coverage(on)] + | ++ error: malformed `coverage` attribute input --> $DIR/bad-syntax.rs:26:1 diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index c034149d8ec92..612301885dcc8 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -6,12 +6,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:17:5 @@ -21,12 +19,10 @@ LL | #![coverage] | help: the following are the possible correct uses | -LL - #![coverage] -LL + #![coverage(off)] - | -LL - #![coverage] -LL + #![coverage(on)] - | +LL | #![coverage(off)] + | +++++ +LL | #![coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:21:1 @@ -36,12 +32,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:29:5 @@ -51,12 +45,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:26:1 @@ -66,12 +58,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:39:5 @@ -81,12 +71,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:44:5 @@ -96,12 +84,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:35:1 @@ -111,12 +97,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:53:5 @@ -126,12 +110,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:58:5 @@ -141,12 +123,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:50:1 @@ -156,12 +136,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error: malformed `coverage` attribute input --> $DIR/word-only.rs:64:1 @@ -171,12 +149,10 @@ LL | #[coverage] | help: the following are the possible correct uses | -LL - #[coverage] -LL + #[coverage(off)] - | -LL - #[coverage] -LL + #[coverage(on)] - | +LL | #[coverage(off)] + | +++++ +LL | #[coverage(on)] + | ++++ error[E0788]: coverage attribute not allowed here --> $DIR/word-only.rs:21:1 diff --git a/tests/ui/destructuring-assignment/struct_destructure_fail.stderr b/tests/ui/destructuring-assignment/struct_destructure_fail.stderr index 7efc0b20e54be..2d02e33b2586b 100644 --- a/tests/ui/destructuring-assignment/struct_destructure_fail.stderr +++ b/tests/ui/destructuring-assignment/struct_destructure_fail.stderr @@ -31,9 +31,8 @@ LL + Struct { a, b } = Struct { a: 1, b: 2 }; | help: if you don't care about this missing field, you can explicitly ignore it | -LL - Struct { a, _ } = Struct { a: 1, b: 2 }; -LL + Struct { a, b: _ } = Struct { a: 1, b: 2 }; - | +LL | Struct { a, b: _ } = Struct { a: 1, b: 2 }; + | ++ help: or always ignore missing fields here | LL - Struct { a, _ } = Struct { a: 1, b: 2 }; diff --git a/tests/ui/diagnostic_namespace/suggest_typos.stderr b/tests/ui/diagnostic_namespace/suggest_typos.stderr index f41e2f6555675..86d778c6ec05b 100644 --- a/tests/ui/diagnostic_namespace/suggest_typos.stderr +++ b/tests/ui/diagnostic_namespace/suggest_typos.stderr @@ -11,9 +11,8 @@ LL | #![deny(unknown_or_malformed_diagnostic_attributes)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: an attribute with a similar name exists | -LL - #[diagnostic::onunimplemented] -LL + #[diagnostic::on_unimplemented] - | +LL | #[diagnostic::on_unimplemented] + | + error: unknown diagnostic attribute --> $DIR/suggest_typos.rs:9:15 @@ -35,9 +34,8 @@ LL | #[diagnostic::on_implemented] | help: an attribute with a similar name exists | -LL - #[diagnostic::on_implemented] -LL + #[diagnostic::on_unimplemented] - | +LL | #[diagnostic::on_unimplemented] + | ++ error: aborting due to 3 previous errors diff --git a/tests/ui/error-codes/E0027.stderr b/tests/ui/error-codes/E0027.stderr index 3a1ebf2971946..72f20a845567b 100644 --- a/tests/ui/error-codes/E0027.stderr +++ b/tests/ui/error-codes/E0027.stderr @@ -25,19 +25,16 @@ LL | Dog { name: x, } => {} | help: include the missing field in the pattern | -LL - Dog { name: x, } => {} -LL + Dog { name: x, age } => {} - | +LL | Dog { name: x, age } => {} + | +++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - Dog { name: x, } => {} -LL + Dog { name: x, age: _ } => {} - | +LL | Dog { name: x, age: _ } => {} + | ++++++ help: or always ignore missing fields here | -LL - Dog { name: x, } => {} -LL + Dog { name: x, .. } => {} - | +LL | Dog { name: x, .. } => {} + | ++ error[E0027]: pattern does not mention field `age` --> $DIR/E0027.rs:19:9 @@ -47,19 +44,16 @@ LL | Dog { name: x , } => {} | help: include the missing field in the pattern | -LL - Dog { name: x , } => {} -LL + Dog { name: x, age } => {} - | +LL | Dog { name: x, age } => {} + | ~~~~~~~ help: if you don't care about this missing field, you can explicitly ignore it | -LL - Dog { name: x , } => {} -LL + Dog { name: x, age: _ } => {} - | +LL | Dog { name: x, age: _ } => {} + | ~~~~~~~~~~ help: or always ignore missing fields here | -LL - Dog { name: x , } => {} -LL + Dog { name: x, .. } => {} - | +LL | Dog { name: x, .. } => {} + | ~~~~~~ error[E0027]: pattern does not mention fields `name`, `age` --> $DIR/E0027.rs:22:9 @@ -69,19 +63,16 @@ LL | Dog {} => {} | help: include the missing fields in the pattern | -LL - Dog {} => {} -LL + Dog { name, age } => {} - | +LL | Dog { name, age } => {} + | +++++++++ help: if you don't care about these missing fields, you can explicitly ignore them | -LL - Dog {} => {} -LL + Dog { name: _, age: _ } => {} - | +LL | Dog { name: _, age: _ } => {} + | +++++++++++++++ help: or always ignore missing fields here | -LL - Dog {} => {} -LL + Dog { .. } => {} - | +LL | Dog { .. } => {} + | ++ error: aborting due to 4 previous errors diff --git a/tests/ui/error-codes/E0057.stderr b/tests/ui/error-codes/E0057.stderr index 35bd842b2cf4c..26c9689b9c58e 100644 --- a/tests/ui/error-codes/E0057.stderr +++ b/tests/ui/error-codes/E0057.stderr @@ -11,9 +11,8 @@ LL | let f = |x| x * 3; | ^^^ help: provide the argument | -LL - let a = f(); -LL + let a = f(/* x */); - | +LL | let a = f(/* x */); + | +++++++ error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/E0057.rs:5:13 diff --git a/tests/ui/error-codes/E0060.stderr b/tests/ui/error-codes/E0060.stderr index fc52c6fc5ea50..7065b623ad325 100644 --- a/tests/ui/error-codes/E0060.stderr +++ b/tests/ui/error-codes/E0060.stderr @@ -11,9 +11,8 @@ LL | fn printf(_: *const u8, ...) -> u32; | ^^^^^^ - help: provide the argument | -LL - unsafe { printf(); } -LL + unsafe { printf(/* *const u8 */); } - | +LL | unsafe { printf(/* *const u8 */); } + | +++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0061.stderr b/tests/ui/error-codes/E0061.stderr index b70d607ebeb64..cab72a984a6b0 100644 --- a/tests/ui/error-codes/E0061.stderr +++ b/tests/ui/error-codes/E0061.stderr @@ -11,9 +11,8 @@ LL | fn f(a: u16, b: &str) {} | ^ ------- help: provide the argument | -LL - f(0); -LL + f(0, /* &str */); - | +LL | f(0, /* &str */); + | ++++++++++++ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/E0061.rs:9:5 @@ -28,9 +27,8 @@ LL | fn f2(a: u16) {} | ^^ ------ help: provide the argument | -LL - f2(); -LL + f2(/* u16 */); - | +LL | f2(/* u16 */); + | +++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0259.stderr b/tests/ui/error-codes/E0259.stderr index 08d3deb68d233..1833fe90f3d5c 100644 --- a/tests/ui/error-codes/E0259.stderr +++ b/tests/ui/error-codes/E0259.stderr @@ -10,9 +10,8 @@ LL | extern crate test as alloc; = note: `alloc` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate test as alloc; -LL + extern crate test as other_alloc; - | +LL | extern crate test as other_alloc; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0260.stderr b/tests/ui/error-codes/E0260.stderr index cb47b77904a38..10811d1f31871 100644 --- a/tests/ui/error-codes/E0260.stderr +++ b/tests/ui/error-codes/E0260.stderr @@ -10,9 +10,8 @@ LL | mod alloc { = note: `alloc` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate alloc; -LL + extern crate alloc as other_alloc; - | +LL | extern crate alloc as other_alloc; + | ++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr index 54bde98b57f9f..d9acdbea3fc02 100644 --- a/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr +++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr @@ -12,11 +12,8 @@ LL | | )) {} = note: `#[warn(anonymous_parameters)]` on by default help: try naming the parameter or explicitly ignoring it | -LL ~ fn test(x: u32, _: ( -LL + -LL + -LL ~ )) {} - | +LL | fn test(x: u32, _: ( + | ++ warning: 1 warning emitted diff --git a/tests/ui/extern/extern-crate-rename.stderr b/tests/ui/extern/extern-crate-rename.stderr index 4d4a585de60c1..88b78a07485d4 100644 --- a/tests/ui/extern/extern-crate-rename.stderr +++ b/tests/ui/extern/extern-crate-rename.stderr @@ -9,9 +9,8 @@ LL | extern crate m2 as m1; = note: `m1` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate m2 as m1; -LL + extern crate m2 as other_m1; - | +LL | extern crate m2 as other_m1; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr index 214725b77c049..7768c25bd2c37 100644 --- a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr +++ b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr @@ -165,9 +165,8 @@ LL | extern "rust-call" fn call_mut(&self, args: ()) -> () {} found signature `extern "rust-call" fn(&Bar, ()) -> ()` help: change the self-receiver type to match the trait | -LL - extern "rust-call" fn call_mut(&self, args: ()) -> () {} -LL + extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} - | +LL | extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} + | +++ error[E0046]: not all trait items implemented, missing: `Output` --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:35:1 diff --git a/tests/ui/fmt/no-inline-literals-out-of-range.stderr b/tests/ui/fmt/no-inline-literals-out-of-range.stderr index e17023887046f..0800fb2497619 100644 --- a/tests/ui/fmt/no-inline-literals-out-of-range.stderr +++ b/tests/ui/fmt/no-inline-literals-out-of-range.stderr @@ -13,9 +13,8 @@ LL + format_args!("{}", 0x8f_u8); // issue #115423 | help: to use as a negative number (decimal `-113`), consider using the type `u8` for the literal and cast it to `i8` | -LL - format_args!("{}", 0x8f_i8); // issue #115423 -LL + format_args!("{}", 0x8f_u8 as i8); // issue #115423 - | +LL | format_args!("{}", 0x8f_u8 as i8); // issue #115423 + | +++++ error: literal out of range for `u8` --> $DIR/no-inline-literals-out-of-range.rs:6:24 diff --git a/tests/ui/fn/issue-3044.stderr b/tests/ui/fn/issue-3044.stderr index 8351818dc897c..787eeec09cc2f 100644 --- a/tests/ui/fn/issue-3044.stderr +++ b/tests/ui/fn/issue-3044.stderr @@ -11,8 +11,8 @@ note: method defined here --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL help: provide the argument | -LL ~ needlesArr.iter().fold(|x, y| { -LL + +LL | needlesArr.iter().fold(|x, y| { +LL | LL ~ }, /* f */); | diff --git a/tests/ui/fn/param-mismatch-foreign.stderr b/tests/ui/fn/param-mismatch-foreign.stderr index 88aa3cd036833..835e0a3343e9a 100644 --- a/tests/ui/fn/param-mismatch-foreign.stderr +++ b/tests/ui/fn/param-mismatch-foreign.stderr @@ -11,9 +11,8 @@ LL | fn foo(x: i32, y: u32, z: i32); | ^^^ - help: provide the argument | -LL - foo(1i32, 2i32); -LL + foo(1i32, /* u32 */, 2i32); - | +LL | foo(1i32, /* u32 */, 2i32); + | ++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr index 4f9fc0ac6492c..9f94b3aff8821 100644 --- a/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr +++ b/tests/ui/higher-ranked/trait-bounds/issue-58451.stderr @@ -11,9 +11,8 @@ LL | fn f(i: I) | ^ ---- help: provide the argument | -LL - f(&[f()]); -LL + f(&[f(/* i */)]); - | +LL | f(&[f(/* i */)]); + | +++++++ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr b/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr index b7797317ea68f..7c064cc717699 100644 --- a/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr +++ b/tests/ui/impl-trait/in-trait/expeced-refree-to-map-to-reearlybound-ice-108580.stderr @@ -12,9 +12,8 @@ LL | fn bar(&self) -> impl Iterator + '_ { = note: `#[warn(refining_impl_trait_internal)]` on by default help: replace the return type so that it matches the trait | -LL - fn bar(&self) -> impl Iterator + '_ { -LL + fn bar(&self) -> impl Iterator + '_ { - | +LL | fn bar(&self) -> impl Iterator + '_ { + | +++++++++++++++++++ warning: 1 warning emitted diff --git a/tests/ui/impl-trait/in-trait/refine-captures.stderr b/tests/ui/impl-trait/in-trait/refine-captures.stderr index 8a5c8d3c77b0f..166991894d166 100644 --- a/tests/ui/impl-trait/in-trait/refine-captures.stderr +++ b/tests/ui/impl-trait/in-trait/refine-captures.stderr @@ -9,9 +9,8 @@ LL | fn test() -> impl Sized + use<> {} = note: `#[warn(refining_impl_trait_internal)]` on by default help: modify the `use<..>` bound to capture the same lifetimes that the trait does | -LL - fn test() -> impl Sized + use<> {} -LL + fn test() -> impl Sized + use<'a> {} - | +LL | fn test() -> impl Sized + use<'a> {} + | ++ warning: impl trait in impl method captures fewer lifetimes than in trait --> $DIR/refine-captures.rs:22:31 @@ -23,9 +22,8 @@ LL | fn test() -> impl Sized + use<> {} = note: we are soliciting feedback, see issue #121718 for more information help: modify the `use<..>` bound to capture the same lifetimes that the trait does | -LL - fn test() -> impl Sized + use<> {} -LL + fn test() -> impl Sized + use<'a> {} - | +LL | fn test() -> impl Sized + use<'a> {} + | ++ warning: impl trait in impl method captures fewer lifetimes than in trait --> $DIR/refine-captures.rs:27:31 @@ -37,9 +35,8 @@ LL | fn test() -> impl Sized + use<'b> {} = note: we are soliciting feedback, see issue #121718 for more information help: modify the `use<..>` bound to capture the same lifetimes that the trait does | -LL - fn test() -> impl Sized + use<'b> {} -LL + fn test() -> impl Sized + use<'a, 'b> {} - | +LL | fn test() -> impl Sized + use<'a, 'b> {} + | ++++ error: `impl Trait` must mention all type parameters in scope in `use<...>` --> $DIR/refine-captures.rs:32:18 diff --git a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr index 46561b66c8ee1..ba7d7770e5038 100644 --- a/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr +++ b/tests/ui/impl-trait/must_outlive_least_region_or_bound.stderr @@ -41,9 +41,8 @@ LL + fn elided2(x: &i32) -> impl Copy + '_ { x } | help: alternatively, add an explicit `'static` bound to this reference | -LL - fn elided2(x: &i32) -> impl Copy + 'static { x } -LL + fn elided2(x: &'static i32) -> impl Copy + 'static { x } - | +LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x } + | +++++++ error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:12:55 @@ -172,9 +171,8 @@ LL + fn elided4(x: &i32) -> Box { Box::new(x) } | help: alternatively, add an explicit `'static` bound to this reference | -LL - fn elided4(x: &i32) -> Box { Box::new(x) } -LL + fn elided4(x: &'static i32) -> Box { Box::new(x) } - | +LL | fn elided4(x: &'static i32) -> Box { Box::new(x) } + | +++++++ error: lifetime may not live long enough --> $DIR/must_outlive_least_region_or_bound.rs:27:60 diff --git a/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr b/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr index 9a3ebfddc49c5..ec700cf7e5900 100644 --- a/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr +++ b/tests/ui/imports/extern-crate-self/extern-crate-self-fail.stderr @@ -6,9 +6,8 @@ LL | extern crate self; | help: rename the `self` crate to be able to import it | -LL - extern crate self; -LL + extern crate self as name; - | +LL | extern crate self as name; + | +++++++ error: `#[macro_use]` is not supported on `extern crate self` --> $DIR/extern-crate-self-fail.rs:3:1 diff --git a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr index def0676a0f82c..2621f913186ee 100644 --- a/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr +++ b/tests/ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr @@ -7,9 +7,8 @@ LL | extern crate std; = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate std; -LL + extern crate std as other_std; - | +LL | extern crate std as other_std; + | ++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/import-self.stderr b/tests/ui/imports/issue-45829/import-self.stderr index b392d93c15410..5094a50635d53 100644 --- a/tests/ui/imports/issue-45829/import-self.stderr +++ b/tests/ui/imports/issue-45829/import-self.stderr @@ -62,9 +62,8 @@ LL | use foo::{self as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use foo::{self as A}; -LL + use foo::{self as OtherA}; - | +LL | use foo::{self as OtherA}; + | +++++ error: aborting due to 5 previous errors diff --git a/tests/ui/imports/issue-45829/issue-45829.stderr b/tests/ui/imports/issue-45829/issue-45829.stderr index 9fd0e5a767295..618fac350f023 100644 --- a/tests/ui/imports/issue-45829/issue-45829.stderr +++ b/tests/ui/imports/issue-45829/issue-45829.stderr @@ -9,9 +9,8 @@ LL | use foo::{A, B as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use foo::{A, B as A}; -LL + use foo::{A, B as OtherA}; - | +LL | use foo::{A, B as OtherA}; + | +++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr index 98fe16824ff76..f33b093725f06 100644 --- a/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr +++ b/tests/ui/imports/issue-45829/rename-extern-vs-use.stderr @@ -9,9 +9,8 @@ LL | extern crate issue_45829_b as bar; = note: `bar` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate issue_45829_b as bar; -LL + extern crate issue_45829_b as other_bar; - | +LL | extern crate issue_45829_b as other_bar; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-extern.stderr b/tests/ui/imports/issue-45829/rename-extern.stderr index f99f433c64241..2a3a05d1e7b48 100644 --- a/tests/ui/imports/issue-45829/rename-extern.stderr +++ b/tests/ui/imports/issue-45829/rename-extern.stderr @@ -9,9 +9,8 @@ LL | extern crate issue_45829_b as issue_45829_a; = note: `issue_45829_a` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate issue_45829_b as issue_45829_a; -LL + extern crate issue_45829_b as other_issue_45829_a; - | +LL | extern crate issue_45829_b as other_issue_45829_a; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr b/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr index e0647cd3ab68b..399de74a5919c 100644 --- a/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr +++ b/tests/ui/imports/issue-45829/rename-use-vs-extern.stderr @@ -9,9 +9,8 @@ LL | use std as issue_45829_b; = note: `issue_45829_b` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use std as issue_45829_b; -LL + use std as other_issue_45829_b; - | +LL | use std as other_issue_45829_b; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename-with-path.stderr b/tests/ui/imports/issue-45829/rename-with-path.stderr index 45fdd46850e04..fc30eb1cf8d7e 100644 --- a/tests/ui/imports/issue-45829/rename-with-path.stderr +++ b/tests/ui/imports/issue-45829/rename-with-path.stderr @@ -9,9 +9,8 @@ LL | use std::{collections::HashMap as A, sync::Arc as A}; = note: `A` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use std::{collections::HashMap as A, sync::Arc as A}; -LL + use std::{collections::HashMap as A, sync::Arc as OtherA}; - | +LL | use std::{collections::HashMap as A, sync::Arc as OtherA}; + | +++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/issue-45829/rename.stderr b/tests/ui/imports/issue-45829/rename.stderr index dc5775e3d56d2..a17dc6964dada 100644 --- a/tests/ui/imports/issue-45829/rename.stderr +++ b/tests/ui/imports/issue-45829/rename.stderr @@ -9,9 +9,8 @@ LL | use std as core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use std as core; -LL + use std as other_core; - | +LL | use std as other_core; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr index 4a5c85479d33d..bc9755732813c 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr +++ b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.stderr @@ -14,9 +14,8 @@ LL | m!(); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) help: you can use `as` to change the binding name of the import | -LL - extern crate std as core; -LL + extern crate std as other_core; - | +LL | extern crate std as other_core; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr b/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr index 8b87ae93b4d5e..f1b60bbe39d5b 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr +++ b/tests/ui/imports/multiple-extern-by-macro-for-custom.stderr @@ -14,9 +14,8 @@ LL | m!(); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) help: you can use `as` to change the binding name of the import | -LL - extern crate std as empty; -LL + extern crate std as other_empty; - | +LL | extern crate std as other_empty; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr b/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr index 9a9e538740d7b..13e1aaacd7025 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr +++ b/tests/ui/imports/multiple-extern-by-macro-for-inexist.stderr @@ -20,9 +20,8 @@ LL | m!(); = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) help: you can use `as` to change the binding name of the import | -LL - extern crate std as non_existent; -LL + extern crate std as other_non_existent; - | +LL | extern crate std as other_non_existent; + | ++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/imports/no-std-inject.stderr b/tests/ui/imports/no-std-inject.stderr index d3952a50cd311..7299c2e8a9f39 100644 --- a/tests/ui/imports/no-std-inject.stderr +++ b/tests/ui/imports/no-std-inject.stderr @@ -7,9 +7,8 @@ LL | extern crate core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate core; -LL + extern crate core as other_core; - | +LL | extern crate core as other_core; + | +++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/include-macros/parent_dir.stderr b/tests/ui/include-macros/parent_dir.stderr index 23029e911203c..d0a1f4fd3b91f 100644 --- a/tests/ui/include-macros/parent_dir.stderr +++ b/tests/ui/include-macros/parent_dir.stderr @@ -20,9 +20,8 @@ LL | let _ = include_str!("hello.rs"); = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info) help: there is a file with the same name in a different directory | -LL - let _ = include_str!("hello.rs"); -LL + let _ = include_str!("../hello.rs"); - | +LL | let _ = include_str!("../hello.rs"); + | +++ error: couldn't read `$DIR/../../data.bin`: $FILE_NOT_FOUND_MSG --> $DIR/parent_dir.rs:8:13 diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr index 6a3c4e2a836e0..775f23dd7e623 100644 --- a/tests/ui/issues/issue-20225.stderr +++ b/tests/ui/issues/issue-20225.stderr @@ -10,9 +10,8 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {} found signature `extern "rust-call" fn(&Foo, (_,))` help: change the parameter type to match the trait | -LL - extern "rust-call" fn call(&self, (_,): (T,)) {} -LL + extern "rust-call" fn call(&self, (_,): (&'a T,)) {} - | +LL | extern "rust-call" fn call(&self, (_,): (&'a T,)) {} + | +++ error[E0053]: method `call_mut` has an incompatible type for trait --> $DIR/issue-20225.rs:11:51 @@ -26,9 +25,8 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} found signature `extern "rust-call" fn(&mut Foo, (_,))` help: change the parameter type to match the trait | -LL - extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} -LL + extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {} - | +LL | extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {} + | +++ error[E0053]: method `call_once` has an incompatible type for trait --> $DIR/issue-20225.rs:18:47 @@ -43,9 +41,8 @@ LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} found signature `extern "rust-call" fn(Foo, (_,))` help: change the parameter type to match the trait | -LL - extern "rust-call" fn call_once(self, (_,): (T,)) {} -LL + extern "rust-call" fn call_once(self, (_,): (&'a T,)) {} - | +LL | extern "rust-call" fn call_once(self, (_,): (&'a T,)) {} + | +++ error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-23073.stderr b/tests/ui/issues/issue-23073.stderr index 8aa86887bcfc6..87dcf3b328923 100644 --- a/tests/ui/issues/issue-23073.stderr +++ b/tests/ui/issues/issue-23073.stderr @@ -6,9 +6,8 @@ LL | type FooT = <::Foo>::T; | help: if there were a trait named `Example` with associated type `T` implemented for `::Foo`, you could use the fully-qualified path | -LL - type FooT = <::Foo>::T; -LL + type FooT = <::Foo as Example>::T; - | +LL | type FooT = <::Foo as Example>::T; + | ++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr index eabb08421121e..f54990d5d8618 100644 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr +++ b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr @@ -6,9 +6,8 @@ LL | let foo::Foo {} = foo::Foo::default(); | help: ignore the inaccessible and unused fields | -LL - let foo::Foo {} = foo::Foo::default(); -LL + let foo::Foo { .. } = foo::Foo::default(); - | +LL | let foo::Foo { .. } = foo::Foo::default(); + | ++ error: pattern requires `..` due to inaccessible fields --> $DIR/issue-76077-1.rs:16:9 diff --git a/tests/ui/lifetimes/borrowck-let-suggestion.stderr b/tests/ui/lifetimes/borrowck-let-suggestion.stderr index 4703d7f10dc28..9020ee22f9bd8 100644 --- a/tests/ui/lifetimes/borrowck-let-suggestion.stderr +++ b/tests/ui/lifetimes/borrowck-let-suggestion.stderr @@ -13,7 +13,7 @@ LL | x.use_mut(); help: consider consuming the `Vec` when turning it into an `Iterator` | LL | let mut x = vec![1].into_iter(); - | +++++ + | +++++ help: consider using a `let` binding to create a longer lived value | LL ~ let binding = vec![1]; diff --git a/tests/ui/lifetimes/issue-26638.stderr b/tests/ui/lifetimes/issue-26638.stderr index 8aa94f66812f3..bdf911367653b 100644 --- a/tests/ui/lifetimes/issue-26638.stderr +++ b/tests/ui/lifetimes/issue-26638.stderr @@ -56,9 +56,8 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } | help: provide the argument | -LL - fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } -LL + fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) } - | +LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) } + | +++++++++ error[E0308]: mismatched types --> $DIR/issue-26638.rs:4:47 diff --git a/tests/ui/lint/static-mut-refs.e2021.stderr b/tests/ui/lint/static-mut-refs.e2021.stderr index 337d5d0b307ee..00a2ca99f241c 100644 --- a/tests/ui/lint/static-mut-refs.e2021.stderr +++ b/tests/ui/lint/static-mut-refs.e2021.stderr @@ -22,9 +22,8 @@ LL | let _y = &mut X; = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | -LL - let _y = &mut X; -LL + let _y = &raw mut X; - | +LL | let _y = &raw mut X; + | +++ warning: creating a shared reference to mutable static is discouraged --> $DIR/static-mut-refs.rs:50:22 diff --git a/tests/ui/lint/static-mut-refs.e2024.stderr b/tests/ui/lint/static-mut-refs.e2024.stderr index cf7f0a86f4fe7..ff41f316250d1 100644 --- a/tests/ui/lint/static-mut-refs.e2024.stderr +++ b/tests/ui/lint/static-mut-refs.e2024.stderr @@ -22,9 +22,8 @@ LL | let _y = &mut X; = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | -LL - let _y = &mut X; -LL + let _y = &raw mut X; - | +LL | let _y = &raw mut X; + | +++ error: creating a shared reference to mutable static is discouraged --> $DIR/static-mut-refs.rs:50:22 diff --git a/tests/ui/lint/type-overflow.stderr b/tests/ui/lint/type-overflow.stderr index 6ba0c9d907c5e..4d6403b1e7db2 100644 --- a/tests/ui/lint/type-overflow.stderr +++ b/tests/ui/lint/type-overflow.stderr @@ -26,9 +26,8 @@ LL + let fail = 0b1000_0001u8; | help: to use as a negative number (decimal `-127`), consider using the type `u8` for the literal and cast it to `i8` | -LL - let fail = 0b1000_0001i8; -LL + let fail = 0b1000_0001u8 as i8; - | +LL | let fail = 0b1000_0001u8 as i8; + | +++++ warning: literal out of range for `i64` --> $DIR/type-overflow.rs:15:16 @@ -44,9 +43,8 @@ LL + let fail = 0x8000_0000_0000_0000u64; | help: to use as a negative number (decimal `-9223372036854775808`), consider using the type `u64` for the literal and cast it to `i64` | -LL - let fail = 0x8000_0000_0000_0000i64; -LL + let fail = 0x8000_0000_0000_0000u64 as i64; - | +LL | let fail = 0x8000_0000_0000_0000u64 as i64; + | ++++++ warning: literal out of range for `u32` --> $DIR/type-overflow.rs:19:16 diff --git a/tests/ui/malformed/malformed-special-attrs.stderr b/tests/ui/malformed/malformed-special-attrs.stderr index a6220710cf912..b6a1a6b50e468 100644 --- a/tests/ui/malformed/malformed-special-attrs.stderr +++ b/tests/ui/malformed/malformed-special-attrs.stderr @@ -7,9 +7,8 @@ LL | #[cfg_attr] = note: for more information, visit help: missing condition and attribute | -LL - #[cfg_attr] -LL + #[cfg_attr(condition, attribute, other_attribute, ...)] - | +LL | #[cfg_attr(condition, attribute, other_attribute, ...)] + | ++++++++++++++++++++++++++++++++++++++++++++ error: malformed `cfg_attr` attribute input --> $DIR/malformed-special-attrs.rs:4:1 diff --git a/tests/ui/methods/method-call-err-msg.stderr b/tests/ui/methods/method-call-err-msg.stderr index 7cda928aca9d3..95de40ff891be 100644 --- a/tests/ui/methods/method-call-err-msg.stderr +++ b/tests/ui/methods/method-call-err-msg.stderr @@ -28,9 +28,8 @@ LL | fn one(self, _: isize) -> Foo { self } | ^^^ -------- help: provide the argument | -LL - .one() -LL + .one(/* isize */) - | +LL | .one(/* isize */) + | +++++++++++ error[E0061]: this method takes 2 arguments but 1 argument was supplied --> $DIR/method-call-err-msg.rs:15:7 @@ -45,9 +44,8 @@ LL | fn two(self, _: isize, _: isize) -> Foo { self } | ^^^ -------- help: provide the argument | -LL - .two(0); -LL + .two(0, /* isize */); - | +LL | .two(0, /* isize */); + | +++++++++++++ error[E0599]: `Foo` is not an iterator --> $DIR/method-call-err-msg.rs:19:7 @@ -84,9 +82,8 @@ LL | fn three(self, _: T, _: T, _: T) -> Foo { self } | ^^^^^ ---- ---- ---- help: provide the arguments | -LL - y.three::(); -LL + y.three::(/* usize */, /* usize */, /* usize */); - | +LL | y.three::(/* usize */, /* usize */, /* usize */); + | +++++++++++++++++++++++++++++++++++++ error: aborting due to 5 previous errors diff --git a/tests/ui/mismatched_types/closure-arg-count.stderr b/tests/ui/mismatched_types/closure-arg-count.stderr index 8704d0f661be2..e0fcf9beb3c4c 100644 --- a/tests/ui/mismatched_types/closure-arg-count.stderr +++ b/tests/ui/mismatched_types/closure-arg-count.stderr @@ -8,9 +8,8 @@ LL | [1, 2, 3].sort_by(|| panic!()); | help: consider changing the closure to take and ignore the expected arguments | -LL - [1, 2, 3].sort_by(|| panic!()); -LL + [1, 2, 3].sort_by(|_, _| panic!()); - | +LL | [1, 2, 3].sort_by(|_, _| panic!()); + | ++++ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument --> $DIR/closure-arg-count.rs:7:15 @@ -64,9 +63,8 @@ LL | fn f>(_: F) {} | ^^^^^^^^^^^^ required by this bound in `f` help: consider changing the closure to take and ignore the expected argument | -LL - f(|| panic!()); -LL + f(|_| panic!()); - | +LL | f(|_| panic!()); + | + error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:15:5 @@ -84,9 +82,8 @@ LL | fn f>(_: F) {} | ^^^^^^^^^^^^ required by this bound in `f` help: consider changing the closure to take and ignore the expected argument | -LL - f( move || panic!()); -LL + f( move |_| panic!()); - | +LL | f( move |_| panic!()); + | + error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:18:53 diff --git a/tests/ui/mismatched_types/issue-13033.stderr b/tests/ui/mismatched_types/issue-13033.stderr index 7756217b56000..61786ef14c252 100644 --- a/tests/ui/mismatched_types/issue-13033.stderr +++ b/tests/ui/mismatched_types/issue-13033.stderr @@ -13,9 +13,8 @@ LL | fn bar(&mut self, other: &mut dyn Foo); found signature `fn(&mut Baz, &dyn Foo)` help: change the parameter type to match the trait | -LL - fn bar(&mut self, other: &dyn Foo) {} -LL + fn bar(&mut self, other: &mut dyn Foo) {} - | +LL | fn bar(&mut self, other: &mut dyn Foo) {} + | +++ error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/mismatch-args-crash-issue-128848.stderr b/tests/ui/mismatched_types/mismatch-args-crash-issue-128848.stderr index dbd313fada99c..13f51cb7b094a 100644 --- a/tests/ui/mismatched_types/mismatch-args-crash-issue-128848.stderr +++ b/tests/ui/mismatched_types/mismatch-args-crash-issue-128848.stderr @@ -8,9 +8,8 @@ note: method defined here --> $SRC_DIR/core/src/ops/function.rs:LL:COL help: provide the argument | -LL - f.call_once() -LL + f.call_once(/* args */) - | +LL | f.call_once(/* args */) + | ++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/mismatch-args-crash-issue-130400.stderr b/tests/ui/mismatched_types/mismatch-args-crash-issue-130400.stderr index d9d99f3d1cf52..8ed4530e85e3c 100644 --- a/tests/ui/mismatched_types/mismatch-args-crash-issue-130400.stderr +++ b/tests/ui/mismatched_types/mismatch-args-crash-issue-130400.stderr @@ -11,9 +11,8 @@ LL | fn foo(&mut self) -> _ { | ^^^ --------- help: provide the argument | -LL - Self::foo() -LL + Self::foo(/* value */) - | +LL | Self::foo(/* value */) + | +++++++++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/mismatch-args-crash-issue-130400.rs:2:26 diff --git a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr index 7acc361fdb8df..b949b4ea298ad 100644 --- a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr +++ b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr @@ -11,9 +11,8 @@ LL | unsafe extern "C" fn test_va_copy(_: u64, mut ap: ...) {} | ^^^^^^^^^^^^ ------ help: provide the argument | -LL - test_va_copy(); -LL + test_va_copy(/* u64 */); - | +LL | test_va_copy(/* u64 */); + | +++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/overloaded-calls-bad.stderr b/tests/ui/mismatched_types/overloaded-calls-bad.stderr index 9f5c35a30097d..0a872da601482 100644 --- a/tests/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/tests/ui/mismatched_types/overloaded-calls-bad.stderr @@ -25,9 +25,8 @@ LL | impl FnMut<(isize,)> for S { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: provide the argument | -LL - let ans = s(); -LL + let ans = s(/* isize */); - | +LL | let ans = s(/* isize */); + | +++++++++++ error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/overloaded-calls-bad.rs:37:15 diff --git a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index d232cc50e5230..45a02982289de 100644 --- a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -32,9 +32,8 @@ LL | fn bar(&mut self, bar: &mut Bar); found signature `fn(&mut Bar, &Bar)` help: change the parameter type to match the trait | -LL - fn bar(&mut self, bar: &Bar) { } -LL + fn bar(&mut self, bar: &mut Bar) { } - | +LL | fn bar(&mut self, bar: &mut Bar) { } + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr index 7e11b23d681b8..9dbd676969364 100644 --- a/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr +++ b/tests/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.stderr @@ -9,9 +9,8 @@ LL | S1 { a: unsafe { &mut X1 } } = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer | -LL - S1 { a: unsafe { &mut X1 } } -LL + S1 { a: unsafe { &raw mut X1 } } - | +LL | S1 { a: unsafe { &raw mut X1 } } + | +++ warning: 1 warning emitted diff --git a/tests/ui/not-enough-arguments.stderr b/tests/ui/not-enough-arguments.stderr index 637c2774d5a31..099d82eb93552 100644 --- a/tests/ui/not-enough-arguments.stderr +++ b/tests/ui/not-enough-arguments.stderr @@ -11,9 +11,8 @@ LL | fn foo(a: isize, b: isize, c: isize, d:isize) { | ^^^ ------- help: provide the argument | -LL - foo(1, 2, 3); -LL + foo(1, 2, 3, /* isize */); - | +LL | foo(1, 2, 3, /* isize */); + | +++++++++++++ error[E0061]: this function takes 6 arguments but 3 arguments were supplied --> $DIR/not-enough-arguments.rs:29:3 @@ -35,9 +34,8 @@ LL | f: i32, | ------ help: provide the arguments | -LL - bar(1, 2, 3); -LL + bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */); - | +LL | bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */); + | +++++++++++++++++++++++++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/obsolete-in-place/bad.stderr b/tests/ui/obsolete-in-place/bad.stderr index 1409a6637890f..a1321a46351a9 100644 --- a/tests/ui/obsolete-in-place/bad.stderr +++ b/tests/ui/obsolete-in-place/bad.stderr @@ -6,9 +6,8 @@ LL | x <- y; | help: if you meant to write a comparison against a negative value, add a space in between `<` and `-` | -LL - x <- y; -LL + x < - y; - | +LL | x < - y; + | + error: expected expression, found keyword `in` --> $DIR/bad.rs:10:5 diff --git a/tests/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index 0482a5c58559e..4ceea779b29dc 100644 --- a/tests/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr @@ -6,12 +6,10 @@ LL | #[rustc_on_unimplemented] | help: the following are the possible correct uses | -LL - #[rustc_on_unimplemented] -LL + #[rustc_on_unimplemented = "message"] - | -LL - #[rustc_on_unimplemented] -LL + #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] - | +LL | #[rustc_on_unimplemented = "message"] + | +++++++++++ +LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] + | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ error[E0230]: there is no parameter `C` on trait `BadAnnotation2` --> $DIR/bad-annotation.rs:22:1 diff --git a/tests/ui/on-unimplemented/issue-104140.stderr b/tests/ui/on-unimplemented/issue-104140.stderr index 5c9d5e8d55398..3c317135dd43a 100644 --- a/tests/ui/on-unimplemented/issue-104140.stderr +++ b/tests/ui/on-unimplemented/issue-104140.stderr @@ -6,12 +6,10 @@ LL | #[rustc_on_unimplemented] | help: the following are the possible correct uses | -LL - #[rustc_on_unimplemented] -LL + #[rustc_on_unimplemented = "message"] - | -LL - #[rustc_on_unimplemented] -LL + #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] - | +LL | #[rustc_on_unimplemented = "message"] + | +++++++++++ +LL | #[rustc_on_unimplemented(/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...")] + | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/panic-handler/weak-lang-item.stderr b/tests/ui/panic-handler/weak-lang-item.stderr index e9d444c1c4d8c..5dcb37df68921 100644 --- a/tests/ui/panic-handler/weak-lang-item.stderr +++ b/tests/ui/panic-handler/weak-lang-item.stderr @@ -7,9 +7,8 @@ LL | extern crate core; = note: `core` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate core; -LL + extern crate core as other_core; - | +LL | extern crate core as other_core; + | +++++++++++++ error: `#[panic_handler]` function required, but not found diff --git a/tests/ui/parser/emoji-identifiers.stderr b/tests/ui/parser/emoji-identifiers.stderr index f0e90082bff9d..ef4e647b9f506 100644 --- a/tests/ui/parser/emoji-identifiers.stderr +++ b/tests/ui/parser/emoji-identifiers.stderr @@ -81,9 +81,8 @@ LL | fn full_of_✨() -> 👀 { | ^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function `full_of_✨` with a similar name | -LL - 👀::full_of✨() -LL + 👀::full_of_✨() - | +LL | 👀::full_of_✨() + | + error[E0425]: cannot find function `i_like_to_😄_a_lot` in this scope --> $DIR/emoji-identifiers.rs:13:13 diff --git a/tests/ui/parser/extern-crate-unexpected-token.stderr b/tests/ui/parser/extern-crate-unexpected-token.stderr index 3d48f0adfa11a..033db85a6c7f1 100644 --- a/tests/ui/parser/extern-crate-unexpected-token.stderr +++ b/tests/ui/parser/extern-crate-unexpected-token.stderr @@ -6,9 +6,8 @@ LL | extern crte foo; | help: there is a keyword `crate` with a similar name | -LL - extern crte foo; -LL + extern crate foo; - | +LL | extern crate foo; + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/misspelled-keywords/const-fn.stderr b/tests/ui/parser/misspelled-keywords/const-fn.stderr index 46a6d8ca779fc..cc4c0f92917db 100644 --- a/tests/ui/parser/misspelled-keywords/const-fn.stderr +++ b/tests/ui/parser/misspelled-keywords/const-fn.stderr @@ -6,9 +6,8 @@ LL | cnst fn code() {} | help: there is a keyword `const` with a similar name | -LL - cnst fn code() {} -LL + const fn code() {} - | +LL | const fn code() {} + | + error: aborting due to 1 previous error diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr index 23821decd6e43..d241f417553fc 100644 --- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr @@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match ref_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -100,7 +100,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match res_u32_never { LL + Ok(_) => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -374,7 +374,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `&[]` not covered @@ -415,7 +415,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match *slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -462,7 +462,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match array_0_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr index 84aefe7d96370..ea63d7ba1afd1 100644 --- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr @@ -46,7 +46,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match ref_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -76,7 +76,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match res_u32_never { LL + Ok(_) => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered @@ -321,7 +321,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered @@ -376,7 +376,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match *slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty @@ -390,7 +390,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match array_0_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -502,7 +502,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match *ref_tuple_half_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr index f3af74c16c30f..a1a44e7774428 100644 --- a/tests/ui/pattern/usefulness/empty-types.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr @@ -37,7 +37,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match ref_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -67,7 +67,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match res_u32_never { LL + Ok(_) => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered @@ -312,7 +312,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered @@ -367,7 +367,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match *slice_never { LL + _ => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty @@ -381,7 +381,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match array_0_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -493,7 +493,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match *ref_tuple_half_never { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern diff --git a/tests/ui/pattern/usefulness/impl-trait.stderr b/tests/ui/pattern/usefulness/impl-trait.stderr index 34f8eb1e1635d..c3e1c267b6140 100644 --- a/tests/ui/pattern/usefulness/impl-trait.stderr +++ b/tests/ui/pattern/usefulness/impl-trait.stderr @@ -36,7 +36,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match return_never_rpit(x) { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern @@ -118,7 +118,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match return_never_tait(x) { LL + _ => todo!(), -LL + } +LL ~ } | error: unreachable pattern diff --git a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr index 914c6ed60c839..7caee64a33fbc 100644 --- a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr +++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr @@ -154,7 +154,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match 7usize { LL + _ => todo!(), -LL + } +LL ~ } | error: aborting due to 12 previous errors diff --git a/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr index 2acde84965066..c37a9a5157904 100644 --- a/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr +++ b/tests/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr @@ -15,7 +15,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match a { LL + _ => todo!(), -LL + } +LL ~ } | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr index 4487f2735345a..bd51aca65ee2d 100644 --- a/tests/ui/pattern/usefulness/unstable-gated-fields.stderr +++ b/tests/ui/pattern/usefulness/unstable-gated-fields.stderr @@ -6,19 +6,16 @@ LL | let UnstableStruct { stable, stable2, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, unstable } = UnstableStruct::default(); + | ++++++++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, unstable: _ } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, unstable: _ } = UnstableStruct::default(); + | +++++++++++ help: or always ignore missing fields here | -LL - let UnstableStruct { stable, stable2, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); + | ++ error[E0027]: pattern does not mention field `stable2` --> $DIR/unstable-gated-fields.rs:13:9 @@ -28,19 +25,16 @@ LL | let UnstableStruct { stable, unstable, } = UnstableStruct::default(); | help: include the missing field in the pattern | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, stable2 } = UnstableStruct::default(); + | +++++++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, stable2: _ } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, stable2: _ } = UnstableStruct::default(); + | ++++++++++ help: or always ignore missing fields here | -LL - let UnstableStruct { stable, unstable, } = UnstableStruct::default(); -LL + let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); - | +LL | let UnstableStruct { stable, unstable, .. } = UnstableStruct::default(); + | ++ error: aborting due to 2 previous errors diff --git a/tests/ui/regions/region-object-lifetime-in-coercion.stderr b/tests/ui/regions/region-object-lifetime-in-coercion.stderr index 3880ae8228377..5f6a11786cc8e 100644 --- a/tests/ui/regions/region-object-lifetime-in-coercion.stderr +++ b/tests/ui/regions/region-object-lifetime-in-coercion.stderr @@ -13,9 +13,8 @@ LL + fn a(v: &[u8]) -> Box { | help: alternatively, add an explicit `'static` bound to this reference | -LL - fn a(v: &[u8]) -> Box { -LL + fn a(v: &'static [u8]) -> Box { - | +LL | fn a(v: &'static [u8]) -> Box { + | +++++++ error: lifetime may not live long enough --> $DIR/region-object-lifetime-in-coercion.rs:14:5 @@ -32,9 +31,8 @@ LL + fn b(v: &[u8]) -> Box { | help: alternatively, add an explicit `'static` bound to this reference | -LL - fn b(v: &[u8]) -> Box { -LL + fn b(v: &'static [u8]) -> Box { - | +LL | fn b(v: &'static [u8]) -> Box { + | +++++++ error: lifetime may not live long enough --> $DIR/region-object-lifetime-in-coercion.rs:21:5 diff --git a/tests/ui/regions/regions-proc-bound-capture.stderr b/tests/ui/regions/regions-proc-bound-capture.stderr index 3149cd8c9a1bc..75e04bcb7c2a4 100644 --- a/tests/ui/regions/regions-proc-bound-capture.stderr +++ b/tests/ui/regions/regions-proc-bound-capture.stderr @@ -14,9 +14,8 @@ LL + fn static_proc(x: &isize) -> Box (isize) + '_> { | help: alternatively, add an explicit `'static` bound to this reference | -LL - fn static_proc(x: &isize) -> Box (isize) + 'static> { -LL + fn static_proc(x: &'static isize) -> Box (isize) + 'static> { - | +LL | fn static_proc(x: &'static isize) -> Box (isize) + 'static> { + | +++++++ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr index f1db2d71b6a66..a9b45a18af397 100644 --- a/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr @@ -3,9 +3,8 @@ error[E0259]: the name `std` is defined multiple times = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - extern crate std; -LL + extern crate std as other_std; - | +LL | extern crate std as other_std; + | ++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr index 40c76821bb835..ef8723408dae8 100644 --- a/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr +++ b/tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr @@ -7,9 +7,8 @@ LL | use std::slice as std; = note: `std` must be defined only once in the type namespace of this module help: you can use `as` to change the binding name of the import | -LL - use std::slice as std; -LL + use std::slice as other_std; - | +LL | use std::slice as other_std; + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr index 45a0ca01a5603..100e0a501e016 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr @@ -38,7 +38,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match NonExhaustiveEnum::Unit { LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(), -LL + } +LL ~ } | error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered @@ -65,7 +65,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match NormalEnum::Unit { LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(), -LL + } +LL ~ } | error: aborting due to 3 previous errors diff --git a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr index 8843efc6ff8c9..a30cf605829f8 100644 --- a/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr +++ b/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.stderr @@ -13,9 +13,8 @@ LL | foo_cpp_ref.0.frobnicate_ref(); | ++ help: there is a method `frobnicate_cpp_ref` with a similar name | -LL - foo_cpp_ref.frobnicate_ref(); -LL + foo_cpp_ref.frobnicate_cpp_ref(); - | +LL | foo_cpp_ref.frobnicate_cpp_ref(); + | ++++ error[E0599]: no method named `frobnicate_self` found for struct `CppRef` in the current scope --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:32:17 diff --git a/tests/ui/span/missing-unit-argument.stderr b/tests/ui/span/missing-unit-argument.stderr index e77ec3c8447a5..e83f7b6cb70f3 100644 --- a/tests/ui/span/missing-unit-argument.stderr +++ b/tests/ui/span/missing-unit-argument.stderr @@ -8,9 +8,8 @@ note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: provide the argument | -LL - let _: Result<(), String> = Ok(); -LL + let _: Result<(), String> = Ok(()); - | +LL | let _: Result<(), String> = Ok(()); + | ++ error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:12:5 @@ -25,9 +24,8 @@ LL | fn foo(():(), ():()) {} | ^^^ ----- ----- help: provide the arguments | -LL - foo(); -LL + foo((), ()); - | +LL | foo((), ()); + | ++++++ error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing-unit-argument.rs:13:5 @@ -42,9 +40,8 @@ LL | fn foo(():(), ():()) {} | ^^^ ----- help: provide the argument | -LL - foo(()); -LL + foo((), ()); - | +LL | foo((), ()); + | ++++ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:14:5 @@ -59,9 +56,8 @@ LL | fn bar(():()) {} | ^^^ ----- help: provide the argument | -LL - bar(); -LL + bar(()); - | +LL | bar(()); + | ++ error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:15:7 @@ -76,9 +72,8 @@ LL | fn baz(self, (): ()) { } | ^^^ ------ help: provide the argument | -LL - S.baz(); -LL + S.baz(()); - | +LL | S.baz(()); + | ++ error[E0061]: this method takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:16:7 @@ -93,9 +88,8 @@ LL | fn generic(self, _: T) { } | ^^^^^^^ ---- help: provide the argument | -LL - S.generic::<()>(); -LL + S.generic::<()>(()); - | +LL | S.generic::<()>(()); + | ++ error: aborting due to 6 previous errors diff --git a/tests/ui/statics/static-mut-shared-parens.stderr b/tests/ui/statics/static-mut-shared-parens.stderr index 3d4b55909cdee..30a586c286ae7 100644 --- a/tests/ui/statics/static-mut-shared-parens.stderr +++ b/tests/ui/statics/static-mut-shared-parens.stderr @@ -22,9 +22,8 @@ LL | let _ = unsafe { ((&mut TEST)) as *const usize }; = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | -LL - let _ = unsafe { ((&mut TEST)) as *const usize }; -LL + let _ = unsafe { ((&raw mut TEST)) as *const usize }; - | +LL | let _ = unsafe { ((&raw mut TEST)) as *const usize }; + | +++ warning: 2 warnings emitted diff --git a/tests/ui/statics/static-mut-xc.stderr b/tests/ui/statics/static-mut-xc.stderr index 48cac28a6eb51..69f334a5636af 100644 --- a/tests/ui/statics/static-mut-xc.stderr +++ b/tests/ui/statics/static-mut-xc.stderr @@ -67,9 +67,8 @@ LL | static_bound_set(&mut static_mut_xc::a); = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives help: use `&raw mut` instead to create a raw pointer | -LL - static_bound_set(&mut static_mut_xc::a); -LL + static_bound_set(&raw mut static_mut_xc::a); - | +LL | static_bound_set(&raw mut static_mut_xc::a); + | +++ warning: 7 warnings emitted diff --git a/tests/ui/structs/default-field-values/non-exhaustive-ctor.disabled.stderr b/tests/ui/structs/default-field-values/non-exhaustive-ctor.disabled.stderr index c7689cfd323a0..09506703b7ec0 100644 --- a/tests/ui/structs/default-field-values/non-exhaustive-ctor.disabled.stderr +++ b/tests/ui/structs/default-field-values/non-exhaustive-ctor.disabled.stderr @@ -66,9 +66,8 @@ LL | let _ = S { }; | help: all remaining fields have default values, if you added `#![feature(default_field_values)]` to your crate you could use those values with `..` | -LL - let _ = S { }; -LL + let _ = S { .. }; - | +LL | let _ = S { .. }; + | ++ error[E0063]: missing fields `field1` and `field2` in initializer of `S` --> $DIR/non-exhaustive-ctor.rs:26:13 diff --git a/tests/ui/structs/default-field-values/non-exhaustive-ctor.enabled.stderr b/tests/ui/structs/default-field-values/non-exhaustive-ctor.enabled.stderr index d9b8e76aa0de6..229f47093adcc 100644 --- a/tests/ui/structs/default-field-values/non-exhaustive-ctor.enabled.stderr +++ b/tests/ui/structs/default-field-values/non-exhaustive-ctor.enabled.stderr @@ -6,9 +6,8 @@ LL | let _ = S { }; | help: all remaining fields have default values, you can use those values with `..` | -LL - let _ = S { }; -LL + let _ = S { .. }; - | +LL | let _ = S { .. }; + | ++ error[E0063]: missing fields `field1` and `field2` in initializer of `S` --> $DIR/non-exhaustive-ctor.rs:26:13 diff --git a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr index 8644f4a1dd452..2ad9c807e48ac 100644 --- a/tests/ui/suggestions/args-instead-of-tuple-errors.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -60,9 +60,8 @@ note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: provide the argument | -LL - let _: Option<(i8,)> = Some(); -LL + let _: Option<(i8,)> = Some(/* (i8,) */); - | +LL | let _: Option<(i8,)> = Some(/* (i8,) */); + | +++++++++++ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple-errors.rs:14:34 diff --git a/tests/ui/suggestions/args-instead-of-tuple.stderr b/tests/ui/suggestions/args-instead-of-tuple.stderr index 4b0bab971ee71..4093d06970e1b 100644 --- a/tests/ui/suggestions/args-instead-of-tuple.stderr +++ b/tests/ui/suggestions/args-instead-of-tuple.stderr @@ -34,9 +34,8 @@ note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL help: provide the argument | -LL - let _: Option<()> = Some(); -LL + let _: Option<()> = Some(()); - | +LL | let _: Option<()> = Some(()); + | ++ error[E0308]: mismatched types --> $DIR/args-instead-of-tuple.rs:14:34 diff --git a/tests/ui/suggestions/bad-hex-float-lit.stderr b/tests/ui/suggestions/bad-hex-float-lit.stderr index 94c0715a4e683..351dc879be3c7 100644 --- a/tests/ui/suggestions/bad-hex-float-lit.stderr +++ b/tests/ui/suggestions/bad-hex-float-lit.stderr @@ -8,9 +8,8 @@ LL | let _f: f32 = 0xAAf32; | help: rewrite this as a decimal floating point literal, or use `as` to turn a hex literal into a float | -LL - let _f: f32 = 0xAAf32; -LL + let _f: f32 = 0xAA as f32; - | +LL | let _f: f32 = 0xAA as f32; + | ++ LL - let _f: f32 = 0xAAf32; LL + let _f: f32 = 170_f32; | diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg index 0f2ade633c5ad..279fd30f2165c 100644 --- a/tests/ui/suggestions/incorrect-variant-literal.svg +++ b/tests/ui/suggestions/incorrect-variant-literal.svg @@ -1,4 +1,4 @@ - + Foo for Bar where for<'a> <&'a S>::Item: Foo {} | help: use fully-qualified syntax | -LL - impl Foo for Bar where for<'a> <&'a S>::Item: Foo {} -LL + impl Foo for Bar where for<'a> <&'a S as IntoAsyncIterator>::Item: Foo {} - | -LL - impl Foo for Bar where for<'a> <&'a S>::Item: Foo {} -LL + impl Foo for Bar where for<'a> <&'a S as IntoIterator>::Item: Foo {} - | +LL | impl Foo for Bar where for<'a> <&'a S as IntoAsyncIterator>::Item: Foo {} + | ++++++++++++++++++++ +LL | impl Foo for Bar where for<'a> <&'a S as IntoIterator>::Item: Foo {} + | +++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/test-attrs/inaccessible-test-modules.stderr b/tests/ui/test-attrs/inaccessible-test-modules.stderr index dfb6985730af5..c66dc0d0fc26c 100644 --- a/tests/ui/test-attrs/inaccessible-test-modules.stderr +++ b/tests/ui/test-attrs/inaccessible-test-modules.stderr @@ -13,7 +13,7 @@ LL | use test as y; help: consider importing this module instead | LL | use test::test as y; - | ++++++ + | ++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index c4deafd4f6b7a..03fd43d43a931 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -11,9 +11,8 @@ LL | V(u8) | ^ help: provide the argument | -LL - ::V(); -LL + ::V(/* u8 */); - | +LL | ::V(/* u8 */); + | ++++++++ error[E0308]: mismatched types --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17 diff --git a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr index 55df117d0664c..38fbff9d59dae 100644 --- a/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr +++ b/tests/ui/type-alias-impl-trait/bad-tait-no-substs.stderr @@ -69,7 +69,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match x { LL + UninhabitedVariants::Tuple(_) => todo!(), -LL + } +LL ~ } | error: aborting due to 5 previous errors diff --git a/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr b/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr index 6d9c8eabfad59..5c9a4688105ff 100644 --- a/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr +++ b/tests/ui/type-alias-impl-trait/unconstrained-due-to-bad-pattern.stderr @@ -9,7 +9,7 @@ help: ensure that all possible cases are being handled by adding a match arm wit | LL ~ match empty_opaque() { LL + _ => todo!(), -LL + } +LL ~ } | error: aborting due to 1 previous error diff --git a/tests/ui/type/type-check/point-at-inference-4.stderr b/tests/ui/type/type-check/point-at-inference-4.stderr index 52d603c598082..adfb0cebf26ec 100644 --- a/tests/ui/type/type-check/point-at-inference-4.stderr +++ b/tests/ui/type/type-check/point-at-inference-4.stderr @@ -11,9 +11,8 @@ LL | fn infer(&self, a: A, b: B) {} | ^^^^^ ---- help: provide the argument | -LL - s.infer(0i32); -LL + s.infer(0i32, /* b */); - | +LL | s.infer(0i32, /* b */); + | +++++++++ error[E0308]: mismatched types --> $DIR/point-at-inference-4.rs:18:24 diff --git a/tests/ui/typeck/issue-110052.stderr b/tests/ui/typeck/issue-110052.stderr index 649fc8429b9c2..832cdf6f710be 100644 --- a/tests/ui/typeck/issue-110052.stderr +++ b/tests/ui/typeck/issue-110052.stderr @@ -6,12 +6,10 @@ LL | for<'iter> dyn Validator<<&'iter I>::Item>:, | help: use fully-qualified syntax | -LL - for<'iter> dyn Validator<<&'iter I>::Item>:, -LL + for<'iter> dyn Validator<<&'iter I as IntoAsyncIterator>::Item>:, - | -LL - for<'iter> dyn Validator<<&'iter I>::Item>:, -LL + for<'iter> dyn Validator<<&'iter I as IntoIterator>::Item>:, - | +LL | for<'iter> dyn Validator<<&'iter I as IntoAsyncIterator>::Item>:, + | ++++++++++++++++++++ +LL | for<'iter> dyn Validator<<&'iter I as IntoIterator>::Item>:, + | +++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-13853-5.stderr b/tests/ui/typeck/issue-13853-5.stderr index 388d5ec746ce6..4e483a0a58ef1 100644 --- a/tests/ui/typeck/issue-13853-5.stderr +++ b/tests/ui/typeck/issue-13853-5.stderr @@ -14,8 +14,8 @@ LL | fn deserialize_token>(_x: D, _y: &'a str) -> &'a st | help: consider returning the local binding `_y` | -LL ~ fn deserialize_token>(_x: D, _y: &'a str) -> &'a str { -LL + _y +LL | fn deserialize_token>(_x: D, _y: &'a str) -> &'a str { +LL ~ _y LL ~ | diff --git a/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr b/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr index ed0e4eb9ece81..da9caebb2d635 100644 --- a/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr +++ b/tests/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr @@ -6,19 +6,16 @@ LL | let foo::Foo {} = foo::Foo::default(); | help: include the missing field in the pattern and ignore the inaccessible fields | -LL - let foo::Foo {} = foo::Foo::default(); -LL + let foo::Foo { visible, .. } = foo::Foo::default(); - | +LL | let foo::Foo { visible, .. } = foo::Foo::default(); + | +++++++++++ help: if you don't care about this missing field, you can explicitly ignore it | -LL - let foo::Foo {} = foo::Foo::default(); -LL + let foo::Foo { visible: _, .. } = foo::Foo::default(); - | +LL | let foo::Foo { visible: _, .. } = foo::Foo::default(); + | ++++++++++++++ help: or always ignore missing fields here | -LL - let foo::Foo {} = foo::Foo::default(); -LL + let foo::Foo { .. } = foo::Foo::default(); - | +LL | let foo::Foo { .. } = foo::Foo::default(); + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/struct-enum-wrong-args.stderr b/tests/ui/typeck/struct-enum-wrong-args.stderr index d1003fbb6b313..690851ad19adb 100644 --- a/tests/ui/typeck/struct-enum-wrong-args.stderr +++ b/tests/ui/typeck/struct-enum-wrong-args.stderr @@ -38,9 +38,8 @@ note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL help: provide the argument | -LL - let _ = Ok(); -LL + let _ = Ok(/* value */); - | +LL | let _ = Ok(/* value */); + | +++++++++++ error[E0061]: this struct takes 1 argument but 0 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:9:13 @@ -55,9 +54,8 @@ LL | struct Wrapper(i32); | ^^^^^^^ help: provide the argument | -LL - let _ = Wrapper(); -LL + let _ = Wrapper(/* i32 */); - | +LL | let _ = Wrapper(/* i32 */); + | +++++++++ error[E0061]: this struct takes 1 argument but 2 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:10:13 @@ -89,9 +87,8 @@ LL | struct DoubleWrapper(i32, i32); | ^^^^^^^^^^^^^ help: provide the arguments | -LL - let _ = DoubleWrapper(); -LL + let _ = DoubleWrapper(/* i32 */, /* i32 */); - | +LL | let _ = DoubleWrapper(/* i32 */, /* i32 */); + | ++++++++++++++++++++ error[E0061]: this struct takes 2 arguments but 1 argument was supplied --> $DIR/struct-enum-wrong-args.rs:12:13 @@ -106,9 +103,8 @@ LL | struct DoubleWrapper(i32, i32); | ^^^^^^^^^^^^^ help: provide the argument | -LL - let _ = DoubleWrapper(5); -LL + let _ = DoubleWrapper(5, /* i32 */); - | +LL | let _ = DoubleWrapper(5, /* i32 */); + | +++++++++++ error[E0061]: this struct takes 2 arguments but 3 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:13:13