]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/type/type-check-defaults.rs
1 use std
::iter
::FromIterator
;
2 use std
::vec
::IntoIter
;
5 struct Foo
<T
, U
: FromIterator
<T
>>(T
, U
);
6 struct WellFormed
<Z
= Foo
<i32, i32>>(Z
);
7 //~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`
8 struct WellFormedNoBounds
<Z
:?Sized
= Foo
<i32, i32>>(Z
);
9 //~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`
11 struct Bounds
<T
:Copy
=String
>(T
);
12 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
14 struct WhereClause
<T
=String
>(T
) where T
: Copy
;
15 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
17 trait TraitBound
<T
:Copy
=String
> {}
18 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
20 trait Super
<T
: Copy
> { }
21 trait Base
<T
= String
>: Super
<T
> { }
22 //~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied [E0277]
24 trait ProjectionPred
<T
:Iterator
= IntoIter
<i32>> where T
::Item
: Add
<u8> {}
25 //~^ ERROR cannot add `u8` to `i32` [E0277]