Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #125852 - bvanjoi:improve-tip-for-invisible-trait, r=co…
…mpiler-errors improve tip for inaccessible traits Improve the tips when the candidate method is from an inaccessible trait. For example: ```rs mod m { trait Trait { fn f() {} } impl<T> Trait for T {} } fn main() { struct S; S::f(); } ``` The difference between before and now is: ```diff error[E0599]: no function or associated item named `f` found for struct `S` in the current scope --> ./src/main.rs:88:6 | LL | struct S; | -------- function or associated item `f` not found for this struct LL | S::f(); | ^ function or associated item not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope - help: trait `Trait` which provides `f` is implemented but not in scope; perhaps you want to import it + help: trait `crate::m::Trait` which provides `f` is implemented but not reachable | - LL + use crate::m::Trait; | ```
- Loading branch information