about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/hir-const-check.rs
blob: 1b6fa1afab9fa356c6004c973235d729a634fac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ 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() {}