diff options
author | Zac Pullar-Strecker <[email protected]> | 2020-09-03 09:09:36 +0100 |
---|---|---|
committer | Zac Pullar-Strecker <[email protected]> | 2020-10-08 03:04:57 +0100 |
commit | 26086faab2dab6baeaa050f73a7f64b83ead6807 (patch) | |
tree | fa7ad9e11f2e925f23e33d66bf4981b4a57ac701 | |
parent | c648884397bfdb779c447fa31964dc1fce94bd95 (diff) |
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.rs | 1 | ||||
-rw-r--r-- | 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 { | |||
779 | db.function_data(self.id).has_body | 779 | db.function_data(self.id).has_body |
780 | } | 780 | } |
781 | 781 | ||
782 | /// If this function is a method, the trait or type where it is declared. | ||
782 | pub fn method_owner(self, db: &dyn HirDatabase) -> Option<MethodOwner> { | 783 | pub fn method_owner(self, db: &dyn HirDatabase) -> Option<MethodOwner> { |
783 | match self.as_assoc_item(db).map(|assoc| assoc.container(db)) { | 784 | match self.as_assoc_item(db).map(|assoc| assoc.container(db)) { |
784 | Some(AssocItemContainer::Trait(t)) => Some(t.into()), | 785 | 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<T: Resolvable + Clone>(db: &dyn HirDatabase, definition: &T) | |||
103 | get_doc_link_impl(db, &module_def) | 103 | get_doc_link_impl(db, &module_def) |
104 | } | 104 | } |
105 | 105 | ||
106 | // TODO: | 106 | // FIXME: |
107 | // BUG: For Option | 107 | // BUG: For Option::Some |
108 | // Returns https://doc.rust-lang.org/nightly/core/prelude/v1/enum.Option.html#variant.Some | 108 | // Returns https://doc.rust-lang.org/nightly/core/prelude/v1/enum.Option.html#variant.Some |
109 | // Instead of https://doc.rust-lang.org/nightly/core/option/enum.Option.html | 109 | // Instead of https://doc.rust-lang.org/nightly/core/option/enum.Option.html |
110 | // This could be worked around by turning the `EnumVariant` into `Enum` before attempting resolution, | 110 | // 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) | |||
405 | let is_trait_method = | 405 | let is_trait_method = |
406 | matches!(function.method_owner(db), Some(MethodOwner::Trait(..))); | 406 | matches!(function.method_owner(db), Some(MethodOwner::Trait(..))); |
407 | // This distinction may get more complicated when specialisation is available. | 407 | // This distinction may get more complicated when specialisation is available. |
408 | // In particular this decision is made based on whether a method 'has defaultness'. | 408 | // Rustdoc makes this decision based on whether a method 'has defaultness'. |
409 | // Currently this is only the case for provided trait methods. | 409 | // Currently this is only the case for provided trait methods. |
410 | if is_trait_method && !function.has_body(db) { | 410 | if is_trait_method && !function.has_body(db) { |
411 | format!("#tymethod.{}", function.name(db)) | 411 | format!("#tymethod.{}", function.name(db)) |