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