]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type/type-check-defaults.stderr
Rollup merge of #105005 - estebank:where-clause-lts, r=compiler-errors
[rust.git] / src / test / ui / type / type-check-defaults.stderr
1 error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
2   --> $DIR/type-check-defaults.rs:6:23
3    |
4 LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
5    |                       ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
6    |
7    = help: the trait `FromIterator<i32>` is not implemented for `i32`
8 note: required by a bound in `Foo`
9   --> $DIR/type-check-defaults.rs:5:18
10    |
11 LL | struct Foo<T, U: FromIterator<T>>(T, U);
12    |                  ^^^^^^^^^^^^^^^ required by this bound in `Foo`
13
14 error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
15   --> $DIR/type-check-defaults.rs:8:38
16    |
17 LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
18    |                                      ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
19    |
20    = help: the trait `FromIterator<i32>` is not implemented for `i32`
21 note: required by a bound in `Foo`
22   --> $DIR/type-check-defaults.rs:5:18
23    |
24 LL | struct Foo<T, U: FromIterator<T>>(T, U);
25    |                  ^^^^^^^^^^^^^^^ required by this bound in `Foo`
26
27 error[E0277]: the trait bound `String: Copy` is not satisfied
28   --> $DIR/type-check-defaults.rs:11:17
29    |
30 LL | struct Bounds<T:Copy=String>(T);
31    |                 ^^^^ the trait `Copy` is not implemented for `String`
32
33 error[E0277]: the trait bound `String: Copy` is not satisfied
34   --> $DIR/type-check-defaults.rs:14:42
35    |
36 LL | struct WhereClause<T=String>(T) where T: Copy;
37    |                                          ^^^^ the trait `Copy` is not implemented for `String`
38
39 error[E0277]: the trait bound `String: Copy` is not satisfied
40   --> $DIR/type-check-defaults.rs:17:20
41    |
42 LL | trait TraitBound<T:Copy=String> {}
43    |                    ^^^^ the trait `Copy` is not implemented for `String`
44
45 error[E0277]: the trait bound `T: Copy` is not satisfied
46   --> $DIR/type-check-defaults.rs:21:25
47    |
48 LL | trait Base<T = String>: Super<T> { }
49    |                         ^^^^^^^^ the trait `Copy` is not implemented for `T`
50    |
51 note: required by a bound in `Super`
52   --> $DIR/type-check-defaults.rs:20:16
53    |
54 LL | trait Super<T: Copy> { }
55    |                ^^^^ required by this bound in `Super`
56 help: consider further restricting type parameter `T`
57    |
58 LL | trait Base<T = String>: Super<T> where T: std::marker::Copy { }
59    |                                  ++++++++++++++++++++++++++
60
61 error[E0277]: cannot add `u8` to `i32`
62   --> $DIR/type-check-defaults.rs:24:66
63    |
64 LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
65    |                                                                  ^^^^^^^ no implementation for `i32 + u8`
66    |
67    = help: the trait `Add<u8>` is not implemented for `i32`
68    = help: the following other types implement trait `Add<Rhs>`:
69              <&'a i32 as Add<i32>>
70              <&i32 as Add<&i32>>
71              <i32 as Add<&i32>>
72              <i32 as Add>
73
74 error: aborting due to 7 previous errors
75
76 For more information about this error, try `rustc --explain E0277`.