Skip to content

generic_const_exprs suggestion to add bound interacts poorly with legacy const generics #108382

Closed

Description

@asquared31415

Code

#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

use std::arch::x86_64::*;
fn uwu<const N: i32>() {
    unsafe {
        let a = _mm_setzero_ps();
        let b = _mm_setzero_ps();
        _mm_shuffle_ps(a, b, N + 1);
    }
}

Current output

error: unconstrained generic constant
 --> src/lib.rs:9:30
  |
9 |         _mm_shuffle_ps(a, b, N + 1);
  |                              ^^^^^
  |
  = help: try adding a `where` bound using this expression: `where [(); _mm_shuffle_ps]:`

Desired output

error: unconstrained generic constant
 --> src/lib.rs:9:30
  |
9 |         _mm_shuffle_ps(a, b, N + 1);
  |                              ^^^^^
  |
  = help: try adding a `where` bound using this expression: `where [(); N + 1]:`

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Feb 23, 2023
  2. IsaiahCoroama commented on Jul 8, 2026

    @IsaiahCoroama
    Contributor

    @rustbot claim

  3. asquared31415 commented on Jul 8, 2026

    @asquared31415
    ContributorAuthor

    @IsaiahCoroama this issue probably doesn't need to be resolved because the generic_const_exprs feature is likely on the way to being removed. I'm uncertain if any equivalents exist for generic_const_args, which would be much more interesting, because those are getting active work.

  4. IsaiahCoroama commented on Jul 8, 2026

    @IsaiahCoroama
    Contributor

    @asquared31415 Sorry, I already made the fixes before I saw this. If the feature gets dropped, it should be easy to revert my changes (if they end up getting merged, that is).

  5. added 2 commits that reference this issue on Jul 14, 2026
    2c67e0f
    28e67e0
  6. added a commit that references this issue on Jul 14, 2026
    3489f97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsF-generic_const_exprs`#![feature(generic_const_exprs)]`P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions