]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs
Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
[rust.git] / tests / ui / rfc-2632-const-trait-impl / hir-const-check.rs
1 // Regression test for #69615.
2
3 #![feature(const_trait_impl)]
4
5 #[const_trait]
6 pub trait MyTrait {
7     fn method(&self) -> Option<()>;
8 }
9
10 impl const MyTrait for () {
11     fn method(&self) -> Option<()> {
12         Some(())?; //~ ERROR `?` is not allowed in a `const fn`
13         None
14     }
15 }
16
17 fn main() {}