summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-fn-error.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/ui/consts/const-fn-error.stderr
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/const-fn-error.stderr')
-rw-r--r--tests/ui/consts/const-fn-error.stderr19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/ui/consts/const-fn-error.stderr b/tests/ui/consts/const-fn-error.stderr
index f735b3d53..73d235d6a 100644
--- a/tests/ui/consts/const-fn-error.stderr
+++ b/tests/ui/consts/const-fn-error.stderr
@@ -5,7 +5,7 @@ LL | / for i in 0..x {
LL | |
LL | |
LL | |
-LL | |
+... |
LL | | sum += i;
LL | | }
| |_____^
@@ -33,6 +33,19 @@ LL | for i in 0..x {
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+error[E0277]: the trait bound `std::ops::Range<usize>: Iterator` is not satisfied
+ --> $DIR/const-fn-error.rs:5:14
+ |
+LL | for i in 0..x {
+ | ^^^^ `std::ops::Range<usize>` is not an iterator
+ |
+ = help: the trait `~const Iterator` is not implemented for `std::ops::Range<usize>`
+note: the trait `Iterator` is implemented for `std::ops::Range<usize>`, but that implementation is not `const`
+ --> $DIR/const-fn-error.rs:5:14
+ |
+LL | for i in 0..x {
+ | ^^^^
+
error[E0015]: cannot call non-const fn `<std::ops::Range<usize> as Iterator>::next` in constant functions
--> $DIR/const-fn-error.rs:5:14
|
@@ -42,7 +55,7 @@ LL | for i in 0..x {
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0015, E0658.
+Some errors have detailed explanations: E0015, E0277, E0658.
For more information about an error, try `rustc --explain E0015`.