]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/trait-privacy.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / traits / trait-privacy.rs
1 // compile-pass
2 #![feature(get_type_id)]
3 #![allow(dead_code)]
4 mod foo {
5     pub use self::bar::T;
6     mod bar {
7         pub trait T {
8             fn f(&self) {}
9         }
10         impl T for () {}
11     }
12 }
13
14 fn g() {
15     use foo::T;
16     ().f(); // Check that this does not trigger a privacy error
17 }
18
19 fn f() {
20     let error = ::std::thread::spawn(|| {}).join().unwrap_err();
21     error.get_type_id(); // Regression test for #21670
22 }
23
24
25 fn main() {}