mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
17 lines
455 B
Rust
17 lines
455 B
Rust
//@ check-pass
|
|
|
|
#![feature(trait_alias)]
|
|
|
|
trait Foo<T> {}
|
|
trait Bar { type Assoc; }
|
|
|
|
trait Alias<T: Bar> = Foo<T>;
|
|
|
|
// Check that an alias only requires us to specify the associated types
|
|
// of the principal's supertraits. For example, we shouldn't require
|
|
// specifying the type `Assoc` on trait `Bar` just because we have some
|
|
// `T: Bar` where clause on the alias... because that makes no sense.
|
|
fn use_alias<T: Bar>(x: &dyn Alias<T>) {}
|
|
|
|
fn main() {}
|