Rollup merge of #122120 - fmease:sugg-assoc-ty-bound-on-eq-bound, r=compiler-errors
Suggest associated type bounds on problematic associated equality bounds Fixes #105056. TL;DR: Suggest `Trait<Ty: Bound>` on `Trait<Ty = Bound>` in Rust >=2021. ~~Blocked on #122055 (stabilization of `associated_type_bounds`), I'd say.~~ (merged)
This commit is contained in:
commit
ff8cdc9e14
10 changed files with 287 additions and 99 deletions
|
@ -2631,13 +2631,22 @@ pub(crate) struct GenericsInPath {
|
|||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(parse_assoc_lifetime)]
|
||||
#[diag(parse_lifetime_in_eq_constraint)]
|
||||
#[help]
|
||||
pub(crate) struct AssocLifetime {
|
||||
pub(crate) struct LifetimeInEqConstraint {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[label]
|
||||
pub lifetime: Span,
|
||||
pub span: Span,
|
||||
pub lifetime: Ident,
|
||||
#[label(parse_context_label)]
|
||||
pub binding_label: Span,
|
||||
#[suggestion(
|
||||
parse_colon_sugg,
|
||||
style = "verbose",
|
||||
applicability = "maybe-incorrect",
|
||||
code = ": "
|
||||
)]
|
||||
pub colon_sugg: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue