mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
address PR review feedback for unstable-book-gen
This commit is contained in:
@@ -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 = (
|
||||
|
||||
@@ -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()
|
||||
),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user