]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
New upstream version 1.55.0+dfsg1
[rustc.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() {}