Skip to content

Commit

Permalink
Produce spanned ICEs in const eval
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Sep 27, 2023
1 parent 0c78648 commit 344f4dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_const_eval/src/interpret/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ where
{
use rustc_middle::mir::ProjectionElem::*;
Ok(match proj_elem {
OpaqueCast(ty) => bug!("OpaqueCast({ty}) encountered after borrowck"),
OpaqueCast(ty) => {
span_bug!(self.cur_span(), "OpaqueCast({ty}) encountered after borrowck")
}
Field(field, _) => self.project_field(base, field.index())?,
Downcast(_, variant) => self.project_downcast(base, variant)?,
Deref => self.deref_pointer(&base.to_op(self)?)?.into(),
Expand Down

0 comments on commit 344f4dc

Please sign in to comment.