From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/clippy/tests/ui/crashes/ice-2774.stderr | 2 +- src/tools/clippy/tests/ui/crashes/ice-6250.stderr | 5 +++++ src/tools/clippy/tests/ui/crashes/ice-9746.rs | 15 +++++++++++++++ .../tests/ui/crashes/needless_lifetimes_impl_trait.stderr | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/tools/clippy/tests/ui/crashes/ice-9746.rs (limited to 'src/tools/clippy/tests/ui/crashes') diff --git a/src/tools/clippy/tests/ui/crashes/ice-2774.stderr b/src/tools/clippy/tests/ui/crashes/ice-2774.stderr index 0c2d48f93..1f26c7f4d 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-2774.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-2774.stderr @@ -1,4 +1,4 @@ -error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) +error: the following explicit lifetimes could be elided: 'a --> $DIR/ice-2774.rs:15:1 | LL | pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) { diff --git a/src/tools/clippy/tests/ui/crashes/ice-6250.stderr b/src/tools/clippy/tests/ui/crashes/ice-6250.stderr index 878897c41..4506d1550 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-6250.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-6250.stderr @@ -23,6 +23,11 @@ error[E0308]: mismatched types | LL | Some(reference) = cache.data.get(key) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` + | +help: consider adding `let` + | +LL | let Some(reference) = cache.data.get(key) { + | +++ error: aborting due to 3 previous errors diff --git a/src/tools/clippy/tests/ui/crashes/ice-9746.rs b/src/tools/clippy/tests/ui/crashes/ice-9746.rs new file mode 100644 index 000000000..fbd373c70 --- /dev/null +++ b/src/tools/clippy/tests/ui/crashes/ice-9746.rs @@ -0,0 +1,15 @@ +//! + +trait Trait {} + +struct Struct<'a> { + _inner: &'a Struct<'a>, +} + +impl Trait for Struct<'_> {} + +fn example<'a>(s: &'a Struct) -> Box> { + Box::new(Box::new(Struct { _inner: s })) +} + +fn main() {} diff --git a/src/tools/clippy/tests/ui/crashes/needless_lifetimes_impl_trait.stderr b/src/tools/clippy/tests/ui/crashes/needless_lifetimes_impl_trait.stderr index d68bbe788..875d5ab4f 100644 --- a/src/tools/clippy/tests/ui/crashes/needless_lifetimes_impl_trait.stderr +++ b/src/tools/clippy/tests/ui/crashes/needless_lifetimes_impl_trait.stderr @@ -1,4 +1,4 @@ -error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) +error: the following explicit lifetimes could be elided: 'a --> $DIR/needless_lifetimes_impl_trait.rs:15:5 | LL | fn baz<'a>(&'a self) -> impl Foo + 'a { -- cgit v1.2.3