1
Fork 0

Migrate named_anon_conflict.rs

This commit is contained in:
Nikita Tomashevich 2022-09-08 22:28:00 +03:00
parent 9b889e53e7
commit 8360a40a8a
No known key found for this signature in database
GPG key ID: B29791D4D878E345
3 changed files with 47 additions and 26 deletions

View file

@ -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>,
}