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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
anon-const-in-pat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
basic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
basic.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
closure-bang.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-and-self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-and-self.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
empty-unused-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
empty-unused-enum.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
empty-unused-public-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-variants.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-trait.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
in-closure.rs Lint dead code in closures 2023-02-22 15:27:19 +00:00
in-closure.stderr Lint dead code in closures 2023-02-22 15:27:19 +00:00
issue-68408-false-positive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85071-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85071-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85071.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85071.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85255.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-85255.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
leading-underscore.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-1.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-3.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
lint-dead-code-3.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
lint-dead-code-4.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-4.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-5.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-5.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-6.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-6.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiple-dead-codes-in-the-same-struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiple-dead-codes-in-the-same-struct.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
newline-span.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
newline-span.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-assign.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
self-assign.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
trait-impl.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
tuple-struct-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
tuple-struct-field.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-alias.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-alias.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-in-foreign.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-enum.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-struct-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-struct-variant.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-variant-pub.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-variant.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
with-core-crate.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
with-core-crate.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
with-impl.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00