]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type/type-check-defaults.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / type / type-check-defaults.rs
1 use std::iter::FromIterator;
2 use std::vec::IntoIter;
3 use std::ops::Add;
4
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`
10
11 struct Bounds<T:Copy=String>(T);
12 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
13
14 struct WhereClause<T=String>(T) where T: Copy;
15 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
16
17 trait TraitBound<T:Copy=String> {}
18 //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
19
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]
23
24 trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
25 //~^ ERROR cannot add `u8` to `i32` [E0277]
26
27 fn main() { }