Skip to content

Commit 14ccea4

Browse files
committed
review comment: explain frame shuffling
1 parent e1eef73 commit 14ccea4

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_const_eval/src/const_eval

1 file changed

+4
-0
lines changed

compiler/rustc_const_eval/src/const_eval/error.rs

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ pub fn get_span_and_frames<'tcx>(
111111
add_frame(frame);
112112
}
113113
}
114+
115+
// In `rustc`, we present const-eval errors from the outer-most place first to the inner-most.
116+
// So we reverse the frames here. The first frame will be the same as the span from the current
117+
// `TyCtxtAt<'_>`, so we remove it as it would be redundant.
114118
frames.reverse();
115119
if frames.len() > 0 {
116120
frames.remove(0);

0 commit comments

Comments
 (0)