summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-for.stderr
blob: f2e1c8a4991a31c5f265db040cf518b6b0695c74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants
  --> $DIR/const-for.rs:5:14
   |
LL |     for _ in 0..5 {}
   |              ^^^^
   |
note: impl defined here, but it is not `const`
  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
   |
LL | impl<I: ~const Iterator> const IntoIterator for I {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants
  --> $DIR/const-for.rs:5:14
   |
LL |     for _ in 0..5 {}
   |              ^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0015`.