summaryrefslogtreecommitdiff
path: root/tests/ui/impl-trait/in-trait/foreign.rs
blob: f4972d948b24684dccebcc9df7d5cd69c002713e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-pass
// aux-build: rpitit.rs
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next

extern crate rpitit;

use std::sync::Arc;

// Implement an RPITIT from another crate.
struct Local;
impl rpitit::Foo for Local {
    fn bar() -> Arc<String> { Arc::new(String::new()) }
}

fn main() {
    // Witness an RPITIT from another crate.
    let &() = <rpitit::Foreign as rpitit::Foo>::bar();

    let x: Arc<String> = <Local as rpitit::Foo>::bar();
}