cfg-if icon indicating copy to clipboard operation
cfg-if copied to clipboard

unexpected behavior inside struct, for feature-gated arguments

Open thor314 opened this issue 3 years ago • 0 comments

Attempting the following:

pub(crate) struct Args {
	cfg_if! {
		if #[cfg(feature = "my_feat")] {
			some_feature_gated_arg: u8,
			some_other_feature_gated_arg: u8,
		} else {}
	}
	// ...
}

causes compile time errors. This would have been helpful to note in the Readme/docs.

thor314 avatar Jun 29 '22 19:06 thor314