Skip to content

is #[cfg] applicable to *some* non-stmt expressions? #32796

Closed
@pnkfelix

Description

@pnkfelix

Consider the following:

http://is.gd/28Q5H5

#![feature(stmt_expr_attributes)]

fn foo(_x: &[u32]) { }

fn main() {
    foo(&[1, #[cfg(not(now))] 2, 3])
}

Currently this is accepted (see #29850) but RFC 16 as written does not clearly say whether this is acceptable or not (see https://github.com/rust-lang/rfcs/blob/master/text/0016-more-attributes.md#cfg )

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language 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