]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-3763.rs
Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS
[rust.git] / src / test / ui / issues / issue-3763.rs
1 mod my_mod {
2     pub struct MyStruct {
3         priv_field: isize
4     }
5     pub fn MyStruct () -> MyStruct {
6         MyStruct {priv_field: 4}
7     }
8     impl MyStruct {
9         fn happyfun(&self) {}
10     }
11 }
12
13 fn main() {
14     let my_struct = my_mod::MyStruct();
15     let _woohoo = (&my_struct).priv_field;
16     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
17
18     let _woohoo = (Box::new(my_struct)).priv_field;
19     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
20
21     (&my_struct).happyfun();               //~ ERROR method `happyfun` is private
22
23     (Box::new(my_struct)).happyfun();          //~ ERROR method `happyfun` is private
24     let nope = my_struct.priv_field;
25     //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
26 }