Skip to content

Conversation

@AprilNEA
Copy link
Contributor

@AprilNEA AprilNEA commented Dec 27, 2025

Summary

Adds UI tests for issue #125364, which involves the interaction between
never type fallback, try blocks, and From/Into trait bounds.

Changes

  • Added tests/ui/never_type/try-block-never-type-fallback.rs
  • Tests both edition 2021 (where the issue manifests) and edition 2024 (where it's fixed)

Issue

Closes #125364

Testing

./x test tests/ui/never_type/try-block-never-type-fallback.rs

Both test variants pass:

e2021: Correctly fails with expected error
e2024: Compiles successfully (check-pass)

Notes

This test documents the edition-dependent behavior of never type fallback in try blocks, as requested in the original issue.

cc @WaffleLapkin

Closes rust-lang#125364

This test verifies that the never type fallback behavior
in try blocks with `Into<!>` bounds works correctly across
different editions:

- Edition 2021: Fallback to `()` causes type error
- Edition 2024: Fallback to `!` compiles successfully
@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 Dec 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 27, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
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

@rustbot
Copy link
Collaborator

rustbot commented Dec 27, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@AprilNEA
Copy link
Contributor Author

r?@WaffleLapkin

@rustbot rustbot assigned WaffleLapkin and unassigned davidtwco Dec 27, 2025
@WaffleLapkin
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 27, 2025

📌 Commit f29c516 has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors 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 Dec 27, 2025
bors added a commit that referenced this pull request Dec 27, 2025
Rollup of 3 pull requests

Successful merges:

 - #148533 (Split LLVM intrinsic abi handling from the rest of the abi handling)
 - #150358 (fix rustfmt on `const impl Ty {}`)
 - #150434 (Add test for never type fallback in try blocks with `Into<!>`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 05287d1 into rust-lang:main Dec 28, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Dec 28, 2025
Rollup merge of #150434 - AprilNEA:test-125364-never-type-try-blocks, r=WaffleLapkin

Add test for never type fallback in try blocks with `Into<!>`

### Summary

Adds UI tests for issue #125364, which involves the interaction between
never type fallback, try blocks, and `From`/`Into` trait bounds.

### Changes

- Added `tests/ui/never_type/try-block-never-type-fallback.rs`
- Tests both edition 2021 (where the issue manifests) and edition 2024 (where it's fixed)

### Issue

Closes #125364

### Testing

```bash
./x test tests/ui/never_type/try-block-never-type-fallback.rs
```

Both test variants pass:

e2021: Correctly fails with expected error
e2024: Compiles successfully (check-pass)

### Notes

This test documents the edition-dependent behavior of never type fallback in try blocks, as requested in the original issue.

cc `@WaffleLapkin`
@rustbot rustbot added this to the 1.94.0 milestone Dec 28, 2025
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.

Bad interaction between never_type, try_blocks, and From/Into

5 participants