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