Skip to content

Add regression tests for fixed dead-code issues - #160044

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mu001999-contrib:add-tests
Jul 31, 2026
Merged

Add regression tests for fixed dead-code issues#160044
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mu001999-contrib:add-tests

Conversation

@mu001999

@mu001999 mu001999 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes #56750 (fixed by #142485)
Fixes #102190 (fixed by #102538)
Fixes #102217 (fixed by #102538)
Fixes #148861 (fixed by #154377)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

r? @hanna-kruppe

rustbot has assigned @hanna-kruppe.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 74 candidates
  • Random selection from 19 candidates

@@ -0,0 +1,19 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/102190>

@mu001999 mu001999 Jul 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this also covers #102217

View changes since the review

use proc_macro::{Delimiter, Group, Ident, TokenStream, TokenTree};

#[proc_macro_derive(Test)]
pub fn derive(input: TokenStream) -> TokenStream {

@chenyukang chenyukang Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how this helper file comes from?
you want to simply the test for #102217 without Cargo.toml, syn etc?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for #102190, but I found it has the same root case with #102217.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have concern about #102217, I think it's okay to remove the line fixing it from the PR description.


use generate_inherent_impl_with_input_spans::Test;

#[allow(dead_code)]

@chenyukang chenyukang Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original test code from #102190 is much different with our new generate-inherent-impl-with-input-spans.rs?

View changes since the review

@mu001999 mu001999 Jul 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we cannot use proc_macro2 directly in our test suite. So we have to construct the test case using proc_macro manually. The core part of the original case is using input span for the beginning and ending of the fn header.

@mu001999 mu001999 added the L-dead_code Lint: dead_code label Jul 28, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor

r? @chenyukang

@rustbot rustbot assigned chenyukang and unassigned hanna-kruppe Jul 28, 2026
@chenyukang

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 842907b has been approved by chenyukang

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 30, 2026
…yukang

Add regression tests for fixed dead-code issues

Fixes rust-lang#56750 (fixed by rust-lang#142485)
Fixes rust-lang#102190 (fixed by rust-lang#102538)
Fixes rust-lang#102217 (fixed by rust-lang#102538)
Fixes rust-lang#148861 (fixed by rust-lang#154377)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 30, 2026
…yukang

Add regression tests for fixed dead-code issues

Fixes rust-lang#56750 (fixed by rust-lang#142485)
Fixes rust-lang#102190 (fixed by rust-lang#102538)
Fixes rust-lang#102217 (fixed by rust-lang#102538)
Fixes rust-lang#148861 (fixed by rust-lang#154377)
rust-bors Bot pushed a commit that referenced this pull request Jul 30, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159817 (Rename splat to avoid stable name collisions)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160147 (tests: Remove `-Zthreads` options from tests in `ui/parallel-rustc`)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 30, 2026
…yukang

Add regression tests for fixed dead-code issues

Fixes rust-lang#56750 (fixed by rust-lang#142485)
Fixes rust-lang#102190 (fixed by rust-lang#102538)
Fixes rust-lang#102217 (fixed by rust-lang#102538)
Fixes rust-lang#148861 (fixed by rust-lang#154377)
rust-bors Bot pushed a commit that referenced this pull request Jul 30, 2026
Rollup of 14 pull requests

Successful merges:

 - #159817 (Rename splat to avoid stable name collisions)
 - #160204 (Sync from portable simd 2026 07 30)
 - #150885 (Revive L4Re target)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #160204 (Sync from portable simd 2026 07 30)
 - #138230 (Add `raw_borrows_via_references` lint)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - #160031 (std: make positioned I/O unsupported on VxWorks)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #159955 (Stop using higher-order macros to declare arenas)
 - #159958 (Fix avoid cycle for self referential return type notation)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160177 (A few more "predicate"-to-"clause" renamings)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - #160192 (Fix ICE for parsing issue with a closing brace)
 - #160209 (bootstrap: Remove method `Subcommand::kind`)
 - #160221 (Remove `Copy` supertrait from `VaList`)
 - #160223 (interpret: rename validate_operand → validate_place)
 - #160234 (Always use short ty path for call with missing arguments suggestion)
rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #160204 (Sync from portable simd 2026 07 30)
 - #138230 (Add `raw_borrows_via_references` lint)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - #160031 (std: make positioned I/O unsupported on VxWorks)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #159955 (Stop using higher-order macros to declare arenas)
 - #159958 (Fix avoid cycle for self referential return type notation)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160177 (A few more "predicate"-to-"clause" renamings)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - #160192 (Fix ICE for parsing issue with a closing brace)
 - #160209 (bootstrap: Remove method `Subcommand::kind`)
 - #160221 (Remove `Copy` supertrait from `VaList`)
 - #160223 (interpret: rename validate_operand → validate_place)
 - #160234 (Always use short ty path for call with missing arguments suggestion)
@rust-bors
rust-bors Bot merged commit 357b14f into rust-lang:main Jul 31, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 31, 2026
rust-timer added a commit that referenced this pull request Jul 31, 2026
Rollup merge of #160044 - mu001999-contrib:add-tests, r=chenyukang

Add regression tests for fixed dead-code issues

Fixes #56750 (fixed by #142485)
Fixes #102190 (fixed by #102538)
Fixes #102217 (fixed by #102538)
Fixes #148861 (fixed by #154377)
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Jul 31, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - rust-lang/rust#160204 (Sync from portable simd 2026 07 30)
 - rust-lang/rust#138230 (Add `raw_borrows_via_references` lint)
 - rust-lang/rust#158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - rust-lang/rust#160015 (refactor(mir-transform): Merge `can_be_overridden`, `is_required` and `is_enabled` into one)
 - rust-lang/rust#160031 (std: make positioned I/O unsupported on VxWorks)
 - rust-lang/rust#160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - rust-lang/rust#160152 (Create on-demand CI job for testing EC2 instances)
 - rust-lang/rust#160232 (rustdoc: fix ICE when a grapheme cluster joins a Prepend-class character to `_` or `:`)
 - rust-lang/rust#159214 (std: improve the documentation of the random feature)
 - rust-lang/rust#159818 (Resolve vars before calling `unnormalized_obligations`)
 - rust-lang/rust#159955 (Stop using higher-order macros to declare arenas)
 - rust-lang/rust#159958 (Fix avoid cycle for self referential return type notation)
 - rust-lang/rust#160040 (Split function parsing out of `item.rs` to a new module.)
 - rust-lang/rust#160044 (Add regression tests for fixed dead-code issues)
 - rust-lang/rust#160144 (renovate: group lockfiles PRs)
 - rust-lang/rust#160149 (Fix Windows on Arm PAC default)
 - rust-lang/rust#160164 (Derive `GenericTypeVisitable` for `RegionConstraint`)
 - rust-lang/rust#160175 (Try to recover less from incorrectly parsed const arg)
 - rust-lang/rust#160177 (A few more "predicate"-to-"clause" renamings)
 - rust-lang/rust#160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
 - rust-lang/rust#160192 (Fix ICE for parsing issue with a closing brace)
 - rust-lang/rust#160209 (bootstrap: Remove method `Subcommand::kind`)
 - rust-lang/rust#160221 (Remove `Copy` supertrait from `VaList`)
 - rust-lang/rust#160223 (interpret: rename validate_operand → validate_place)
 - rust-lang/rust#160234 (Always use short ty path for call with missing arguments suggestion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L-dead_code Lint: dead_code S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

4 participants