about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZac Pullar-Strecker <zacmps@gmail.com>2020-09-03 20:09:36 +1200
committerZac Pullar-Strecker <zacmps@gmail.com>2020-10-08 15:04:57 +1300
commit26086faab2dab6baeaa050f73a7f64b83ead6807 (patch)
treefa7ad9e11f2e925f23e33d66bf4981b4a57ac701
parentc648884397bfdb779c447fa31964dc1fce94bd95 (diff)
downloadrust-26086faab2dab6baeaa050f73a7f64b83ead6807.tar.gz
rust-26086faab2dab6baeaa050f73a7f64b83ead6807.zip
Change Option::Some bug to a fixme note
IMO this is too much work to be worth fixing at the moment.
-rw-r--r--crates/hir/src/code_model.rs1
-rw-r--r--crates/ide/src/doc_links.rs6
2 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 0b24f247c7a..231ec000403 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<MethodOwner> {
         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 2f6c59c4065..0608c2ac694 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -103,8 +103,8 @@ pub fn get_doc_link<T: Resolvable + Clone>(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))