mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Merge #8539
8539: fix: Do not propose inherent traits in flyimports and import assists r=flodiebold a=SomeoneToIgnore Closes https://github.com/rust-analyzer/rust-analyzer/issues/8520 I've went with a separate method approach, since the [highlighted code](https://github.com/rust-analyzer/rust-analyzer/issues/8520#issuecomment-819856337) has not`Type` and uses `Ty` to get his data, but the code I had to change has no access to `Ty` and has `Type` only. Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
commit
5274eb12dd
5 changed files with 53 additions and 7 deletions
|
@ -56,6 +56,7 @@ pub use mapping::{
|
|||
to_foreign_def_id, to_placeholder_idx,
|
||||
};
|
||||
pub use traits::TraitEnvironment;
|
||||
pub use utils::all_super_traits;
|
||||
pub use walk::TypeWalk;
|
||||
|
||||
pub use chalk_ir::{
|
||||
|
|
|
@ -78,7 +78,7 @@ fn direct_super_trait_refs(db: &dyn HirDatabase, trait_ref: &TraitRef) -> Vec<Tr
|
|||
|
||||
/// Returns an iterator over the whole super trait hierarchy (including the
|
||||
/// trait itself).
|
||||
pub(super) fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<TraitId> {
|
||||
pub fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<TraitId> {
|
||||
// we need to take care a bit here to avoid infinite loops in case of cycles
|
||||
// (i.e. if we have `trait A: B; trait B: A;`)
|
||||
let mut result = vec![trait_];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue