Skip to content

Added regression test for issue #53156 - #166231

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
HaineSensei:issue-53156-test
Nov 25, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
HaineSensei:issue-53156-test

Conversation

@HaineSensei

@HaineSensei HaineSensei commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Added regression test for issue #53156.
Includes the issue's 3a and 3b on top of 1a and 2a in both impl and top-level versions.
Does not include 3c since it should fail to compile: the lifetime of the &self parameter may not outlive the lifetime 'a required.
Also included a -Znext-solver revision as it also compiles cleanly with the next-solver so failing with it would be a regression.

Closes #53156.

@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 Nov 20, 2026
@rustbot

rustbot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @panstromek (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

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

@rustbot

This comment has been minimized.

@HaineSensei
HaineSensei force-pushed the issue-53156-test branch 2 times, most recently from 6a98b80 to ded1b6a Compare November 20, 2026 01:59
@panstromek

panstromek commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Does not include 3c since it should fail to compile

Does it make sense to add a test for checking that it fails then?


Other than that, It looks ok, but I feel like I have very little context around this issue (it's 8 years old), so I can't tell what we're testing exactly (implementation wise). I'd ask somebody closer to this part of the type system.

r? jackh726 maybe

@rustbot rustbot assigned jackh726 and unassigned panstromek Nov 20, 2026
@HaineSensei

Copy link
Copy Markdown
Contributor Author

I just went back to check, and 3c was acting correctly with each of the 1 and 2 alternatives when the bug was reported. So it wouldn't really test a regression for anything that fixed this issue.

It would still test for a regression of course, just kinda unrelated to the issue.

@jackh726

Copy link
Copy Markdown
Member

Given that the original issue gives multiple variants with different behavior, it would be good ensure those get captured in the test.

@HaineSensei

Copy link
Copy Markdown
Contributor Author

So just include all the variants, including the ones that weren't incorrect before and the ones that should fail as failing?

@jackh726

Copy link
Copy Markdown
Member

Yes

@HaineSensei

Copy link
Copy Markdown
Contributor Author

Added all the variants now

@jackh726

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 54b1675 has been approved by jackh726

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 Nov 24, 2026
clarfonthey added a commit to clarfonthey/rust that referenced this pull request Nov 25, 2026
…ckh726

Added regression test for issue rust-lang#53156

Added regression test for issue rust-lang#53156.
Includes the issue's 3a and 3b on top of 1a and 2a in both impl and top-level versions.
Does not include 3c since it should fail to compile: the lifetime of the `&self` parameter may not outlive the lifetime `'a` required.
Also included a -Znext-solver revision as it also compiles cleanly with the next-solver so failing with it would be a regression.

Closes rust-lang#53156.
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 25, 2026
…ckh726

Added regression test for issue rust-lang#53156

Added regression test for issue rust-lang#53156.
Includes the issue's 3a and 3b on top of 1a and 2a in both impl and top-level versions.
Does not include 3c since it should fail to compile: the lifetime of the `&self` parameter may not outlive the lifetime `'a` required.
Also included a -Znext-solver revision as it also compiles cleanly with the next-solver so failing with it would be a regression.

Closes rust-lang#53156.
rust-bors Bot pushed a commit that referenced this pull request Nov 25, 2026
Rollup of 5 pull requests

Successful merges:

 - #166438 (add test checking that -Ctarget-feature implies cfg(target_feature))
 - #165624 (feat(time): add `Duration` extractors for units larger than second)
 - #166231 (Added regression test for issue #53156 )
 - #166401 (Add explanatory comment and rename alias )
 - #166520 (Fix typo in ConstItemInteriorMutationsDiag struct)
rust-bors Bot pushed a commit that referenced this pull request Nov 25, 2026
Rollup of 9 pull requests

Successful merges:

 - #166438 (add test checking that -Ctarget-feature implies cfg(target_feature))
 - #166536 (Make `issue-96797.rs` link again)
 - #165624 (feat(time): add `Duration` extractors for units larger than second)
 - #166231 (Added regression test for issue #53156 )
 - #166401 (Add explanatory comment and rename alias )
 - #166520 (Fix typo in ConstItemInteriorMutationsDiag struct)
 - #166540 (Return `Err` from `send_process_group_signal` if leader has been awaited)
 - #166544 (rustc-dev-guide subtree update)
 - #166545 (Run more autodiff tests in CI)
@rust-bors
rust-bors Bot merged commit 27e760d into rust-lang:main Nov 25, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 25, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 25, 2026
Rollup merge of #166231 - HaineSensei:issue-53156-test, r=jackh726

Added regression test for issue #53156

Added regression test for issue #53156.
Includes the issue's 3a and 3b on top of 1a and 2a in both impl and top-level versions.
Does not include 3c since it should fail to compile: the lifetime of the `&self` parameter may not outlive the lifetime `'a` required.
Also included a -Znext-solver revision as it also compiles cleanly with the next-solver so failing with it would be a regression.

Closes #53156.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Development

Successfully merging this pull request may close these issues.

Unused trait bound with lifetime causes compile error

4 participants