rust/tests/ui/lint/dead-code
bors 4bc39f028d Auto merge of #120924 - xFrednet:rfc-2383-stabilization-party, r=Urgau,blyxyas
Let's `#[expect]` some lints: Stabilize `lint_reasons` (RFC 2383)

Let's give this another try! The [previous stabilization attempt](https://github.com/rust-lang/rust/pull/99063) was stalled by some unresolved questions. These have been discussed in a [lang team](https://github.com/rust-lang/lang-team/issues/191) meeting. The last open question, regarding the semantics of the `#[expect]` attribute was decided on in https://github.com/rust-lang/rust/issues/115980

I've just updated the [stabilization report](https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964) with the discussed questions and decisions. Luckily, the decision is inline with the current implementation.

This hopefully covers everything. Let's hope that the CI will be green like the spring.

fixes #115980
fixes #54503

---

r? `@wesleywiser`

Tacking Issue: https://github.com/rust-lang/rust/issues/54503
Stabilization Report: https://github.com/rust-lang/rust/issues/54503#issuecomment-1179563964
Documentation Update: https://github.com/rust-lang/reference/pull/1237

<!--
For Clippy:

changelog: [`allow_attributes`]: Is now available on stable, since the `lint_reasons` feature was stabilized
changelog: [`allow_attributes_without_reason`]: Is now available on stable, since the `lint_reasons` feature was stabilized
-->

---

Roses are red,
Violets are blue,
Let's expect lints,
With reason clues
2024-06-26 16:38:30 +00:00
..
alias-in-pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
allow-or-expect-dead_code-114557-2.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
allow-or-expect-dead_code-114557-2.stderr RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
allow-or-expect-dead_code-114557-3.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
allow-or-expect-dead_code-114557-3.stderr RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
allow-or-expect-dead_code-114557.rs RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
allow-unconstructed-pub-struct.rs Add pub struct with allow(dead_code) into worklist 2024-06-12 17:58:20 +08:00
anon-const-in-pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
associated-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
basic.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
basic.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
closure-bang.rs Unignore closure-bang. 2023-04-15 14:43:20 -07:00
closure-bang.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-and-self.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-and-self.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
empty-unused-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
empty-unused-enum.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
empty-unused-public-enum.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
enum-variants.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
impl-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-trait.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
in-closure.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
in-closure.stderr Lint dead code in closures 2023-02-22 15:27:19 +00:00
issue-41883.rs Make traits / trait methods detected by the dead code lint! 2024-02-07 10:22:16 +08:00
issue-41883.stderr Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
issue-59003.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-68408-false-positive.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85071-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85071-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85071.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85071.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85255.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85255.stderr dead-code-lint: de-dup multiple unused assoc fns 2023-04-13 22:42:47 +12:00
leading-underscore.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-dead-code-1.rs Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
lint-dead-code-1.stderr Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
lint-dead-code-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-3.rs diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
lint-dead-code-3.stderr dead-code-lint: de-dup multiple unused assoc fns 2023-04-13 22:42:47 +12:00
lint-dead-code-4.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-4.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint-dead-code-5.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
lint-dead-code-5.stderr Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
lint-dead-code-6.rs dead-code-lint: de-dup multiple unused assoc fns 2023-04-13 22:42:47 +12:00
lint-dead-code-6.stderr dead-code-lint: de-dup multiple unused assoc fns 2023-04-13 22:42:47 +12:00
multiple-dead-codes-in-the-same-struct.rs Update tests 2024-02-07 10:42:01 +08:00
multiple-dead-codes-in-the-same-struct.stderr Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
newline-span.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
newline-span.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
offset-of-correct-param-env.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
offset-of.rs Stabilize simple offset_of 2024-01-19 20:38:51 +00:00
offset-of.stderr bless 2023-04-21 02:14:03 -07:00
pub-field-in-priv-mod.rs Replace visibility test with reachability test in dead code detection 2024-03-12 10:59:40 +01:00
pub-field-in-priv-mod.stderr Replace visibility test with reachability test in dead code detection 2024-03-12 10:59:40 +01:00
self-assign.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
self-assign.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
trait-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
tuple-struct-field.rs Suggest removing unused tuple fields if they are the last fields 2024-05-13 17:42:44 +05:30
tuple-struct-field.stderr Suggest removing unused tuple fields if they are the last fields 2024-05-13 17:42:44 +05:30
type-alias.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-alias.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-in-foreign.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-in-transparent.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-adt-impl-pub-trait-with-assoc-const.rs Detect pub structs never constructed even though they impl pub trait with assoc constants 2024-06-12 23:31:27 +08:00
unused-adt-impl-pub-trait-with-assoc-const.stderr Detect pub structs never constructed even though they impl pub trait with assoc constants 2024-06-12 23:31:27 +08:00
unused-adt-impls-pub-trait.rs Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
unused-adt-impls-pub-trait.stderr Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
unused-adt-impls-trait.rs Detect unused structs which implement private traits 2024-05-23 09:07:59 +08:00
unused-adt-impls-trait.stderr Detect unused structs which implement private traits 2024-05-23 09:07:59 +08:00
unused-assoc-const.rs Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
unused-assoc-const.stderr Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
unused-assoc-fns.rs impl reviewer feedback 2023-04-13 23:39:14 +12:00
unused-assoc-fns.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-enum.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-pub-struct.rs Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
unused-pub-struct.stderr Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
unused-struct-derive-default.rs Detect unused structs which derived Default 2024-06-25 23:29:44 +08:00
unused-struct-derive-default.stderr Detect unused structs which derived Default 2024-06-25 23:29:44 +08:00
unused-struct-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-struct-variant.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-trait-with-assoc-ty.rs Mark assoc tys live only if the trait is live 2024-06-18 16:00:57 +08:00
unused-trait-with-assoc-ty.stderr Mark assoc tys live only if the trait is live 2024-06-18 16:00:57 +08:00
unused-variant-pub.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-variant.rs Show notice about "never used" for enum 2024-06-16 18:33:51 +09:00
unused-variant.stderr Show notice about "never used" for enum 2024-06-16 18:33:51 +09:00
with-core-crate.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
with-core-crate.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
with-impl.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00