Skip to content

type aliases cannot be used for traits note is printed wrongly #31686

Closed
@nagisa

Description

@nagisa
src/librustc/session/mod.rs:63:39: 63:67 error: `mir::transform::Passes` is not a trait [E0404]
src/librustc/session/mod.rs:63     pub mir_passes: RefCell<for<'tcx> mir::transform::Passes<'tcx>>,
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/librustc/session/mod.rs:63:39: 63:67 help: run `rustc --explain E0404` to see a detailed explanation
src/librustc/session/mod.rs:63:39: 63:67 note: `type` aliases cannot be used for traits
src/librustc/session/mod.rs:63     pub mir_passes: RefCell<for<'tcx> mir::transform::Passes<'tcx>>,
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The error here is pretty clear, but the note is completely wrong as the relevant snippet appears in the type of the struct field and not type item.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions