Skip to content

Weird import suggestion #105373

Closed
Closed
@GuillaumeGomez

Description

@GuillaumeGomez

I think it'll be pretty explicit by itself:

error[E0432]: unresolved import `rustc_infer::traits::ObligationCtxt`
  --> src/librustdoc/clean/mod.rs:21:56
   |
21 | use rustc_infer::traits::{Obligation, ObligationCause, ObligationCtxt};
   |                                                        ^^^^^^^^^^^^^^ no `ObligationCtxt` in `traits`
   |
help: a similar name exists in the module
   |
21 | use rustc_infer::traits::{Obligation, ObligationCause, Obligation};
   |                                                        ~~~~~~~~~~
help: consider importing this struct instead
   |
21 | use rustc_infer::traits::{Obligation, ObligationCause, rustc_trait_selection::traits::ObligationCtxt;
   |                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It is suggesting to add an item from another dependency directly inside the current one, which is obviously wrong.

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions