about summary refs log tree commit diff
path: root/tests/ui/lint/dead-code
AgeCommit message (Collapse)AuthorLines
2023-11-24Show number in error message even for one errorNilstrieb-9/+9
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-08-10Respect `#[expect]` the same way `#[allow]` is with the `dead_code` lintUrgau-0/+70
2023-04-21major test improvementsDrMeepster-1/+1
2023-04-21blessDrMeepster-6/+6
2023-04-21fmtDrMeepster-6/+8
2023-04-21fix incorrect param env in dead code lintDrMeepster-0/+134
2023-04-15Unignore closure-bang.Eric Huss-3/+18
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-13impl reviewer feedbackEzra Shaw-6/+22
- remove unused (pun intentional) `continue` - improve wording with assoc items in general
2023-04-13dead-code-lint: de-dup multiple unused assoc fnsEzra Shaw-55/+40
2023-04-13refactor: emit "unused assoc fn" in lexical orderEzra Shaw-26/+80
with repect to other dead code lints
2023-04-12Add regression test for #59003Yuki Okushi-0/+18
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-14/+14
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-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-14/+14
2023-02-22Lint dead code in closuresclubby789-0/+36
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1735