]>
Commit | Line | Data |
---|---|---|
2b03887a FG |
1 | // check-pass |
2 | // aux-build: rpitit.rs | |
353b0b11 FG |
3 | // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty |
4 | // revisions: current next | |
2b03887a FG |
5 | |
6 | extern crate rpitit; | |
7 | ||
49aad941 | 8 | use rpitit::{Foo, Foreign}; |
353b0b11 FG |
9 | use std::sync::Arc; |
10 | ||
11 | // Implement an RPITIT from another crate. | |
12 | struct Local; | |
49aad941 FG |
13 | impl Foo for Local { |
14 | fn bar(self) -> Arc<String> { Arc::new(String::new()) } | |
353b0b11 FG |
15 | } |
16 | ||
fe692bf9 FG |
17 | fn generic(f: impl Foo) { |
18 | let x = &*f.bar(); | |
19 | } | |
20 | ||
2b03887a | 21 | fn main() { |
353b0b11 | 22 | // Witness an RPITIT from another crate. |
49aad941 | 23 | let &() = Foreign.bar(); |
353b0b11 | 24 | |
49aad941 | 25 | let x: Arc<String> = Local.bar(); |
2b03887a | 26 | } |