Skip to content

stdarch - compile-time errors on invalid arguments #85264

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

As noted in #85155 which tracks the diagnostic issue, the standard library previously accepted code (with differing behavior) on a number of intrinsics with "intended to be const" arguments. Since #83278, though, this code is rejected at compile-time.

For example, this code compiles on stable but not 1.54 (nightly as of this writing). I think at minimum we need to identify the set of code that changed behaviors and document that in release notes.

#[cfg(target_arch = "x86_64")]
fn main() {
    use std::arch::x86_64::*;
    unsafe {
        let a: __m128 = _mm_setzero_ps();
        let b: __m128 = _mm_setzero_ps();
        let _blended = _mm_blend_ps(a, b, 0x33);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.relnotesMarks issues that should be documented in the release notes of the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions