1
Fork 0

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.
This commit is contained in:
Michael Howell 2023-02-21 14:05:32 -07:00
parent 3b4d6e0804
commit 3d056c3125
25 changed files with 91 additions and 58 deletions

View file

@ -189,7 +189,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
let container = match parent.kind {
ModuleKind::Def(kind, _, _) => kind.descr(parent.def_id()),
ModuleKind::Def(kind, _, _) => self.tcx.def_kind_descr(kind, parent.def_id()),
ModuleKind::Block => "block",
};
@ -1804,7 +1804,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
found("module")
} else {
match binding.res() {
Res::Def(kind, id) => found(kind.descr(id)),
Res::Def(kind, id) => found(self.tcx.def_kind_descr(kind, id)),
_ => found(ns_to_try.descr()),
}
}