Skip to content

Diagnostic when trying to use ! or ? in trait is confusing. #33418

Closed
@vi

Description

@vi
trait Qqq : !Sized {
}
error: expected one of `?`, `where`, or `{`, found `!`

OK, let's try ?:

trait Qqq : ?Sized {
}
error: unexpected `?`

Why were you expecting ? then?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.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