1
Fork 0

Rollup merge of #119939 - clubby789:static-const-generic-note, r=compiler-errors

Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items

Fixes #109596
Fixes #119936
This commit is contained in:
Matthias Krüger 2024-02-06 22:45:39 +01:00 committed by GitHub
commit 3c52832375
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 118 additions and 43 deletions

View file

@ -45,6 +45,17 @@ pub(crate) struct GenericParamsFromOuterItem {
pub(crate) refer_to_type_directly: Option<Span>,
#[subdiagnostic]
pub(crate) sugg: Option<GenericParamsFromOuterItemSugg>,
#[subdiagnostic]
pub(crate) static_or_const: Option<GenericParamsFromOuterItemStaticOrConst>,
pub(crate) is_self: bool,
}
#[derive(Subdiagnostic)]
pub(crate) enum GenericParamsFromOuterItemStaticOrConst {
#[note(resolve_generic_params_from_outer_item_static)]
Static,
#[note(resolve_generic_params_from_outer_item_const)]
Const,
}
#[derive(Subdiagnostic)]