rust/tests/ui/lint/unused
Trevor Gross fcbf4ac6f9
Rollup merge of #131546 - surechen:fix_129833, r=jieyouxu
Make unused_parens's suggestion considering expr's attributes.

For the expr with attributes,
like `let _ = (#[inline] || println!("Hello!"));`,
the suggestion's span should contains the attributes, or the suggestion will remove them.

fixes #129833
2024-10-11 23:57:46 -04:00
..
auxiliary [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_parens skip unused_parens's suggestion for Paren in macro. 2024-04-10 17:56:43 +08:00
assoc-types.assoc_ty.stderr Enforce must_use on associated types and RPITITs 2023-11-30 02:24:52 +00:00
assoc-types.rpitit.stderr Enforce must_use on associated types and RPITITs 2023-11-30 02:24:52 +00:00
assoc-types.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-local-var.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
import_remove_line.fixed If suggestion would leave an empty line, delete it 2024-03-01 13:48:20 +00:00
import_remove_line.rs If suggestion would leave an empty line, delete it 2024-03-01 13:48:20 +00:00
import_remove_line.stderr Make early lints translatable 2024-05-21 20:16:39 +00:00
issue-30730.rs
issue-30730.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-46576.rs
issue-46576.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-47390-unused-variable-in-struct-pattern.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-47390-unused-variable-in-struct-pattern.stderr
issue-54180-unused-ref-field.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54180-unused-ref-field.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54180-unused-ref-field.stderr
issue-54538-unused-parens-lint.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54538-unused-parens-lint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54538-unused-parens-lint.stderr emit unused_parens for break if it is not immediately followed by a block 2023-04-13 18:09:47 +02:00
issue-59896.rs Introduce REDUNDANT_IMPORTS lint 2024-07-31 00:07:42 -04:00
issue-59896.stderr Introduce REDUNDANT_IMPORTS lint 2024-07-31 00:07:42 -04:00
issue-67691-unused-field-in-or-pattern.rs
issue-67691-unused-field-in-or-pattern.stderr
issue-70041.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-70041.stderr
issue-71290-unused-paren-binop.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-74883-unused-paren-baren-yield.rs Error on using yield without also using #[coroutine] on the closure 2024-04-24 08:05:29 +00:00
issue-74883-unused-paren-baren-yield.stderr
issue-81314-unused-span-ident.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-81314-unused-span-ident.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-81314-unused-span-ident.stderr
issue-85913.rs
issue-85913.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-88519-unused-paren.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-90807-unused-paren-error.rs
issue-90807-unused-paren-error.stderr
issue-90807-unused-paren.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-92751.rs
issue-92751.stderr
issue-96606.rs Emit warnings on unused parens/braces in index expressions 2023-02-02 12:46:31 -07:00
issue-96606.stderr Emit warnings on unused parens/braces in index expressions 2023-02-02 12:46:31 -07:00
issue-103320-must-use-ops.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-103320-must-use-ops.stderr Fix #103320, add explanatory message for [#must_use] 2023-02-04 00:27:03 +08:00
issue-104397.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-105061-array-lint.rs
issue-105061-array-lint.stderr
issue-105061-should-lint.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
issue-105061-should-lint.stderr
issue-105061.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
issue-105061.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-117142-invalid-remove-parens.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-117284-arg-in-macro.rs Fix #117284, Fix unused variables lint issue for args in macro 2023-10-30 21:35:18 +08:00
issue-117284-arg-in-macro.stderr Fix #117284, Fix unused variables lint issue for args in macro 2023-10-30 21:35:18 +08:00
issue-119383-if-let-guard.rs Rename test 2023-12-29 13:49:23 +01:00
issue-119383-if-let-guard.stderr Rename test 2023-12-29 13:49:23 +01:00
lint-unused-extern-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-extern-crate.stderr
lint-unused-imports.rs Make early lints translatable 2024-05-21 20:16:39 +00:00
lint-unused-imports.stderr Make early lints translatable 2024-05-21 20:16:39 +00:00
lint-unused-mut-self.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-mut-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-mut-self.stderr
lint-unused-mut-variables.rs stabilize raw_ref_op 2024-08-18 19:46:53 +02:00
lint-unused-mut-variables.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
lint-unused-variables.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-variables.stderr Stop using a special inner body for the coroutine by-move body for async closures 2024-08-26 18:44:19 -04:00
must_use-array.rs
must_use-array.stderr
must_use-in-stdlib-traits.rs
must_use-in-stdlib-traits.stderr
must_use-pin.rs add test for pinned must_use pointers 2023-11-18 21:01:02 -08:00
must_use-pin.stderr add test for pinned must_use pointers 2023-11-18 21:01:02 -08:00
must_use-trait.rs
must_use-trait.stderr
must_use-tuple.rs
must_use-tuple.stderr
must_use-unit.rs
must_use-unit.stderr error-msg: expand suggestion for unused lint 2023-03-15 23:30:12 +13:00
must-use-block-expr.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
must-use-block-expr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
must-use-block-expr.stderr Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
must-use-box-from-raw.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
must-use-box-from-raw.stderr error-msg: expand suggestion for unused lint 2023-03-15 23:30:12 +13:00
must-use-foreign.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
must-use-ops.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
must-use-ops.stderr
no-unused-parens-return-block.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-alias-supertrait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_attributes-must_use.rs
unused_attributes-must_use.stderr error-msg: expand suggestion for unused lint 2023-03-15 23:30:12 +13:00
unused-allocation.rs Remove feature(box_syntax) from unused allocation list test 2023-03-03 19:02:35 +00:00
unused-allocation.stderr Remove feature(box_syntax) from unused allocation list test 2023-03-03 19:02:35 +00:00
unused-associated-item.rs Split item bounds and item super predicates 2024-03-20 13:00:34 -04:00
unused-async.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-async.stderr Dont check must_use on nested impl Future from fn 2023-05-12 02:08:43 +00:00
unused-attr-duplicate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-attr-duplicate.stderr
unused-attr-macro-rules.rs
unused-attr-macro-rules.stderr
unused-closure.rs Error on using yield without also using #[coroutine] on the closure 2024-04-24 08:05:29 +00:00
unused-closure.stderr
unused-doc-comments-edge-cases.rs Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davidtwco" 2024-06-06 20:39:54 +00:00
unused-doc-comments-edge-cases.stderr Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davidtwco" 2024-06-06 20:39:54 +00:00
unused-doc-comments-for-macros.rs
unused-doc-comments-for-macros.stderr
unused-macro-rules-compile-error.rs Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-rules-compile-error.stderr Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-rules-decl.rs Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-rules-decl.stderr Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-rules-malformed-rule.rs
unused-macro-rules-malformed-rule.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-macro-rules.rs Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-rules.stderr Remove ordinalize. 2024-05-10 16:42:09 +10:00
unused-macro-with-bad-frag-spec.rs
unused-macro-with-bad-frag-spec.stderr Stabilize expr_2021 fragment in all editions 2024-10-01 07:51:58 +00:00
unused-macro-with-follow-violation.rs
unused-macro-with-follow-violation.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-macros-decl.rs
unused-macros-decl.stderr
unused-macros-malformed-rule.rs
unused-macros-malformed-rule.stderr
unused-macros.rs
unused-macros.stderr
unused-mut-warning-captured-var.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-mut-warning-captured-var.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-mut-warning-captured-var.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-parens-for-stmt-expr-attributes-issue-129833.fixed Make unused_parens's suggestion considering expr's attributes 2024-10-12 09:32:25 +08:00
unused-parens-for-stmt-expr-attributes-issue-129833.rs Make unused_parens's suggestion considering expr's attributes 2024-10-12 09:32:25 +08:00
unused-parens-for-stmt-expr-attributes-issue-129833.stderr Make unused_parens's suggestion considering expr's attributes 2024-10-12 09:32:25 +08:00
unused-parens-issue-106413.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-parens-issue-106413.stderr diagnostics: avoid wrong unused_parens on x as (T) < y 2023-08-31 20:14:49 -07:00
unused-result.rs
unused-result.stderr error-msg: expand suggestion for unused lint 2023-03-15 23:30:12 +13:00
unused-supertrait.rs
unused-supertrait.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
useless-comment.rs
useless-comment.stderr