Urgau
d801a2ff15
Respect #[expect]
the same way #[allow]
is with the dead_code
lint
2023-08-10 22:57:48 +02:00
DrMeepster
a642563d49
major test improvements
2023-04-21 02:45:48 -07:00
DrMeepster
f92294f76b
bless
2023-04-21 02:14:03 -07:00
DrMeepster
2bcb018253
fmt
2023-04-21 02:14:03 -07:00
DrMeepster
b92c2f792c
fix incorrect param env in dead code lint
2023-04-21 02:14:03 -07:00
Eric Huss
d7ed5a52ff
Unignore closure-bang.
...
This test was ignored long ago in
https://github.com/rust-lang/rust/pull/20578/ when the syntax for
closures was changed.
The current status is that a closure with an explicit `!` return type
will trigger the `unreachable_code` lint which appears to be the
original intent of the test
(https://github.com/rust-lang/rust/pull/16836 ). A closure without a
return type won't trigger the lint since the `!` type isn't inferred
(AFAIK). This restores the test to its original form.
2023-04-15 14:43:20 -07:00
Ezra Shaw
39e23ef532
impl reviewer feedback
...
- remove unused (pun intentional) `continue`
- improve wording with assoc items in general
2023-04-13 23:39:14 +12:00
Ezra Shaw
c41dcac8e8
dead-code-lint: de-dup multiple unused assoc fns
2023-04-13 22:42:47 +12:00
Ezra Shaw
03cf0e949f
refactor: emit "unused assoc fn" in lexical order
...
with repect to other dead code lints
2023-04-13 20:53:32 +12:00
Yuki Okushi
06ec5faccb
Add regression test for #59003
...
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-12 06:24:49 +09:00
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
Michael Howell
3f374128ee
diagnostics: update test cases to refer to assoc fn with self
as method
2023-02-22 08:40:47 -07:00
clubby789
c7a4f387fd
Lint dead code in closures
2023-02-22 15:27:19 +00:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests
2023-01-11 09:32:08 +00:00