]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/issue-86721-return-expr-ice.rs
Auto merge of #107663 - matthiaskrgr:107423-point-at-EOF-code, r=compiler-errors
[rust.git] / tests / ui / typeck / issue-86721-return-expr-ice.rs
1 // Regression test for the ICE described in #86721.
2
3 // revisions: rev1 rev2
4 #![cfg_attr(any(), rev1, rev2)]
5 #![crate_type="lib"]
6
7 #[cfg(any(rev1))]
8 trait T {
9     const U: usize = return;
10     //[rev1]~^ ERROR: return statement outside of function body [E0572]
11 }
12
13 #[cfg(any(rev2))]
14 trait T2 {
15     fn foo(a: [(); return]);
16     //[rev2]~^ ERROR: return statement outside of function body [E0572]
17 }