mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Adjust display impls to respect lifetime bounds
This commit is contained in:
parent
0927f86247
commit
707be6b99c
8 changed files with 164 additions and 24 deletions
|
@ -30,6 +30,8 @@ pub fn find_path(
|
|||
find_path_inner(FindPathCtx { db, prefixed: None, prefer_no_std, prefer_prelude }, item, from)
|
||||
}
|
||||
|
||||
/// Find a path that can be used to refer to a certain item. This can depend on
|
||||
/// *from where* you're referring to the item, hence the `from` parameter.
|
||||
pub fn find_path_prefixed(
|
||||
db: &dyn DefDatabase,
|
||||
item: ItemInNs,
|
||||
|
@ -255,7 +257,7 @@ fn find_in_scope(
|
|||
item: ItemInNs,
|
||||
) -> Option<Name> {
|
||||
def_map.with_ancestor_maps(db, from.local_id, &mut |def_map, local_id| {
|
||||
def_map[local_id].scope.name_of(item).map(|(name, _, _)| name.clone())
|
||||
def_map[local_id].scope.names_of(item, |name, _, _| Some(name.clone()))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue