never type appears in duplicate diagnostics
Open
Nobody has claimed this yet.
A-diagnostics
F-const_trait_impl
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
const fn foo() -> Option<()> { None?; None }
Current output
error[E0015]: `?` is not allowed on `Option<!>` in constant functions
--> src/lib.rs:1:32
|
1 | const fn foo() -> Option<()> { None?; None }
| ^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error[E0015]: `?` is not allowed on `Option<()>` in constant functions
--> src/lib.rs:1:32
|
1 | const fn foo() -> Option<()> { None?; None }
| ^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
For more information about this error, try `rustc --explain E0015`.
error: could not compile `playground` (lib) due to 2 previous errors
Desired output
Minus the diagnostic about `Option<!>`
Rationale and extra context
This only happens on edition 2024.
Other cases
Rust Version
edition 2024
Anything else?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked Playground reproducer with edition 2024 and compare the two E0015 diagnostics. Trace the rustc diagnostic path responsible for the duplicate Option<!> and Option<()> messages, then add or update a regression test showing that only the valid diagnostic remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100