rust-lang / rust-lang/rust

Warn if supposedly unreachable code is provably reachable

Open
#131,167 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lints C-feature-request T-compiler T-lang
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Code

if true { unsafe { unreachable_unchecked() } };
if true { unreachable!() };

Current output

No warnings

Desired output
  1. warning: this is ub if called...
  2. warning: this will panic when called...
Rationale and extra context

No response

Other cases

No response

Rust Version

rustc 1.83.0-nightly (c52c23b6f 2024-09-16)

Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or compiler entry points. Reproduce the examples with rustc 1.83.0-nightly and trace the existing unreachable-code analysis; done means the two examples produce the requested warnings without warnings for genuinely unreachable code.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.