Skip to content

#![cfg_attr(..., feature)]` not respected #4245

@bjorn3

Description

@bjorn3

Summary

See title

Reproducer

I tried this code:

#![cfg_attr(not(cg_gcc), feature(intrinsics))]

#[cfg(not(cg_gcc))]
extern "rust-intrinsic" {
    fn copy_nonoverlapping<T>(src: &T, dst: &mut T, count: usize);
}

Does the code make use of any (1.49) nightly feature ?

  • Nightly

Godbolt link

No response

Actual behavior

<source>:17:1: error: intrinsics are subject to change. add `#![feature(intrinsics)]` to the crate attributes to enable. [E0658]
   17 | extern "rust-intrinsic" {
      | ^~~~~~

Expected behavior

It compiles

GCC Version

gccrs (Compiler-Explorer-Build-gcc--binutils-2.44) 15.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions