address PR review feedback for unstable-book-gen

This commit is contained in:
randomicon00
2026-03-24 21:46:19 -04:00
parent deeb45a5de
commit 75bd926afd
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -604,6 +604,10 @@ pub fn is_target_modifier(flag_name: &str) -> bool {
/// necessary code. The main gotcha of this macro is the `cgsetters` module which is a bunch of
/// generated code to parse an option into its respective field in the struct. There are a few
/// hand-written parsers for parsing specific types of values in this module.
///
/// Note: this macro's invocation is also parsed by a `syn`-based parser in
/// `src/tools/unstable-book-gen/src/main.rs` to extract unstable option names and descriptions.
/// If the format of this macro changes, that parser may need to be updated as well.
macro_rules! options {
($struct_name:ident, $tmod_enum_name:ident, $stat:ident, $optmod:ident, $prefix:expr, $outputname:expr,
$($( #[$attr:meta] )* $opt:ident : $t:ty = (
+1 -1
View File
@@ -158,7 +158,7 @@ fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
return Err(syn::Error::new(
name.span(),
format!(
"unexpected field count for option `{name}`: expected 4 or 5, found {}",
"unexpected field count for option `{name}`: expected {REQUIRED_FIELDS} or {OPTIONAL_FIELDS}, found {}",
tuple_fields.len()
),
));