Skip to content

Commit daa94d2

Browse files
committed
Auto merge of rust-lang#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.
2 parents 95cd528 + d254516 commit daa94d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ui/missing_doc_impl.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ LL | | fn foo_with_impl(&self) {}
5151
LL | | }
5252
| |_^
5353

54-
error: missing documentation for an associated function
54+
error: missing documentation for a method
5555
--> $DIR/missing_doc_impl.rs:44:5
5656
|
5757
LL | fn foo(&self);
5858
| ^^^^^^^^^^^^^^
5959

60-
error: missing documentation for an associated function
60+
error: missing documentation for a method
6161
--> $DIR/missing_doc_impl.rs:45:5
6262
|
6363
LL | fn foo_with_impl(&self) {}

0 commit comments

Comments
 (0)