this is my code: #[derive(Parser, Debug)] #[clap( name = "deintronize", version =…
- User
this is my code:
#[derive(Parser, Debug)] #[clap( name = "deintronize", version = "0.1.0", author = "Alejandro Gonzales-Irribarren <<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>>" )] pub struct Args { #[clap( short = 'b', long = "bed", help = "Path to BED file [annotation]", value_name = "BED", required = true )] bed: PathBuf,
code/// reads filepath; non-required argument. /// /// The reads file will be a BED file with the same name as the input file. #[clap( short = 'r', long = "reads", help = "Path to reads BED file", value_name = "READS", required = true )] reads: PathBuf, /// Number of threads to use; default is the number of logical CPUs. #[clap( short = 't', long, help = "Number of threads", value_name = "THREADS", default_value_t = num_cpus::get() )] threads: usize,}
and when I try to parse the arguments from main.rs I got: no function or associated item named "parse" found for struct deintronize::cli::Args in the current scope
also in cli.rs I have the following alert: "proc macro "Parser" not expanded: Failed to run proc-macro server from path"
- Assistant
- User
src/cli.rs|5 col 10-16 error| proc macro
Parsernot expanded: Failed to run proc-macro server from path /home/alejandro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/libexec/rust-analyzer-proc-macro-srv, error: Custom { kind: Other, error: "proc-macro server's api version (3) is newer than rust-analyzer's (2)" } src/cli.rs|105 col 17-22 error| proc macroErrornot expanded: Failed to run proc-macro server from path /home/alejandro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/libexec/rust-analyzer-proc-macro-srv, error: Custom { kind: Other, error: "proc-macro server's api version (3) is newer than rust-analyzer's (2)" } - Assistant
The error messages suggest that the version of rust-analyzer you're using is not up-to-date with the version of Rust's proc-macro server API. This incompatibility is preventing rust-analyzer from expanding procedural macros correctly.
Here are the steps to resolve the issue:
-
Update rust-analyzer: Make sure you have the latest version of rust-analyzer installed. If you're using Visual Studio Code, update the rust-analyzer plugin from the marketplace. Alternatively, if you have installed rust-analyzer manually or through a package manager, update it using the appropriate command.
-