summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs
blob: 337c733403b243db85a432b90cbaadcb5ef76bd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Regression test for #69615.

#![feature(const_trait_impl)]

#[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() {}