]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1445/feature-gate.rs
rewrote error messages for #[rustc_error]
[rust.git] / src / test / ui / rfc1445 / feature-gate.rs
1 // Test that structural match is only permitted with a feature gate,
2 // and that if a feature gate is supplied, it permits the type to be
3 // used in a match.
4
5 // revisions: with_gate no_gate
6
7 // gate-test-structural_match
8
9 #![allow(unused)]
10 #![feature(rustc_attrs)]
11 #![cfg_attr(with_gate, feature(structural_match))]
12
13 #[structural_match] //[no_gate]~ ERROR semantics of constant patterns is not yet settled
14 struct Foo {
15     x: u32
16 }
17
18 const FOO: Foo = Foo { x: 0 };
19
20 #[rustc_error]
21 fn main() { //[with_gate]~ ERROR fatal error triggered by #[rustc_error]
22     let y = Foo { x: 1 };
23     match y {
24         FOO => { }
25         _ => { }
26     }
27 }