]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/control-flow/try.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / consts / control-flow / try.rs
1 // The `?` operator is still not const-evaluatable because it calls `From::from` on the error
2 // variant.
3
4 const fn opt() -> Option<i32> {
5 let x = Some(2);
6 x?; //~ ERROR `?` is not allowed in a `const fn`
7 None
8 }
9
10 fn main() {}