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 {
65
65
fn parse ( input : ParseStream < ' _ > ) -> Result < Self > {
66
66
let name = input. parse ( ) ?;
67
67
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 } ;
70
69
71
70
Ok ( Symbol { name, value } )
72
71
}
73
72
}
74
73
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
+
75
81
struct Input {
76
82
keywords : Punctuated < Keyword , Token ! [ , ] > ,
77
83
symbols : Punctuated < Symbol , Token ! [ , ] > ,
You can’t perform that action at this time.
0 commit comments