From b2b059c20b92aef06a94449d3a67d22837d3d430 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Mon, 1 Dec 2025 07:21:47 -0700 Subject: [PATCH] chore: Update annotate-snippets to 0.12.10 --- Cargo.lock | 6 ++-- compiler/rustc_errors/Cargo.toml | 2 +- .../clippy/tests/ui/manual_async_fn.stderr | 36 +++++++++++++++++++ .../clippy/tests/ui/map_unwrap_or.stderr | 4 +++ .../clippy/tests/ui/match_same_arms.stderr | 1 - .../ui/non_canonical_partial_ord_impl.stderr | 2 ++ .../clippy/tests/ui/print_literal.stderr | 1 + .../argument-suggestions/issue-112507.stderr | 3 ++ .../invalid-nan-comparison-suggestion.stderr | 3 ++ .../unused/closure-body-issue-136741.stderr | 1 + tests/ui/privacy/suggest-box-new.stderr | 3 ++ tests/ui/suggestions/issue-109396.stderr | 5 +++ tests/ui/suggestions/issue-109854.stderr | 4 +++ .../suggestions/multi-suggestion.ascii.stderr | 3 ++ .../multi-suggestion.unicode.stderr | 3 ++ .../suggestions/suggest-remove-refs-3.stderr | 1 + 16 files changed, 73 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4d8d5111583e5..2cc2e094e9f9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,9 +74,9 @@ dependencies = [ [[package]] name = "annotate-snippets" -version = "0.12.9" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44baf24dd94e781f74dfe67ffee75a09a57971ddf0f615a178b4f6d404b48ff" +checksum = "15580ece6ea97cbf832d60ba19c021113469480852c6a2a6beb0db28f097bf1f" dependencies = [ "anstyle", "memchr", @@ -3838,7 +3838,7 @@ dependencies = [ name = "rustc_errors" version = "0.0.0" dependencies = [ - "annotate-snippets 0.12.9", + "annotate-snippets 0.12.10", "anstream", "anstyle", "derive_setters", diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml index a513a0345c3b7..6c5a1740a9a6c 100644 --- a/compiler/rustc_errors/Cargo.toml +++ b/compiler/rustc_errors/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [dependencies] # tidy-alphabetical-start -annotate-snippets = { version = "0.12.9", features = ["simd"] } +annotate-snippets = { version = "0.12.10", features = ["simd"] } anstream = "0.6.20" anstyle = "1.0.13" derive_setters = "0.1.6" diff --git a/src/tools/clippy/tests/ui/manual_async_fn.stderr b/src/tools/clippy/tests/ui/manual_async_fn.stderr index 54a9b1d40a118..fe6a20589b960 100644 --- a/src/tools/clippy/tests/ui/manual_async_fn.stderr +++ b/src/tools/clippy/tests/ui/manual_async_fn.stderr @@ -9,6 +9,9 @@ LL | fn fut() -> impl Future { help: make the function `async` and return the output of the future directly | LL - fn fut() -> impl Future { +LL - +LL - async { 42 } +LL - } LL + async fn fut() -> i32 { 42 } | @@ -21,6 +24,9 @@ LL | fn fut2() ->impl Future { help: make the function `async` and return the output of the future directly | LL - fn fut2() ->impl Future { +LL - +LL - async { 42 } +LL - } LL + async fn fut2() -> i32 { 42 } | @@ -33,6 +39,9 @@ LL | fn fut3()-> impl Future { help: make the function `async` and return the output of the future directly | LL - fn fut3()-> impl Future { +LL - +LL - async { 42 } +LL - } LL + async fn fut3() -> i32 { 42 } | @@ -45,6 +54,9 @@ LL | fn empty_fut() -> impl Future { help: make the function `async` and return the output of the future directly | LL - fn empty_fut() -> impl Future { +LL - +LL - async {} +LL - } LL + async fn empty_fut() {} | @@ -57,6 +69,9 @@ LL | fn empty_fut2() ->impl Future { help: make the function `async` and return the output of the future directly | LL - fn empty_fut2() ->impl Future { +LL - +LL - async {} +LL - } LL + async fn empty_fut2() {} | @@ -69,6 +84,9 @@ LL | fn empty_fut3()-> impl Future { help: make the function `async` and return the output of the future directly | LL - fn empty_fut3()-> impl Future { +LL - +LL - async {} +LL - } LL + async fn empty_fut3() {} | @@ -81,6 +99,9 @@ LL | fn core_fut() -> impl core::future::Future { help: make the function `async` and return the output of the future directly | LL - fn core_fut() -> impl core::future::Future { +LL - +LL - async move { 42 } +LL - } LL + async fn core_fut() -> i32 { 42 } | @@ -116,6 +137,9 @@ LL | fn elided(_: &i32) -> impl Future + '_ { help: make the function `async` and return the output of the future directly | LL - fn elided(_: &i32) -> impl Future + '_ { +LL - +LL - async { 42 } +LL - } LL + async fn elided(_: &i32) -> i32 { 42 } | @@ -128,6 +152,9 @@ LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + help: make the function `async` and return the output of the future directly | LL - fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future + 'a + 'b { +LL - +LL - async { 42 } +LL - } LL + async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 { 42 } | @@ -140,6 +167,9 @@ LL | pub fn issue_10450() -> impl Future { help: make the function `async` and return the output of the future directly | LL - pub fn issue_10450() -> impl Future { +LL - +LL - async { 42 } +LL - } LL + pub async fn issue_10450() -> i32 { 42 } | @@ -152,6 +182,9 @@ LL | pub(crate) fn issue_10450_2() -> impl Future { help: make the function `async` and return the output of the future directly | LL - pub(crate) fn issue_10450_2() -> impl Future { +LL - +LL - async { 42 } +LL - } LL + pub(crate) async fn issue_10450_2() -> i32 { 42 } | @@ -164,6 +197,9 @@ LL | pub(self) fn issue_10450_3() -> impl Future { help: make the function `async` and return the output of the future directly | LL - pub(self) fn issue_10450_3() -> impl Future { +LL - +LL - async { 42 } +LL - } LL + pub(self) async fn issue_10450_3() -> i32 { 42 } | diff --git a/src/tools/clippy/tests/ui/map_unwrap_or.stderr b/src/tools/clippy/tests/ui/map_unwrap_or.stderr index 0b6c9b7fcf192..b0b02f3f8d6b7 100644 --- a/src/tools/clippy/tests/ui/map_unwrap_or.stderr +++ b/src/tools/clippy/tests/ui/map_unwrap_or.stderr @@ -12,6 +12,9 @@ LL | | .unwrap_or(0); help: use `map_or(, )` instead | LL - let _ = opt.map(|x| x + 1) +LL - +LL - // Should lint even though this call is on a separate line. +LL - .unwrap_or(0); LL + let _ = opt.map_or(0, |x| x + 1); | @@ -98,6 +101,7 @@ LL | | .unwrap_or(None); help: use `and_then()` instead | LL - .map(|x| Some(x + 1)) +LL - .unwrap_or(None); LL + .and_then(|x| Some(x + 1)); | diff --git a/src/tools/clippy/tests/ui/match_same_arms.stderr b/src/tools/clippy/tests/ui/match_same_arms.stderr index 8aa60f8357663..bd0b7b2871ec5 100644 --- a/src/tools/clippy/tests/ui/match_same_arms.stderr +++ b/src/tools/clippy/tests/ui/match_same_arms.stderr @@ -30,7 +30,6 @@ help: otherwise remove the non-wildcard arms | LL - 2 => 'b', LL - 3 => 'b', -LL + _ => 'b', | error: these match arms have identical bodies diff --git a/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr index 8e55603dd9dac..a134df17691e5 100644 --- a/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr +++ b/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl.stderr @@ -28,6 +28,8 @@ LL | | } help: change this to | LL - fn partial_cmp(&self, _: &Self) -> Option { +LL - todo!(); +LL - } LL + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } | diff --git a/src/tools/clippy/tests/ui/print_literal.stderr b/src/tools/clippy/tests/ui/print_literal.stderr index c136f52800f69..229f3bf269d31 100644 --- a/src/tools/clippy/tests/ui/print_literal.stderr +++ b/src/tools/clippy/tests/ui/print_literal.stderr @@ -310,6 +310,7 @@ LL | "name", 5, "x", 0.01 help: try | LL - "Hello {}: {2} is {3:.*} (which {3} with {1} places)", +LL - "name", 5, "x", 0.01 LL + "Hello name: x is {1:.*} (which {1} with {0} places)", 5, 0.01 | diff --git a/tests/ui/argument-suggestions/issue-112507.stderr b/tests/ui/argument-suggestions/issue-112507.stderr index e2ea9af7dc2c3..7c692b67a2d86 100644 --- a/tests/ui/argument-suggestions/issue-112507.stderr +++ b/tests/ui/argument-suggestions/issue-112507.stderr @@ -20,6 +20,9 @@ help: remove the extra arguments | LL - 0, LL - None, +LL - None, +LL - 0, +LL - ); LL + None); | diff --git a/tests/ui/lint/invalid-nan-comparison-suggestion.stderr b/tests/ui/lint/invalid-nan-comparison-suggestion.stderr index 9d07d3f924023..f9b1428de464c 100644 --- a/tests/ui/lint/invalid-nan-comparison-suggestion.stderr +++ b/tests/ui/lint/invalid-nan-comparison-suggestion.stderr @@ -131,6 +131,9 @@ LL | | }; help: use `f32::is_nan()` or `f64::is_nan()` instead | LL - b != { +LL - +LL - &f32::NAN +LL - }; LL + !b.is_nan(); | diff --git a/tests/ui/lint/unused/closure-body-issue-136741.stderr b/tests/ui/lint/unused/closure-body-issue-136741.stderr index 2ea872c08c7ac..14b4dc9756986 100644 --- a/tests/ui/lint/unused/closure-body-issue-136741.stderr +++ b/tests/ui/lint/unused/closure-body-issue-136741.stderr @@ -43,6 +43,7 @@ help: remove these parentheses | LL - let _ = (0..).find(|n| ( LL - n % 2 == 0 +LL - )); LL + let _ = (0..).find(|n| n % 2 == 0); | diff --git a/tests/ui/privacy/suggest-box-new.stderr b/tests/ui/privacy/suggest-box-new.stderr index 566f31fc305eb..e3a7e5f620176 100644 --- a/tests/ui/privacy/suggest-box-new.stderr +++ b/tests/ui/privacy/suggest-box-new.stderr @@ -67,6 +67,9 @@ LL + wtf: Some(Box::new_in(_, _)), help: consider using the `Default` trait | LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), LL + wtf: Some(::default()), | diff --git a/tests/ui/suggestions/issue-109396.stderr b/tests/ui/suggestions/issue-109396.stderr index 5419e8240c59b..5fac07a9a096b 100644 --- a/tests/ui/suggestions/issue-109396.stderr +++ b/tests/ui/suggestions/issue-109396.stderr @@ -25,6 +25,11 @@ note: function defined here help: remove the extra arguments | LL - file.as_raw_fd(), +LL - +LL - 0, +LL - 0, +LL - 0, +LL - ); LL + ); | diff --git a/tests/ui/suggestions/issue-109854.stderr b/tests/ui/suggestions/issue-109854.stderr index d9cbbe37d4612..89d5b4c0178c7 100644 --- a/tests/ui/suggestions/issue-109854.stderr +++ b/tests/ui/suggestions/issue-109854.stderr @@ -23,6 +23,10 @@ note: associated function defined here help: remove the extra arguments | LL - generate_setter, +LL - r#" +LL - pub(crate) struct Person {} +LL - "#, +LL - r#""#, LL + /* usize */, | diff --git a/tests/ui/suggestions/multi-suggestion.ascii.stderr b/tests/ui/suggestions/multi-suggestion.ascii.stderr index bb14eb2fb5729..c2ae19b1ae9aa 100644 --- a/tests/ui/suggestions/multi-suggestion.ascii.stderr +++ b/tests/ui/suggestions/multi-suggestion.ascii.stderr @@ -67,6 +67,9 @@ LL + wtf: Some(Box::new_in(_, _)), help: consider using the `Default` trait | LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), LL + wtf: Some(::default()), | diff --git a/tests/ui/suggestions/multi-suggestion.unicode.stderr b/tests/ui/suggestions/multi-suggestion.unicode.stderr index e7f9e7153d194..fc187cac91d12 100644 --- a/tests/ui/suggestions/multi-suggestion.unicode.stderr +++ b/tests/ui/suggestions/multi-suggestion.unicode.stderr @@ -67,6 +67,9 @@ LL + wtf: Some(Box::new_in(_, _)), help: consider using the `Default` trait ╭╴ LL - wtf: Some(Box(U { +LL - wtf: None, +LL - x: (), +LL - })), LL + wtf: Some(::default()), ╰╴ diff --git a/tests/ui/suggestions/suggest-remove-refs-3.stderr b/tests/ui/suggestions/suggest-remove-refs-3.stderr index a3e142563ff84..cb01468798ff9 100644 --- a/tests/ui/suggestions/suggest-remove-refs-3.stderr +++ b/tests/ui/suggestions/suggest-remove-refs-3.stderr @@ -13,6 +13,7 @@ LL | | .enumerate() { help: consider removing 5 leading `&`-references | LL - for (i, _) in & & & +LL - & &v LL + for (i, _) in v |