diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-06-04 21:10:27 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-06-09 19:55:00 +0000 |
| commit | 3fce086d79afd9bc5b52a13e051934694cf196c1 (patch) | |
| tree | 4c4748953f8d47f644596cfc6e0433f668f90132 /compiler/rustc_trait_selection/src/errors.rs | |
| parent | 00b526212bbdd68872d6f964fcc9a14a66c36fd8 (diff) | |
| download | rust-3fce086d79afd9bc5b52a13e051934694cf196c1.tar.gz rust-3fce086d79afd9bc5b52a13e051934694cf196c1.zip | |
Make E0621 missing lifetime suggestion verbose
```
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/42701_one_named_and_one_anonymous.rs:10:9
|
LL | &*x
| ^^^ lifetime `'a` required
|
help: add explicit lifetime `'a` to the type of `x`
|
LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 {
| ++
```
Diffstat (limited to 'compiler/rustc_trait_selection/src/errors.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/errors.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 06f81ac554e..7bf49056e29 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -759,7 +759,8 @@ pub enum ExplicitLifetimeRequired<'a> { #[suggestion( trait_selection_explicit_lifetime_required_sugg_with_ident, code = "{new_ty}", - applicability = "unspecified" + applicability = "unspecified", + style = "verbose" )] new_ty_span: Span, #[skip_arg] @@ -774,7 +775,8 @@ pub enum ExplicitLifetimeRequired<'a> { #[suggestion( trait_selection_explicit_lifetime_required_sugg_with_param_type, code = "{new_ty}", - applicability = "unspecified" + applicability = "unspecified", + style = "verbose" )] new_ty_span: Span, #[skip_arg] @@ -1462,7 +1464,8 @@ pub enum SuggestAccessingField<'a> { #[suggestion( trait_selection_suggest_accessing_field, code = "{snippet}.{name}", - applicability = "maybe-incorrect" + applicability = "maybe-incorrect", + style = "verbose" )] Safe { #[primary_span] @@ -1474,7 +1477,8 @@ pub enum SuggestAccessingField<'a> { #[suggestion( trait_selection_suggest_accessing_field, code = "unsafe {{ {snippet}.{name} }}", - applicability = "maybe-incorrect" + applicability = "maybe-incorrect", + style = "verbose" )] Unsafe { #[primary_span] |
