Skip to content

include! does not expand derive behind #[cfg_attr] #32957

Closed

Description

@alexcrichton

For example.this does not compile:

// bar.rs
#[cfg_attr(foo, derive(Clone))]
struct A(u32);

// foo.rs
include!("bar.rs");
fn main() {
    A(1).clone();
}

Compiled with rustc --cfg foo foo.rs this will fail with A not implementing Clone.

Activity

  1. durka commented on Apr 14, 2016

    @durka
    Contributor

    dupe #22250?

  2. alexcrichton commented on Apr 14, 2016

    @alexcrichton
    MemberAuthor

    Probably, yeah.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions