Skip to content

Clap derive expansion no longer works on stable #79503

Closed
@pksunkara

Description

@pksunkara

Code

Clap has the following test at clap_derive/tests/nested.rs:

use clap::Clap;

#[test]
fn use_option() {
    macro_rules! expand_ty {
        ($name:ident: $ty:ty) => {
            #[derive(Clap)]
            struct Outer {
                #[clap(short, long)]
                #[allow(dead_code)]
                $name: $ty,
            }
        };
    }

    expand_ty!(my_field: Option<String>);
}

As you can see from the latest master CI, it fails to compile on stable

Version it worked on

It most recently worked on: Successfully compiles and runs on 1.46.0

Version with regression

rustc --version --verbose:

rustc 1.48.0 (7eac88abb 2020-11-16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions