mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
23 lines
504 B
Rust
23 lines
504 B
Rust
trait TraitB {
|
|
type Item;
|
|
}
|
|
|
|
trait TraitA<A> {
|
|
fn foo<T: TraitB<Item = A>>(_: T) -> Self;
|
|
fn bar<T>(_: T) -> Self;
|
|
fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy;
|
|
fn bat<T: TraitB<Item: Copy>>(_: T) -> Self; //~ ERROR associated type bounds are unstable
|
|
}
|
|
|
|
struct S;
|
|
|
|
impl TraitA<()> for S { //~ ERROR not all trait items implemented
|
|
}
|
|
|
|
use std::iter::FromIterator;
|
|
struct X;
|
|
impl FromIterator<()> for X { //~ ERROR not all trait items implemented
|
|
}
|
|
|
|
fn main() {}
|