]> git.proxmox.com Git - rustc.git/blame - src/test/ui/privacy/reachable-unnameable-items.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / privacy / reachable-unnameable-items.rs
CommitLineData
416331ca 1// run-pass
a2a8927a 2// needs-unwind
7453a54e
SL
3// aux-build:reachable-unnameable-items.rs
4
7453a54e
SL
5extern crate reachable_unnameable_items;
6use reachable_unnameable_items::*;
7
8fn main() {
9 let res1 = function_returning_unnameable_type().method_of_unnameable_type1();
10 let res2 = CONSTANT_OF_UNNAMEABLE_TYPE.method_of_unnameable_type2();
11 let res4 = AliasOfUnnameableType{}.method_of_unnameable_type4();
12 let res5 = function_returning_unnameable_type().inherent_method_returning_unnameable_type().
13 method_of_unnameable_type5();
14 let res6 = function_returning_unnameable_type().trait_method_returning_unnameable_type().
15 method_of_unnameable_type6();
16 let res7 = STATIC.field_of_unnameable_type.method_of_unnameable_type7();
17 let res8 = generic_function::<AliasOfUnnameableType>().method_of_unnameable_type8();
18 let res_enum = NameableVariant.method_of_unnameable_enum();
19 assert_eq!(res1, "Hello1");
20 assert_eq!(res2, "Hello2");
21 assert_eq!(res4, "Hello4");
22 assert_eq!(res5, "Hello5");
23 assert_eq!(res6, "Hello6");
24 assert_eq!(res7, "Hello7");
25 assert_eq!(res8, "Hello8");
26 assert_eq!(res_enum, "HelloEnum");
27
28 let none = None;
29 function_accepting_unnameable_type(none);
3157f602 30 let _guard = std::panic::catch_unwind(|| none.unwrap().method_of_unnameable_type3());
7453a54e 31}