-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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?
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.