We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1495b6b commit 92e4471Copy full SHA for 92e4471
src/librustc_mir/const_eval.rs
@@ -486,6 +486,9 @@ pub fn const_field<'a, 'tcx>(
486
})();
487
result.map_err(|error| {
488
let err = error_to_const_error(&ecx, error);
489
+ // FIXME(oli-obk): I believe this is unreachable and we can just ICE here. Since a constant
490
+ // is checked for validity before being in a place that could pass it to `const_field`,
491
+ // we can't possibly have errors. All fields have already been checked.
492
err.report_as_error(ecx.tcx, "could not access field of constant");
493
ErrorHandled::Reported
494
})
0 commit comments