diff options
| author | Nikita Tomashevich <quant3234@gmail.com> | 2022-09-08 22:28:00 +0300 |
|---|---|---|
| committer | Nikita Tomashevich <quant3234@gmail.com> | 2022-12-28 14:53:47 +0300 |
| commit | 8360a40a8a2ff2098eed561dd89c577349dbbb76 (patch) | |
| tree | 06112d8f43aec7b1def49a9f5797d7b5049ff3d2 /compiler/rustc_infer/src/errors | |
| parent | 9b889e53e78a186a861a8407c225f9d8e0d436f5 (diff) | |
| download | rust-8360a40a8a2ff2098eed561dd89c577349dbbb76.tar.gz rust-8360a40a8a2ff2098eed561dd89c577349dbbb76.zip | |
Migrate named_anon_conflict.rs
Diffstat (limited to 'compiler/rustc_infer/src/errors')
| -rw-r--r-- | compiler/rustc_infer/src/errors/mod.rs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs index c4f11472d55..99112397c7f 100644 --- a/compiler/rustc_infer/src/errors/mod.rs +++ b/compiler/rustc_infer/src/errors/mod.rs @@ -357,8 +357,8 @@ impl AddToDiagnostic for LifetimeMismatchLabels { pub struct AddLifetimeParamsSuggestion<'a> { pub tcx: TyCtxt<'a>, pub sub: Region<'a>, - pub ty_sup: &'a Ty<'a>, - pub ty_sub: &'a Ty<'a>, + pub ty_sup: &'a hir::Ty<'a>, + pub ty_sub: &'a hir::Ty<'a>, pub add_note: bool, } @@ -520,3 +520,23 @@ pub struct MismatchedStaticLifetime<'a> { #[subdiagnostic] pub implicit_static_lifetimes: Vec<ImplicitStaticLifetimeSubdiag>, } + +#[derive(SessionDiagnostic)] +#[diag(infer::explicit_lifetime_required, code = "E0621")] +pub struct ExplicitLifetimeRequired<'a> { + #[primary_span] + #[label] + pub span: Span, + pub ident_kind: &'static str, + pub simple_ident: String, + pub named: String, + + #[suggestion( + infer::explicit_lifetime_required_sugg, + code = "{new_ty}", + applicability = "unspecified" + )] + pub new_ty_span: Span, + #[skip_arg] + pub new_ty: Ty<'a>, +} |
