Files
rust/tests/ui/traits/const-traits/hir-const-check.rs

22 lines
328 B
Rust
Raw Normal View History

2025-07-21 12:49:45 +03:00
//@ check-pass
2024-10-21 19:37:48 +00:00
//@ compile-flags: -Znext-solver
2020-03-02 10:53:58 -08:00
// Regression test for #69615.
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2025-07-21 12:49:45 +03:00
#![feature(const_try)]
2020-03-02 10:53:58 -08:00
2022-08-28 06:27:31 +00:00
#[const_trait]
2020-03-02 10:53:58 -08:00
pub trait MyTrait {
2020-06-25 17:43:48 -07:00
fn method(&self) -> Option<()>;
2020-03-02 10:53:58 -08:00
}
impl const MyTrait for () {
2020-06-25 17:43:48 -07:00
fn method(&self) -> Option<()> {
2024-11-22 02:31:42 +00:00
Some(())?;
2020-06-25 17:43:48 -07:00
None
2020-03-02 10:53:58 -08:00
}
}
fn main() {}