Skip to content

User type annotations can result in different mir-opt test results in CI vs locally #73501

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
davidtwco opened this issue Jun 19, 2020 · 0 comments
Labels
A-mir-opt Area: MIR optimizations A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@davidtwco
Copy link
Member

In #73442, a mir-opt test that I blessed locally was failing on CI and I could not reproduce the failure locally - this was due to the DefId in the user type annotations of the test shown below, which appeared to be different locally versus on CI.

// compile-flags: -Z mir-opt-level=1
// Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags.

use std::mem;

#[derive(Copy, Clone)]
enum Never {}

union Foo {
    a: u64,
    b: Never
}

// EMIT_MIR rustc.foo.mir_map.0.mir
fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }

// EMIT_MIR rustc.bar.mir_map.0.mir
fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }

// EMIT_MIR rustc.main.mir_map.0.mir
fn main() {
    println!("{}", mem::size_of::<Foo>());

    let f = [Foo { a: 42 }, Foo { a: 10 }];
    println!("{:?}", unsafe { f[0].a });
}

You can find my config.toml here and I was running tests with ./x.py test src/test/mir-opt --stage 1 (though I couldn't reproduce with a stage2 build either).

cc @rust-lang/wg-mir-opt

@davidtwco davidtwco added the A-mir-opt Area: MIR optimizations label Jun 19, 2020
@jonas-schievink jonas-schievink added A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-mir-opt Area: MIR optimizations A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants