diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/on-unimplemented | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/ui/on-unimplemented/auxiliary/no_debug.rs (renamed from src/test/ui/on-unimplemented/auxiliary/no_debug.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/bad-annotation.rs (renamed from src/test/ui/on-unimplemented/bad-annotation.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/bad-annotation.stderr (renamed from src/test/ui/on-unimplemented/bad-annotation.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/expected-comma-found-token.rs (renamed from src/test/ui/on-unimplemented/expected-comma-found-token.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/expected-comma-found-token.stderr (renamed from src/test/ui/on-unimplemented/expected-comma-found-token.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs (renamed from src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr (renamed from src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/impl-substs.rs (renamed from src/test/ui/on-unimplemented/impl-substs.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/impl-substs.stderr (renamed from src/test/ui/on-unimplemented/impl-substs.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/issue-104140.rs (renamed from src/test/ui/on-unimplemented/issue-104140.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/issue-104140.stderr (renamed from src/test/ui/on-unimplemented/issue-104140.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/multiple-impls.rs (renamed from src/test/ui/on-unimplemented/multiple-impls.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/multiple-impls.stderr (renamed from src/test/ui/on-unimplemented/multiple-impls.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/no-debug.rs (renamed from src/test/ui/on-unimplemented/no-debug.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/no-debug.stderr (renamed from src/test/ui/on-unimplemented/no-debug.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/on-impl.rs (renamed from src/test/ui/on-unimplemented/on-impl.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/on-impl.stderr (renamed from src/test/ui/on-unimplemented/on-impl.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/on-trait.rs (renamed from src/test/ui/on-unimplemented/on-trait.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/on-trait.stderr (renamed from src/test/ui/on-unimplemented/on-trait.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/parent-label.rs (renamed from src/test/ui/on-unimplemented/parent-label.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/parent-label.stderr (renamed from src/test/ui/on-unimplemented/parent-label.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/slice-index.rs (renamed from src/test/ui/on-unimplemented/slice-index.rs) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/slice-index.stderr (renamed from src/test/ui/on-unimplemented/slice-index.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/sum.rs | 9 | ||||
-rw-r--r-- | tests/ui/on-unimplemented/sum.stderr | 43 |
25 files changed, 52 insertions, 0 deletions
diff --git a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs b/tests/ui/on-unimplemented/auxiliary/no_debug.rs index fd3dc0abd..fd3dc0abd 100644 --- a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs +++ b/tests/ui/on-unimplemented/auxiliary/no_debug.rs diff --git a/src/test/ui/on-unimplemented/bad-annotation.rs b/tests/ui/on-unimplemented/bad-annotation.rs index f05436b8c..f05436b8c 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.rs +++ b/tests/ui/on-unimplemented/bad-annotation.rs diff --git a/src/test/ui/on-unimplemented/bad-annotation.stderr b/tests/ui/on-unimplemented/bad-annotation.stderr index a8d3c8680..a8d3c8680 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.stderr +++ b/tests/ui/on-unimplemented/bad-annotation.stderr diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.rs b/tests/ui/on-unimplemented/expected-comma-found-token.rs index 8fb34f211..8fb34f211 100644 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.rs +++ b/tests/ui/on-unimplemented/expected-comma-found-token.rs diff --git a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr b/tests/ui/on-unimplemented/expected-comma-found-token.stderr index 048b72ee3..048b72ee3 100644 --- a/src/test/ui/on-unimplemented/expected-comma-found-token.stderr +++ b/tests/ui/on-unimplemented/expected-comma-found-token.stderr diff --git a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs index 3cc50e349..3cc50e349 100644 --- a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.rs +++ b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.rs diff --git a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr index a4b33963f..a4b33963f 100644 --- a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr +++ b/tests/ui/on-unimplemented/feature-gate-on-unimplemented.stderr diff --git a/src/test/ui/on-unimplemented/impl-substs.rs b/tests/ui/on-unimplemented/impl-substs.rs index fe9c50ec3..fe9c50ec3 100644 --- a/src/test/ui/on-unimplemented/impl-substs.rs +++ b/tests/ui/on-unimplemented/impl-substs.rs diff --git a/src/test/ui/on-unimplemented/impl-substs.stderr b/tests/ui/on-unimplemented/impl-substs.stderr index a0fad0acd..a0fad0acd 100644 --- a/src/test/ui/on-unimplemented/impl-substs.stderr +++ b/tests/ui/on-unimplemented/impl-substs.stderr diff --git a/src/test/ui/on-unimplemented/issue-104140.rs b/tests/ui/on-unimplemented/issue-104140.rs index ade3f7270..ade3f7270 100644 --- a/src/test/ui/on-unimplemented/issue-104140.rs +++ b/tests/ui/on-unimplemented/issue-104140.rs diff --git a/src/test/ui/on-unimplemented/issue-104140.stderr b/tests/ui/on-unimplemented/issue-104140.stderr index ddb1f50f0..ddb1f50f0 100644 --- a/src/test/ui/on-unimplemented/issue-104140.stderr +++ b/tests/ui/on-unimplemented/issue-104140.stderr diff --git a/src/test/ui/on-unimplemented/multiple-impls.rs b/tests/ui/on-unimplemented/multiple-impls.rs index a32fd4566..a32fd4566 100644 --- a/src/test/ui/on-unimplemented/multiple-impls.rs +++ b/tests/ui/on-unimplemented/multiple-impls.rs diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/tests/ui/on-unimplemented/multiple-impls.stderr index d628b159a..d628b159a 100644 --- a/src/test/ui/on-unimplemented/multiple-impls.stderr +++ b/tests/ui/on-unimplemented/multiple-impls.stderr diff --git a/src/test/ui/on-unimplemented/no-debug.rs b/tests/ui/on-unimplemented/no-debug.rs index bdc80c5b3..bdc80c5b3 100644 --- a/src/test/ui/on-unimplemented/no-debug.rs +++ b/tests/ui/on-unimplemented/no-debug.rs diff --git a/src/test/ui/on-unimplemented/no-debug.stderr b/tests/ui/on-unimplemented/no-debug.stderr index 1035da54d..1035da54d 100644 --- a/src/test/ui/on-unimplemented/no-debug.stderr +++ b/tests/ui/on-unimplemented/no-debug.stderr diff --git a/src/test/ui/on-unimplemented/on-impl.rs b/tests/ui/on-unimplemented/on-impl.rs index d0537810c..d0537810c 100644 --- a/src/test/ui/on-unimplemented/on-impl.rs +++ b/tests/ui/on-unimplemented/on-impl.rs diff --git a/src/test/ui/on-unimplemented/on-impl.stderr b/tests/ui/on-unimplemented/on-impl.stderr index 2253c5992..2253c5992 100644 --- a/src/test/ui/on-unimplemented/on-impl.stderr +++ b/tests/ui/on-unimplemented/on-impl.stderr diff --git a/src/test/ui/on-unimplemented/on-trait.rs b/tests/ui/on-unimplemented/on-trait.rs index 556813cd4..556813cd4 100644 --- a/src/test/ui/on-unimplemented/on-trait.rs +++ b/tests/ui/on-unimplemented/on-trait.rs diff --git a/src/test/ui/on-unimplemented/on-trait.stderr b/tests/ui/on-unimplemented/on-trait.stderr index 4b040f1ac..4b040f1ac 100644 --- a/src/test/ui/on-unimplemented/on-trait.stderr +++ b/tests/ui/on-unimplemented/on-trait.stderr diff --git a/src/test/ui/on-unimplemented/parent-label.rs b/tests/ui/on-unimplemented/parent-label.rs index b65f64968..b65f64968 100644 --- a/src/test/ui/on-unimplemented/parent-label.rs +++ b/tests/ui/on-unimplemented/parent-label.rs diff --git a/src/test/ui/on-unimplemented/parent-label.stderr b/tests/ui/on-unimplemented/parent-label.stderr index 8cd7412fd..8cd7412fd 100644 --- a/src/test/ui/on-unimplemented/parent-label.stderr +++ b/tests/ui/on-unimplemented/parent-label.stderr diff --git a/src/test/ui/on-unimplemented/slice-index.rs b/tests/ui/on-unimplemented/slice-index.rs index 758220d3c..758220d3c 100644 --- a/src/test/ui/on-unimplemented/slice-index.rs +++ b/tests/ui/on-unimplemented/slice-index.rs diff --git a/src/test/ui/on-unimplemented/slice-index.stderr b/tests/ui/on-unimplemented/slice-index.stderr index a7ec3bda8..a7ec3bda8 100644 --- a/src/test/ui/on-unimplemented/slice-index.stderr +++ b/tests/ui/on-unimplemented/slice-index.stderr diff --git a/tests/ui/on-unimplemented/sum.rs b/tests/ui/on-unimplemented/sum.rs new file mode 100644 index 000000000..4f1c521d9 --- /dev/null +++ b/tests/ui/on-unimplemented/sum.rs @@ -0,0 +1,9 @@ +// <https://github.com/rust-lang/rust/issues/105184> + +fn main() { + vec![(), ()].iter().sum::<i32>(); + //~^ ERROR + + vec![(), ()].iter().product::<i32>(); + //~^ ERROR +} diff --git a/tests/ui/on-unimplemented/sum.stderr b/tests/ui/on-unimplemented/sum.stderr new file mode 100644 index 000000000..2a316dba7 --- /dev/null +++ b/tests/ui/on-unimplemented/sum.stderr @@ -0,0 +1,43 @@ +error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()` + --> $DIR/sum.rs:4:25 + | +LL | vec![(), ()].iter().sum::<i32>(); + | ^^^ value of type `i32` cannot be made by summing a `std::iter::Iterator<Item=&()>` + | + = help: the trait `Sum<&()>` is not implemented for `i32` + = help: the following other types implement trait `Sum<A>`: + <i32 as Sum<&'a i32>> + <i32 as Sum> +note: the method call chain might not have had the expected associated types + --> $DIR/sum.rs:4:18 + | +LL | vec![(), ()].iter().sum::<i32>(); + | ------------ ^^^^^^ `Iterator::Item` is `&()` here + | | + | this expression has type `Vec<()>` +note: required by a bound in `std::iter::Iterator::sum` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + +error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator + --> $DIR/sum.rs:7:25 + | +LL | vec![(), ()].iter().product::<i32>(); + | ^^^^^^^ value of type `i32` cannot be made by multiplying all elements from a `std::iter::Iterator<Item=&()>` + | + = help: the trait `Product<&()>` is not implemented for `i32` + = help: the following other types implement trait `Product<A>`: + <i32 as Product<&'a i32>> + <i32 as Product> +note: the method call chain might not have had the expected associated types + --> $DIR/sum.rs:7:18 + | +LL | vec![(), ()].iter().product::<i32>(); + | ------------ ^^^^^^ `Iterator::Item` is `&()` here + | | + | this expression has type `Vec<()>` +note: required by a bound in `std::iter::Iterator::product` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. |