23 lines
470 B
Rust
Raw Normal View History

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