Skip to content

include! should allow inner doc comments and directives #66920

@joshtriplett

Description

@joshtriplett

Currently, include! cannot include a file that contains inner doc comments (//! ...) or directives (#![...]). That creates a challenge when trying to generate a crate's top-level contents with a build script.

See https://internals.rust-lang.org/t/include-raw-directive-for-raw-textual-inclusion-of-generated-code/11405 for discussion. @dtolnay pointed out that we can fix this backwards-compatibly, as it would just turn an error into a non-error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-help-wantedCall for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions