]> git.lizzy.rs Git - rust.git/blob - src/test/ui/extern/extern-types-inherent-impl.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / extern / extern-types-inherent-impl.rs
1 // Test that inherent impls can be defined for extern types.
2
3 // check-pass
4 // aux-build:extern-types-inherent-impl.rs
5
6 #![feature(extern_types)]
7
8 extern crate extern_types_inherent_impl;
9 use extern_types_inherent_impl::CrossCrate;
10
11 extern "C" {
12     type Local;
13 }
14
15 impl Local {
16     fn foo(&self) {}
17 }
18
19 fn use_foo(x: &Local, y: &CrossCrate) {
20     Local::foo(x);
21     x.foo();
22     CrossCrate::foo(y);
23     y.foo();
24 }
25
26 fn main() {}