about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authoryukang <moorekang@gmail.com>2023-08-04 13:28:04 +0800
committeryukang <moorekang@gmail.com>2023-08-05 01:38:14 +0800
commit3d25b5c7e8653a4ce0513cf8d7bcbd796ed81c4b (patch)
tree7049bb16423caef78f760045839eba84e032c17b /compiler/rustc_codegen_cranelift
parent60fa393490ef88c79da2a58569795236b4d4c9db (diff)
downloadrust-3d25b5c7e8653a4ce0513cf8d7bcbd796ed81c4b.tar.gz
rust-3d25b5c7e8653a4ce0513cf8d7bcbd796ed81c4b.zip
Fix ICE failed to get layout for ReferencesError
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/common.rs b/compiler/rustc_codegen_cranelift/src/common.rs
index 67ea20112fe..3081dcfa2b7 100644
--- a/compiler/rustc_codegen_cranelift/src/common.rs
+++ b/compiler/rustc_codegen_cranelift/src/common.rs
@@ -477,7 +477,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
 
     #[inline]
     fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
-        if let layout::LayoutError::SizeOverflow(_) = err {
+        if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
             self.0.sess.span_fatal(span, err.to_string())
         } else {
             span_bug!(span, "failed to get layout for `{}`: {}", ty, err)