Skip to content

"help: possible candidate is found in another module" points to incorrect Span #44514

Closed
@SergioBenitez

Description

@SergioBenitez

Consider the following error:

error[E0412]: cannot find type `Formatter` in this scope
  --> src/main.rs:17:27
   |
17 |     fn fmt(&self, f: &mut Formatter) -> fmt::Result {
   |                           ^^^^^^^^^ not found in this scope
   |
help: possible candidate is found in another module, you can import it into scope
   |
11 | #[derive(use std::fmt::Formatter;
   |

This should be:

help: possible candidate is found in another module, you can import it into scope
   |
- 11 | #[derive(use std::fmt::Formatter;
   |

help: possible candidate is found in another module, you can import it into scope
   |
+ 11 | use std::fmt::Formatter;
   |

The #[derive( bit should not be there.

This issue has been occurring for at least the last ~7 nightlies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions