rust/tests/ui/lint/dead-code
bors 0978711950 Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, r=compiler-errors,davidtwco,estebank,oli-obk
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.

For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods>

> Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation.

In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-23 00:19:12 +00:00
..
alias-in-pat.rs
anon-const-in-pat.rs
associated-type.rs
basic.rs
basic.stderr
closure-bang.rs
const-and-self.rs
const-and-self.stderr
empty-unused-enum.rs
empty-unused-enum.stderr
empty-unused-public-enum.rs
enum-variants.rs
impl-trait.rs
impl-trait.stderr
in-closure.rs
in-closure.stderr
issue-68408-false-positive.rs
issue-85071-2.rs
issue-85071-2.stderr
issue-85071.rs
issue-85071.stderr
issue-85255.rs
issue-85255.stderr
leading-underscore.rs
lint-dead-code-1.rs
lint-dead-code-1.stderr
lint-dead-code-2.rs
lint-dead-code-2.stderr
lint-dead-code-3.rs
lint-dead-code-3.stderr
lint-dead-code-4.rs
lint-dead-code-4.stderr
lint-dead-code-5.rs
lint-dead-code-5.stderr
lint-dead-code-6.rs
lint-dead-code-6.stderr
multiple-dead-codes-in-the-same-struct.rs
multiple-dead-codes-in-the-same-struct.stderr
newline-span.rs
newline-span.stderr
self-assign.rs
self-assign.stderr
trait-impl.rs
tuple-struct-field.rs
tuple-struct-field.stderr
type-alias.rs
type-alias.stderr
type-in-foreign.rs
unused-enum.rs
unused-enum.stderr
unused-struct-variant.rs
unused-struct-variant.stderr
unused-variant-pub.rs
unused-variant.rs
unused-variant.stderr
with-core-crate.rs
with-core-crate.stderr
with-impl.rs