2022-09-22 19:56:55 -05:00
|
|
|
// check-pass
|
|
|
|
// aux-build: rpitit.rs
|
2023-03-08 14:59:06 -06:00
|
|
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
|
|
|
// revisions: current next
|
2022-09-22 19:56:55 -05:00
|
|
|
|
|
|
|
extern crate rpitit;
|
|
|
|
|
2023-03-21 13:06:04 -05:00
|
|
|
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()) }
|
|
|
|
}
|
|
|
|
|
2022-09-22 19:56:55 -05:00
|
|
|
fn main() {
|
2023-03-21 13:06:04 -05:00
|
|
|
// Witness an RPITIT from another crate.
|
|
|
|
let &() = <rpitit::Foreign as rpitit::Foo>::bar();
|
|
|
|
|
|
|
|
let x: Arc<String> = <Local as rpitit::Foo>::bar();
|
2022-09-22 19:56:55 -05:00
|
|
|
}
|