Skip to content

Commit 2425926

Browse files
BoxyUwUcompiler-errors
authored andcommitted
remove hack
1 parent ad23942 commit 2425926

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

compiler/rustc_middle/src/ty/relate.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,6 @@ pub fn structurally_relate_consts<'tcx, R: TypeRelation<'tcx>>(
589589
debug!("{}.structurally_relate_consts(a = {:?}, b = {:?})", relation.tag(), a, b);
590590
let tcx = relation.tcx();
591591

592-
// HACK(const_generics): We still need to eagerly evaluate consts when
593-
// relating them because during `normalize_param_env_or_error`,
594-
// we may relate an evaluated constant in a obligation against
595-
// an unnormalized (i.e. unevaluated) const in the param-env.
596-
// FIXME(generic_const_exprs): Once we always lazily unify unevaluated constants
597-
// these `eval` calls can be removed.
598-
if !tcx.features().generic_const_exprs {
599-
a = a.eval(tcx, relation.param_env());
600-
b = b.eval(tcx, relation.param_env());
601-
}
602-
603592
if tcx.features().generic_const_exprs {
604593
a = tcx.expand_abstract_consts(a);
605594
b = tcx.expand_abstract_consts(b);

tests/ui/consts/unnormalized-param-env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// check-pass
1+
// known-bug: unknown
22

33
pub trait CSpace<const N: usize> {
44
type Traj;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error[E0277]: the trait bound `CS: CSpace<4>` is not satisfied
2+
--> $DIR/unnormalized-param-env.rs:23:5
3+
|
4+
LL | / fn trajectory_free<TF, S1>(&self, t: &TF)
5+
LL | | where
6+
LL | | CS::Traj: Sized,
7+
LL | | CS: CSpace<N>,
8+
| |______________________^ the trait `CSpace<4>` is not implemented for `CS`
9+
|
10+
help: consider restricting type parameter `CS`
11+
|
12+
LL | impl<CS: CSpace<4>> Obstacle<CS, N> for ObstacleSpace2df32 {
13+
| +++++++++++
14+
15+
error[E0277]: the trait bound `CS: CSpace<4>` is not satisfied
16+
--> $DIR/unnormalized-param-env.rs:23:8
17+
|
18+
LL | fn trajectory_free<TF, S1>(&self, t: &TF)
19+
| ^^^^^^^^^^^^^^^ the trait `CSpace<4>` is not implemented for `CS`
20+
|
21+
help: consider restricting type parameter `CS`
22+
|
23+
LL | impl<CS: CSpace<4>> Obstacle<CS, N> for ObstacleSpace2df32 {
24+
| +++++++++++
25+
26+
error: aborting due to 2 previous errors
27+
28+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)