Skip to content

Transmute sizeof failure #16

Description

@danielsn
const SIZE1: usize = 1;
const SIZE2: usize = 2;

pub static TABLE1: [(u64, u64); SIZE1] = [
    (0, 0),
];

pub static TABLE2: [(u64, u64); SIZE2] = [
    (0, 0),
    (0, 0),
];

fn main() {
    assert!(TABLE1[0].0 == 0);
}

Fails with:

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `256`,
 right: `128`', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:686

Activity

  1. linked a pull request that will close this issueFix issue where array types were aliasing #15on Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions