don't use the moral equivalent of assert!(false, "foo")

This commit is contained in:
Oli Scherer 2023-09-29 14:39:37 +00:00
parent ffb7ed9fa4
commit 7c673db195

View File

@ -1470,15 +1470,12 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
match element_ty2.kind() {
ty::Int(_) => (),
_ => {
require!(
false,
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
);
return_error!(InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
});
}
}
@ -1590,15 +1587,12 @@ fn llvm_vector_ty<'ll>(cx: &CodegenCx<'ll, '_>, elem_ty: Ty<'_>, vec_len: u64) -
match element_ty2.kind() {
ty::Int(_) => (),
_ => {
require!(
false,
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
);
return_error!(InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
});
}
}
@ -1989,17 +1983,14 @@ enum Style {
}
_ => { /* Unsupported. Fallthrough. */ }
}
require!(
false,
InvalidMonomorphization::UnsupportedCast {
span,
name,
in_ty,
in_elem,
ret_ty,
out_elem
}
);
return_error!(InvalidMonomorphization::UnsupportedCast {
span,
name,
in_ty,
in_elem,
ret_ty,
out_elem
});
}
macro_rules! arith_binary {
($($name: ident: $($($p: ident),* => $call: ident),*;)*) => {
@ -2010,8 +2001,7 @@ macro_rules! arith_binary {
})*
_ => {},
}
require!(
false,
return_error!(
InvalidMonomorphization::UnsupportedOperation { span, name, in_ty, in_elem }
);
})*
@ -2041,8 +2031,7 @@ macro_rules! arith_unary {
})*
_ => {},
}
require!(
false,
return_error!(
InvalidMonomorphization::UnsupportedOperation { span, name, in_ty, in_elem }
);
})*