Skip to content

Commit 6a3b839

Browse files
rustc_const_eval: explain TooGeneric error
Co-authored-by: Ralf Jung <[email protected]>
1 parent 9425208 commit 6a3b839

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
662662
self.write_immediate(*offset, dest)
663663
}
664664
ty::Alias(..) | ty::Param(..) | ty::Placeholder(..) | ty::Infer(..) => {
665-
Err(err_inval!(TooGeneric)).into()
665+
// This can happen in code which is generic over the field type.
666+
throw_inval!(TooGeneric)
666667
}
667668
_ => span_bug!(self.cur_span(), "expected field representing type, found {ty}"),
668669
}

0 commit comments

Comments
 (0)