rust/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs
2024-06-22 14:11:11 +00:00

18 lines
355 B
Rust

// Regression test for #69615.
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
#[const_trait]
pub trait MyTrait {
fn method(&self) -> Option<()>;
}
impl const MyTrait for () {
fn method(&self) -> Option<()> {
Some(())?; //~ ERROR `?` is not allowed in a `const fn`
None
}
}
fn main() {}