-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structs that implement Parser from clap::Parser throw an error no-such-field #13904
Comments
You haven't said which field is missing. Does |
use_qt, use_gtk, and nogui, anything that is currently disabled because of features |
You'll have to enable those features for the code to be visible. |
im fully aware, just replicate it and see what i mean |
Given #[derive(clap::Parser)]
struct Args {
#[cfg(feature = "linux-qt")]
use_qt: bool,
} we expand the derive macro to #[deny(clippy::correctness)]
impl clap::FromArgMatches for Args {
// ...
fn from_arg_matches_mut(
__clap_arg_matches: &mut clap::ArgMatches,
) -> ::std::result::Result<Self, clap::Error> {
#![allow(deprecated)]
let v = Args {
use_qt: /* ... */
};
::std::result::Result::Ok(v)
}
// ...
} which emits |
This seems to be #8434 if I am not mistaken (but for attributes, not derives) |
Similar case I think?
will error in rust-analyzer unless the feature is enabled |
cfg Attribute Stripping for Proc Macro Expansion This will attempt to process cfg attributes and cfg_attr attributes for proc macro expansion. ![image](https://github.com/rust-lang/rust-analyzer/assets/11785959/b85ef203-14a5-44c9-9b67-59a65a5f2d96) Closes #8434 , #11657, and #13904
Fixed in #16789 |
rust-analyzer version: 0.4.1352-standalone
rustc version: rustc 1.66.0 (69f9c33d7 2022-12-12)
relevant settings:
The text was updated successfully, but these errors were encountered: