Skip to content

Commit d2c6880

Browse files
committed
Changes from review
1 parent e4a787f commit d2c6880

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ide/src/doc_links.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use ide_db::{defs::Definition, RootDatabase};
1111

1212
use hir::{
1313
db::{DefDatabase, HirDatabase},
14-
Adt, AsName, AssocItem, Crate, Field, HasAttrs, ItemInNs, MethodOwner, ModuleDef,
14+
Adt, AsName, AssocItem, Crate, Field, HasAttrs, ItemInNs, MethodOwner, ModuleDef, AssocItemContainer, AsAssocItem
1515
};
1616
use ide_db::{
1717
defs::{classify_name, classify_name_ref, Definition},
@@ -219,7 +219,7 @@ fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option<S
219219
}
220220

221221
/// Retrieve a link to documentation for the given symbol.
222-
pub fn external_docs(db: &RootDatabase, position: &FilePosition) -> Option<DocumentationLink> {
222+
pub(crate) fn external_docs(db: &RootDatabase, position: &FilePosition) -> Option<DocumentationLink> {
223223
let sema = Semantics::new(db);
224224
let file = sema.parse(position.file_id).syntax().clone();
225225
let token = pick_best(file.token_at_offset(position.offset))?;
@@ -401,7 +401,7 @@ fn get_symbol_fragment(db: &dyn HirDatabase, field_or_assoc: &FieldOrAssocItem)
401401
FieldOrAssocItem::AssocItem(assoc) => match assoc {
402402
AssocItem::Function(function) => {
403403
let is_trait_method =
404-
matches!(function.method_owner(db), Some(MethodOwner::Trait(..)));
404+
matches!(function.as_assoc_item(db).map(|assoc| assoc.container(db)), Some(AssocItemContainer::Trait(..)));
405405
// This distinction may get more complicated when specialisation is available.
406406
// Rustdoc makes this decision based on whether a method 'has defaultness'.
407407
// Currently this is only the case for provided trait methods.

0 commit comments

Comments
 (0)