diff options
| author | Michael Howell <michael@notriddle.com> | 2023-02-21 14:05:32 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-02-22 08:40:33 -0700 |
| commit | 3d056c31257cc26760b7e65c5dfdae069f7ddc74 (patch) | |
| tree | 05fe48fc1b2f91afbf0adbea57ca5fe9a674b923 /src | |
| parent | 3b4d6e080404560f63599deeb328dfa27fe081a6 (diff) | |
| download | rust-3d056c31257cc26760b7e65c5dfdae069f7ddc74.tar.gz rust-3d056c31257cc26760b7e65c5dfdae069f7ddc74.zip | |
diagnostics: if AssocFn has self argument, describe as method
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/format.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index aa406f30cbe..6bdd9db9bfa 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -775,7 +775,7 @@ pub(crate) fn link_tooltip(did: DefId, fragment: &Option<UrlFragment>, cx: &Cont let fqp = fqp.iter().map(|sym| sym.as_str()).join("::"); if let &Some(UrlFragment::Item(id)) = fragment { let name = cx.tcx().item_name(id); - let descr = cx.tcx().def_kind(id).descr(id); + let descr = cx.tcx().def_descr(id); format!("{descr} {fqp}::{name}") } else { format!("{shortty} {fqp}") |
