rust/tests/ui/traits/const-traits/hir-const-check.rs
2025-07-21 12:49:45 +03:00

22 lines
328 B
Rust

//@ check-pass
//@ compile-flags: -Znext-solver
// Regression test for #69615.
#![feature(const_trait_impl)]
#![feature(const_try)]
#[const_trait]
pub trait MyTrait {
fn method(&self) -> Option<()>;
}
impl const MyTrait for () {
fn method(&self) -> Option<()> {
Some(())?;
None
}
}
fn main() {}