File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/rustc_macros/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,19 @@ impl Parse for Symbol {
6565 fn parse ( input : ParseStream < ' _ > ) -> Result < Self > {
6666 let name = input. parse ( ) ?;
6767 let colon_token: Option < Token ! [ : ] > = input. parse ( ) ?;
68- let value =
69- if colon_token. is_some ( ) { Value :: String ( input. parse ( ) ?) } else { Value :: SameAsName } ;
68+ let value = if colon_token. is_some ( ) { input. parse ( ) ? } else { Value :: SameAsName } ;
7069
7170 Ok ( Symbol { name, value } )
7271 }
7372}
7473
74+ impl Parse for Value {
75+ fn parse ( input : ParseStream < ' _ > ) -> Result < Self > {
76+ let lit: LitStr = input. parse ( ) ?;
77+ Ok ( Value :: String ( lit) )
78+ }
79+ }
80+
7581struct Input {
7682 keywords : Punctuated < Keyword , Token ! [ , ] > ,
7783 symbols : Punctuated < Symbol , Token ! [ , ] > ,
You can’t perform that action at this time.
0 commit comments