]> git.lizzy.rs Git - rust.git/blob - src/test/ui/reachable-unnameable-items.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / reachable-unnameable-items.rs
1 // run-pass
2 // ignore-wasm32-bare compiled with panic=abort by default
3 // aux-build:reachable-unnameable-items.rs
4
5 extern crate reachable_unnameable_items;
6 use reachable_unnameable_items::*;
7
8 fn 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);
30     let _guard = std::panic::catch_unwind(|| none.unwrap().method_of_unnameable_type3());
31 }