You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #109557 - fee1-dead-contrib:mv-const-traits, r=oli-obk
Move const trait bounds checks to MIR constck
Fixes#109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
r? `@oli-obk`
Copy file name to clipboardexpand all lines: tests/ui/never_type/issue-52443.stderr
+15-2
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,19 @@ LL | [(); { for _ in 0usize.. {}; 0}];
58
58
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
59
59
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
60
60
61
+
error[E0277]: the trait bound `RangeFrom<usize>: Iterator` is not satisfied
62
+
--> $DIR/issue-52443.rs:9:21
63
+
|
64
+
LL | [(); { for _ in 0usize.. {}; 0}];
65
+
| ^^^^^^^^ `RangeFrom<usize>` is not an iterator
66
+
|
67
+
= help: the trait `~const Iterator` is not implemented for `RangeFrom<usize>`
68
+
note: the trait `Iterator` is implemented for `RangeFrom<usize>`, but that implementation is not `const`
69
+
--> $DIR/issue-52443.rs:9:21
70
+
|
71
+
LL | [(); { for _ in 0usize.. {}; 0}];
72
+
| ^^^^^^^^
73
+
61
74
error[E0015]: cannot call non-const fn `<RangeFrom<usize> as Iterator>::next` in constants
62
75
--> $DIR/issue-52443.rs:9:21
63
76
|
@@ -67,7 +80,7 @@ LL | [(); { for _ in 0usize.. {}; 0}];
67
80
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
68
81
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
69
82
70
-
error: aborting due to 6 previous errors; 1 warning emitted
83
+
error: aborting due to 7 previous errors; 1 warning emitted
71
84
72
-
Some errors have detailed explanations: E0015, E0308, E0658.
85
+
Some errors have detailed explanations: E0015, E0277, E0308, E0658.
73
86
For more information about an error, try `rustc --explain E0015`.
0 commit comments