You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Auto merge of rust-lang#135278 - tgross35:ignore-std-dep-crates, r=<try>
Exclude dependencies of `std` for diagnostics
Currently crates in the sysroot can show up in diagnostic suggestions, such as in rust-lang#135232. To prevent this, introduce a query `visible_crates` that excludes crates marked `is_private_dep` and use this query in user-facing areas of code.
Setting `#![feature(rustc_private)]` overrides this to just use all crates, since `rustc_private` enables use of `std`'s private dependencies.
Notably, this changes `all_traits` to use `.visible_crates(())` rather than `.crates(())`. This is not strictly required and filtering could happen later as-needed; however, I cannot think of any cases where traits from private dependencies should be relevant in trait selection or diagnostics, so filtering at this earlier point seems more likely to avoid similar issues in the future.
This may be reviewed per-commit.
Fixes: rust-lang#135232
0 commit comments