From 26086faab2dab6baeaa050f73a7f64b83ead6807 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Thu, 3 Sep 2020 20:09:36 +1200 Subject: Change Option::Some bug to a fixme note IMO this is too much work to be worth fixing at the moment. --- crates/hir/src/code_model.rs | 1 + crates/ide/src/doc_links.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 0b24f247c..231ec0004 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -779,6 +779,7 @@ impl Function { db.function_data(self.id).has_body } + /// If this function is a method, the trait or type where it is declared. pub fn method_owner(self, db: &dyn HirDatabase) -> Option { match self.as_assoc_item(db).map(|assoc| assoc.container(db)) { Some(AssocItemContainer::Trait(t)) => Some(t.into()), diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 2f6c59c40..0608c2ac6 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -103,8 +103,8 @@ pub fn get_doc_link(db: &dyn HirDatabase, definition: &T) get_doc_link_impl(db, &module_def) } -// TODO: -// BUG: For Option +// FIXME: +// BUG: For Option::Some // Returns https://doc.rust-lang.org/nightly/core/prelude/v1/enum.Option.html#variant.Some // Instead of https://doc.rust-lang.org/nightly/core/option/enum.Option.html // This could be worked around by turning the `EnumVariant` into `Enum` before attempting resolution, @@ -405,7 +405,7 @@ fn get_symbol_fragment(db: &dyn HirDatabase, field_or_assoc: &FieldOrAssocItem) let is_trait_method = matches!(function.method_owner(db), Some(MethodOwner::Trait(..))); // This distinction may get more complicated when specialisation is available. - // In particular this decision is made based on whether a method 'has defaultness'. + // Rustdoc makes this decision based on whether a method 'has defaultness'. // Currently this is only the case for provided trait methods. if is_trait_method && !function.has_body(db) { format!("#tymethod.{}", function.name(db)) -- cgit v1.2.3