Skip to content

Commit

Permalink
codegen: Ask the layout if it is uninhabited, not its impl detail (#3675
Browse files Browse the repository at this point in the history
)

Directly question the layout if it is uninhabited. This makes Kani more
resilient to changes in the upstream rustc toolchain, as the convenience
function which exposes this is precisely to allow compilers to not
fixate as much on the innermost details of rustc's codegen process.

Found while reviewing #3671
  • Loading branch information
workingjubilee authored Nov 3, 2024
1 parent 04a59f1 commit 813cb81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ impl GotocCtx<'_> {

// For all intrinsics we first check `is_uninhabited` to give a more
// precise error message
if layout.backend_repr.is_uninhabited() {
if layout.is_uninhabited() {
return self.codegen_fatal_error(
PropertyClass::SafetyCheck,
&format!(
Expand Down

0 comments on commit 813cb81

Please sign in to comment.