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()),
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,
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))