1 // Test that use of structural-match traits is only permitted with a feature gate,
2 // and that if a feature gate is supplied, it permits the type to be
5 // revisions: with_gate no_gate
7 // gate-test-structural_match
10 #![feature(rustc_attrs)]
11 #![cfg_attr(with_gate, feature(structural_match))]
18 const FOO: Foo = Foo { x: 0 };
21 fn main() { //[with_gate]~ ERROR fatal error triggered by #[rustc_error]
29 impl std::marker::StructuralPartialEq for Foo { }
30 //[no_gate]~^ ERROR use of unstable library feature 'structural_match'
31 impl std::marker::StructuralEq for Foo { }
32 //[no_gate]~^ ERROR use of unstable library feature 'structural_match'
34 impl PartialEq<Foo> for Foo {
35 fn eq(&self, other: &Self) -> bool {