mirror of https://github.com/rust-lang/rust
18 lines
477 B
Rust
18 lines
477 B
Rust
//@ aux-build:foreign-crate.rs
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
extern crate foreign_crate;
|
|
|
|
trait LocalTrait {}
|
|
impl<T> LocalTrait for foreign_crate::ForeignType<T> {}
|
|
|
|
type AliasOfForeignType<T> = impl LocalTrait;
|
|
fn use_alias<T>(val: T) -> AliasOfForeignType<T> {
|
|
foreign_crate::ForeignType(val)
|
|
}
|
|
|
|
impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {}
|
|
//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types
|
|
|
|
fn main() {}
|