Skip to content

Suggest removing parenthesis surrounding lifetimes #57386

Closed
@estebank

Description

@estebank

Given:

trait Trait {}
fn f<'a, T: Trait + ('a)>() {}

suggest the correct syntax

error: parenthesized lifetime bounds are not supported
  --> $DIR/trait-object-lifetime-parens.rs:5:24
   |
LL | fn f<'a, T: Trait + ('a)>() {}
   |                        ^
help: remove the braces
   |
LL | fn f<'a, T: Trait + 'a>() {}
   |                     ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions