From 8360a40a8a2ff2098eed561dd89c577349dbbb76 Mon Sep 17 00:00:00 2001 From: Nikita Tomashevich Date: Thu, 8 Sep 2022 22:28:00 +0300 Subject: Migrate named_anon_conflict.rs --- compiler/rustc_infer/src/errors/mod.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_infer/src/errors') 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, } + +#[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>, +} -- cgit 1.4.1-3-g733a5