@@ -5,7 +5,7 @@ LL | / for i in 0..x {
55LL | |
66LL | |
77LL | |
8- LL | |
8+ ... |
99LL | | sum += i;
1010LL | | }
1111 | |_____^
@@ -33,6 +33,19 @@ LL | for i in 0..x {
3333 = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
3434 = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
3535
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+
3649error[E0015]: cannot call non-const fn `<std::ops::Range<usize> as Iterator>::next` in constant functions
3750 --> $DIR/const-fn-error.rs:5:14
3851 |
@@ -42,7 +55,7 @@ LL | for i in 0..x {
4255 = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
4356 = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
4457
45- error: aborting due to 4 previous errors
58+ error: aborting due to 5 previous errors
4659
47- Some errors have detailed explanations: E0015, E0658.
60+ Some errors have detailed explanations: E0015, E0277, E0658.
4861For more information about an error, try `rustc --explain E0015`.
0 commit comments