We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7385f21 commit d1f62b9Copy full SHA for d1f62b9
src/librustc/ty/print/pretty.rs
@@ -696,7 +696,12 @@ pub trait PrettyPrinter<'tcx>:
696
},
697
ty::Array(ty, sz) => {
698
p!(write("["), print(ty), write("; "));
699
- if let Some(n) = sz.try_eval_usize(self.tcx(), ty::ParamEnv::empty()) {
+ if let ConstValue::Unevaluated(..) = sz.val {
700
+ // do not try to evalute unevaluated constants. If we are const evaluating an
701
+ // array length anon const, rustc will (with debug assertions) print the
702
+ // constant's path. Which will end up here again.
703
+ p!(write("_"));
704
+ } else if let Some(n) = sz.try_eval_usize(self.tcx(), ty::ParamEnv::empty()) {
705
p!(write("{}", n));
706
} else {
707
p!(write("_"));
0 commit comments