diff --git a/compiler/rustc_macros/src/symbols.rs b/compiler/rustc_macros/src/symbols.rs index 4df7eb63104..c48df8313b2 100644 --- a/compiler/rustc_macros/src/symbols.rs +++ b/compiler/rustc_macros/src/symbols.rs @@ -65,13 +65,19 @@ impl Parse for Symbol { fn parse(input: ParseStream<'_>) -> Result { let name = input.parse()?; let colon_token: Option = input.parse()?; - let value = - if colon_token.is_some() { Value::String(input.parse()?) } else { Value::SameAsName }; + let value = if colon_token.is_some() { input.parse()? } else { Value::SameAsName }; Ok(Symbol { name, value }) } } +impl Parse for Value { + fn parse(input: ParseStream<'_>) -> Result { + let lit: LitStr = input.parse()?; + Ok(Value::String(lit)) + } +} + struct Input { keywords: Punctuated, symbols: Punctuated,