- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.F-c_variadic`#![feature(c_variadic)]``#![feature(c_variadic)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![feature(c_variadic)]
fn main() {
    let s = unsafe { sum(4u32, 4u32, 30u32, 200u32, 1000u32) };
    assert_eq!(s, 1234);
}
#[no_mangle]
#[inline(always)]
pub unsafe extern "C" fn sum(n: u32, mut vs: ...) -> u32 {
    let mut s = 0;
    let mut i = 0;
    while i != n {
        s += vs.arg::<u32>();
        i += 1;
    }
    s
}$ rustc v.rs -Zmir-opt-level=2
error: internal compiler error: compiler/rustc_middle/src/mir/tcx.rs:84:25: deref projection of non-dereferenceable ty PlaceTy { ty: u32, variant_index: None }@rustbot modify labels: +A-mir-opt, +A-mir-opt-inlining
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.F-c_variadic`#![feature(c_variadic)]``#![feature(c_variadic)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.