Skip to content

target_feature_11 rejects code that was previously accepted #108655

Closed

Description

@tmiasko
#[target_feature(enable = "sse2")]
pub unsafe fn test() {
    ({
        #[inline(always)]
        move || {}
    })();
}

The preceding code used to compile successfully. Since the stabilization of
#![feature(target_feature_11)] in #99767 the compilation fails with:

error: cannot use `#[inline(always)]` with `#[target_feature]`

Activity

  1. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Mar 2, 2023
  2. apiraino commented on Mar 2, 2023

    @apiraino
    Contributor

    Hm, I think related to #108645 and #108646

  3. LeSeulArtichaut commented on Mar 2, 2023

    @LeSeulArtichaut
    Contributor

    Based on #73631 (comment), I'm guessing it would be fine to allow #[inline(always)] with #[target_feature] on closures, at least from a language perspective, even if it still trips up LLVM?

  4. workingjubilee commented on Mar 3, 2023

    @workingjubilee
    Member

    Technically, inline(always) is "just a hint" and thus one solution is and always was to accept the inline annotation and then simply ignore the request.

  5. workingjubilee commented on Mar 3, 2023

    @workingjubilee
    Member

    But yes, I believe this code actually should be fully acceptable. Note that in #108338 that if target_feature_11 is enabled, the attributes do get applied to the closure and inlining is done normally by LLVM due to a full match. No hint required.

  6. added
    P-lowLow priority
    and removed
    regression-untriagedUntriaged performance or correctness regression.
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Mar 3, 2023
  7. workingjubilee commented on Mar 3, 2023

    @workingjubilee
    Member

    Assigning P-low because the regression has been contained to nightly versions due to an immediate revert, so this only blocks forward feature development.

  8. LeSeulArtichaut commented on Mar 3, 2023

    @LeSeulArtichaut
  9. added
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    and removed on Mar 3, 2023
  10. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 5, 2023
  11. added a commit that references this issue on Jul 23, 2023
    1c44af9
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

    A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.F-target_feature_11target feature 1.1 RFCP-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions