Skip to content

Structs that implement Parser from clap::Parser throw an error no-such-field #13904

Closed
@lever1209

Description

@lever1209

rust-analyzer version: 0.4.1352-standalone

rustc version: rustc 1.66.0 (69f9c33d7 2022-12-12)

relevant settings:

{
	"rust-analyzer.files.excludeDirs": [
		"target"
	],
	"rust-analyzer.cargo.features": ["interactive-cli", "debug"]
}
[dependencies]
clap = { version = "4.0.32", features = ["derive"] }
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
	#[arg(action = ArgAction::Set, id = "config_path", help = "path to an alternate config file.", short, long)]
	config: String,

	#[cfg(feature = "linux-qt")]
	#[arg(action = ArgAction::SetTrue, long = "qt")]
	use_qt: bool,

	#[cfg(feature = "linux-gtk")]
	#[arg(action = ArgAction::SetTrue, long = "gtk")]
	use_gtk: bool,

	#[cfg(any(
		feature = "linux-gtk",
		feature = "linux-qt",
		feature = "windows-uwp",
		feature = "windows-native"
	))]
	#[arg(action = ArgAction::SetTrue, long = "nogui")]
	nogui: bool,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingA-proc-macroproc macroC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions