Skip to content

cfg attributes appear are improperly applied inside of include! #31369

Closed
@sgrif

Description

@sgrif

Example to reproduce:

// src/lib.rs
include!("foo.rs");

// foo.rs
#[cfg(feature = "never")]
include!("error.rs");

// error.rs
omg i'm a syntax error

This should successfully compile, but instead will have a syntax error. It should behave identically to what would occur if you inlined the first include!, (which does compile successfully)

// src/lib.rs
#[cfg(feature = "never")]
include!("error.rs");

// error.rs
omg i'm a syntax error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions