1 // aux-build:pub-and-stability.rs
3 // A big point of this test is that we *declare* `unstable_declared`,
4 // but do *not* declare `unstable_undeclared`. This way we can check
5 // that the compiler is letting in uses of declared feature-gated
6 // stuff but still rejecting uses of undeclared feature-gated stuff.
7 #![feature(unstable_declared)]
9 extern crate pub_and_stability;
10 use pub_and_stability::{Record, Trait, Tuple};
14 let Record { .. } = Record::new();
17 let Record { a_stable_pub: _, a_unstable_declared_pub: _, .. } = Record::new();
19 let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } =
21 //~^^ ERROR use of unstable library feature 'unstable_undeclared'
23 let r = Record::new();
27 r.a_unstable_declared_pub;
28 r.a_unstable_undeclared_pub; //~ ERROR use of unstable library feature
29 r.b_crate; //~ ERROR is private
30 r.c_mod; //~ ERROR is private
31 r.d_priv; //~ ERROR is private
35 t.2; //~ ERROR use of unstable library feature
36 t.3; //~ ERROR is private
37 t.4; //~ ERROR is private
38 t.5; //~ ERROR is private
40 r.stable_trait_method();
41 r.unstable_declared_trait_method();
42 r.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature
45 r.unstable_declared();
46 r.unstable_undeclared(); //~ ERROR use of unstable library feature
48 r.pub_crate(); //~ ERROR `pub_crate` is private
49 r.pub_mod(); //~ ERROR `pub_mod` is private
50 r.private(); //~ ERROR `private` is private
53 t.stable_trait_method();
54 t.unstable_declared_trait_method();
55 t.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature
58 t.unstable_declared();
59 t.unstable_undeclared(); //~ ERROR use of unstable library feature
61 t.pub_crate(); //~ ERROR `pub_crate` is private
62 t.pub_mod(); //~ ERROR `pub_mod` is private
63 t.private(); //~ ERROR `private` is private