]> git.lizzy.rs Git - rust.git/commitdiff
Change Option::Some bug to a fixme note
authorZac Pullar-Strecker <zacmps@gmail.com>
Thu, 3 Sep 2020 08:09:36 +0000 (20:09 +1200)
committerZac Pullar-Strecker <zacmps@gmail.com>
Thu, 8 Oct 2020 02:04:57 +0000 (15:04 +1300)
IMO this is too much work to be worth fixing at the moment.

crates/hir/src/code_model.rs
crates/ide/src/doc_links.rs

index 0b24f247c7afd38cda744f1393ccc603bb8ec5be..231ec000403d3d7742afa55b11f8602031a4599a 100644 (file)
@@ -779,6 +779,7 @@ pub fn has_body(self, db: &dyn HirDatabase) -> bool {
         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()),
index 2f6c59c4065f7d0958d0e9828241382445f13d03..0608c2ac694a9dc2d8df618ca540a61aa23e40c6 100644 (file)
@@ -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))