summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type/type-check-defaults.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/type/type-check-defaults.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/type/type-check-defaults.stderr')
-rw-r--r--src/test/ui/type/type-check-defaults.stderr81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr
new file mode 100644
index 000000000..56a9b5317
--- /dev/null
+++ b/src/test/ui/type/type-check-defaults.stderr
@@ -0,0 +1,81 @@
+error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
+ --> $DIR/type-check-defaults.rs:6:19
+ |
+LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
+ | ^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ |
+ = help: the trait `FromIterator<i32>` is not implemented for `i32`
+note: required by a bound in `Foo`
+ --> $DIR/type-check-defaults.rs:5:18
+ |
+LL | struct Foo<T, U: FromIterator<T>>(T, U);
+ | ^^^^^^^^^^^^^^^ required by this bound in `Foo`
+
+error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
+ --> $DIR/type-check-defaults.rs:8:27
+ |
+LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ |
+ = help: the trait `FromIterator<i32>` is not implemented for `i32`
+note: required by a bound in `Foo`
+ --> $DIR/type-check-defaults.rs:5:18
+ |
+LL | struct Foo<T, U: FromIterator<T>>(T, U);
+ | ^^^^^^^^^^^^^^^ required by this bound in `Foo`
+
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/type-check-defaults.rs:11:17
+ |
+LL | struct Bounds<T:Copy=String>(T);
+ | ^^^^ the trait `Copy` is not implemented for `String`
+
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/type-check-defaults.rs:14:42
+ |
+LL | struct WhereClause<T=String>(T) where T: Copy;
+ | ^^^^ the trait `Copy` is not implemented for `String`
+
+error[E0277]: the trait bound `String: Copy` is not satisfied
+ --> $DIR/type-check-defaults.rs:17:20
+ |
+LL | trait TraitBound<T:Copy=String> {}
+ | ^^^^ the trait `Copy` is not implemented for `String`
+
+error[E0277]: the trait bound `T: Copy` is not satisfied
+ --> $DIR/type-check-defaults.rs:21:25
+ |
+LL | trait Base<T = String>: Super<T> { }
+ | ^^^^^^^^ the trait `Copy` is not implemented for `T`
+ |
+note: required by a bound in `Super`
+ --> $DIR/type-check-defaults.rs:20:16
+ |
+LL | trait Super<T: Copy> { }
+ | ^^^^ required by this bound in `Super`
+help: consider further restricting type parameter `T`
+ |
+LL | trait Base<T = String>: Super<T> where T: std::marker::Copy { }
+ | ++++++++++++++++++++++++++
+
+error[E0277]: cannot add `u8` to `i32`
+ --> $DIR/type-check-defaults.rs:24:66
+ |
+LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
+ | ^^^^^^^ no implementation for `i32 + u8`
+ |
+ = help: the trait `Add<u8>` is not implemented for `i32`
+ = help: the following other types implement trait `Add<Rhs>`:
+ <&'a f32 as Add<f32>>
+ <&'a f64 as Add<f64>>
+ <&'a i128 as Add<i128>>
+ <&'a i16 as Add<i16>>
+ <&'a i32 as Add<i32>>
+ <&'a i64 as Add<i64>>
+ <&'a i8 as Add<i8>>
+ <&'a isize as Add<isize>>
+ and 48 others
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0277`.