2023-04-30 21:52:35 +00:00

23 lines
470 B
Rust

// check-pass
// aux-build: rpitit.rs
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next
extern crate rpitit;
use rpitit::{Foo, Foreign};
use std::sync::Arc;
// Implement an RPITIT from another crate.
struct Local;
impl Foo for Local {
fn bar(self) -> Arc<String> { Arc::new(String::new()) }
}
fn main() {
// Witness an RPITIT from another crate.
let &() = Foreign.bar();
let x: Arc<String> = Local.bar();
}