Skip to content

use foo::self should only give one error #42559

Closed
@nrc

Description

@nrc

It currently gives two - one for self outside {} and one for an unknown import. The latter should be silenced.

e.g.,

error[E0429]: `self` imports are only allowed within a { } list
  --> src/librustc_save_analysis/external_data.rs:19:5
   |
19 | use data::self;
   |     ^^^^^^^^^^

error[E0432]: unresolved import `data::self`
  --> src/librustc_save_analysis/external_data.rs:19:5
   |
19 | use data::self;
   |     ^^^^^^^^^^ no `self` in `data`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-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