Skip to content

rustc should provide a suggestion when using a type/trait from a sibling module that isn't imported #21221

Closed
@fitzgen

Description

@fitzgen

Here is two examples in one, a trait and a type:

/Users/fitzgen/src/oxischeme/src/eval.rs:267:6: 267:11 error: attempt to implement a nonexistent trait `Trace`
/Users/fitzgen/src/oxischeme/src/eval.rs:267 impl Trace for Meaning {
                                                  ^~~~~
/Users/fitzgen/src/oxischeme/src/eval.rs:268:24: 268:35 error: use of undeclared type name `IterGcThing`
/Users/fitzgen/src/oxischeme/src/eval.rs:268     fn trace(&self) -> IterGcThing {
                                                                    ^~~~~~~~~~~

It would be nice UX to say something like "did you forget to import module::Type?" or something.

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions