@@ -5,7 +5,7 @@ LL | / for i in 0..x {
5
5
LL | |
6
6
LL | |
7
7
LL | |
8
- LL | |
8
+ ... |
9
9
LL | | sum += i;
10
10
LL | | }
11
11
| |_____^
@@ -33,6 +33,19 @@ LL | for i in 0..x {
33
33
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
34
34
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
35
35
36
+ error[E0277]: the trait bound `std::ops::Range<usize>: Iterator` is not satisfied
37
+ --> $DIR/const-fn-error.rs:5:14
38
+ |
39
+ LL | for i in 0..x {
40
+ | ^^^^ `std::ops::Range<usize>` is not an iterator
41
+ |
42
+ = help: the trait `~const Iterator` is not implemented for `std::ops::Range<usize>`
43
+ note: the trait `Iterator` is implemented for `std::ops::Range<usize>`, but that implementation is not `const`
44
+ --> $DIR/const-fn-error.rs:5:14
45
+ |
46
+ LL | for i in 0..x {
47
+ | ^^^^
48
+
36
49
error[E0015]: cannot call non-const fn `<std::ops::Range<usize> as Iterator>::next` in constant functions
37
50
--> $DIR/const-fn-error.rs:5:14
38
51
|
@@ -42,7 +55,7 @@ LL | for i in 0..x {
42
55
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
43
56
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
44
57
45
- error: aborting due to 4 previous errors
58
+ error: aborting due to 5 previous errors
46
59
47
- Some errors have detailed explanations: E0015, E0658.
60
+ Some errors have detailed explanations: E0015, E0277, E0658.
48
61
For more information about an error, try `rustc --explain E0015`.
0 commit comments