about summary refs log tree commit diff
path: root/tests/ui/lint
AgeCommit message (Collapse)AuthorLines
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-12Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgrbors-2/+2
Rollup of 8 pull requests Successful merges: - #110153 (Fix typos in compiler) - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript) - #110175 (Symbol cleanups) - #110203 (Remove `..` from return type notation) - #110205 (rustdoc: make settings radio and checks thicker, less contrast) - #110222 (Improve the error message when forwarding a matched fragment to another macro) - #110237 (Split out a separate feature gate for impl trait in associated types) - #110241 (tidy: Issue an error when UI test limits are too high) Failed merges: - #110218 (Remove `ToRegionVid`) r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-2/+2
2023-04-12Rollup merge of #110209 - JohnTitor:issue-59003, r=compiler-errorsMatthias Krüger-0/+18
Add regression test for #59003 Closes #59003 r? compiler-errors
2023-04-12Add regression test for #59003Yuki Okushi-0/+18
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-11Broken testsMichael Goulet-0/+15
2023-04-04Do not suppress temporary_cstring_as_ptr in macros.Camille GILLOT-2/+25
2023-04-04Auto merge of #109599 - notriddle:notriddle/use-redundant-glob, r=petrochenkovbors-0/+121
diagnostics: account for glob shadowing when linting redundant imports Fixes #92904
2023-04-01diagnostics: account for glob shadowing when linting redundant importsMichael Howell-0/+121
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-03-29add run-rustfixMu42-2/+10
2023-03-25tests: make directory for use redundant lintMichael Howell-0/+0
2023-03-25Emits suggestions for expressions with parentheses or not separatelyMu001999-11/+15
2023-03-24Use independent suggestionsMu42-3/+11
2023-03-24Suggest ..= when someone tries to create an overflowing rangeMu42-0/+15
2023-03-22Update anonymous-reexport UI testGuillaume Gomez-39/+26
2023-03-20fix ClashingExternDeclarations lint ICEDaniPopes-13/+38
2023-03-19Rollup merge of #109003 - GuillaumeGomez:useless-anonymous-reexport-lint, ↵Dylan DPC-0/+76
r=cjgillot Add `useless_anonymous_reexport` lint This is a follow-up of https://github.com/rust-lang/rust/pull/108936. We once again show all anonymous re-exports in rustdoc, however we also wanted to add a lint to let users know that it very likely doesn't have the effect they think it has.
2023-03-16Rollup merge of #109158 - Ezrashaw:expand-sugg-for-unused-lint, r=NilstriebMatthias Krüger-0/+112
error-msg: expand suggestion for `unused_def` lint Fixes #108885 Expands `let _ = ..` suggestion into more positions.
2023-03-15error-msg: expand suggestion for unused lintEzra Shaw-0/+112
2023-03-15Fix #109152, fix the scenario that we may can not get span of funcyukang-0/+30
2023-03-12Update failing ui testsGuillaume Gomez-1/+41
2023-03-12Add test for useless_anonymous_reexport lintGuillaume Gomez-0/+36
2023-03-11Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=NilstriebMatthias Krüger-0/+27
Make `unused_allocation` lint against `Box::new` too Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something :shrug: This means that code like the following will be linted against: ```rust Box::new([1, 2, 3]).len(); f(&Box::new(1)); // where f : &i32 -> () ``` The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against: ```rust let boxed = Box::new([1, 2, 3]); // no lint boxed.len(); ```
2023-03-06Add regression test for 98444Albert Larsan-0/+17
2023-03-03Remove `feature(box_syntax)` from unused allocation list testMaybe Waffle-4/+4
2023-03-03Add a test for `unused_allocation` lintMaybe Waffle-0/+27
(how come we didn't have one already??)
2023-03-01Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkovMatthias Krüger-68/+4
Exit when there are unmatched delims to avoid noisy diagnostics From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832 r? ``@petrochenkov``
2023-02-28remove duplicated diagnostic for unclosed delimiteryukang-42/+2
2023-02-28Exit when there are unmatched delims to avoid noisy diagnosticsyukang-32/+8
2023-02-23Add ui test for `E0271` errorObei Sideg-0/+24
2023-02-23Add ui test for `map_unit_fn` lint in closure caseObei Sideg-1/+51
2023-02-23Add ui test for `map_unit_fn` lintObei Sideg-0/+36
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-217/+231
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-217/+231
2023-02-22Lint dead code in closuresclubby789-0/+36
2023-02-21Rollup merge of #108000 - y21:no-zero-init-for-uninhabited, r=jackh726Dylan DPC-32/+8
lint: don't suggest MaybeUninit::assume_init for uninhabited types Creating a zeroed uninhabited type such as `!` or an empty enum with `mem::zeroed()` (or transmuting `()` to `!`) currently triggers this lint: ```rs warning: the type `!` does not permit zero-initialization --> test.rs:5:23 | 5 | let _val: ! = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | = note: the `!` type has no valid value ``` The `MaybeUninit` suggestion in the help message seems confusing/useless for uninhabited types, as such a type cannot be fully initialized in the first place (as the note implies). This PR limits this help message to inhabited types which can be initialized
2023-02-19Auto merge of #108128 - clubby789:builtin-derived-attr, r=jackh726bors-24/+36
Properly check for builtin derived code Fixes #108122
2023-02-18lint: don't suggest assume_init for uninhabited typesy21-32/+8
2023-02-17Don't eagerly convert principal to stringclubby789-0/+15
2023-02-16Properly check for builtin derivesclubby789-24/+36
2023-02-14Don't ICE in might_permit_raw_init if reference is polymorphicMichael Goulet-0/+8
2023-02-10Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiserMatthias Krüger-1/+1
Support `true` and `false` as boolean flag params Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-06Auto merge of #103761 - chenyukang:yukang/fix-103320-must-use, r=compiler-errorsbors-0/+94
Add explanatory message for [#must_use] in ops Fixes #103320
2023-02-03Rollup merge of #107539 - PossiblyAShrub:unused-parens-in-index, r=lcnrDylan DPC-0/+41
Emit warnings on unused parens in index expressions Fixes: #96606. I am not sure what the best term for "index expression" is. Is there a better term we could use?
2023-02-04Fix #103320, add explanatory message for [#must_use]yukang-0/+94
2023-02-02Emit warnings on unused parens/braces in index expressionsAidan Olsen-0/+41
2023-01-31make unaligned_reference a hard errorRalf Jung-251/+21
2023-01-30Modify primary span label for E0308Esteban Küber-1/+1
The previous output was unintuitive to users.