SIGN IN SIGN UP
rust-lang / rust UNCLAIMED

Empowering everyone to build reliable and efficient software.

0 0 65 Rust

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 rust-lang/rust#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 rust-lang/rust#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`
M
Matthias Krüger committed
05287d1e81a9f179064bf453654d5df821a8da1b
Committed by GitHub <noreply@github.com> on 12/27/2025, 9:36:36 PM