Commit ef15235
committed
parser: suggest quotes only for ident attribute values
When encountering code like:
```
#[cfg(key = ["a", "b"])]
fn main() {}
```
the parser incorrectly suggests:
```
error: expected unsuffixed literal, found `[`
--> ../pg/src/main.rs:1:13
|
1 | #[cfg(key = ["foo", "bar"])]
| ^
|
help: surround the identifier with quotation marks to parse it as a string
|
1 | #[cfg(key =" "["foo", "bar"])]
| + +
error: aborting due to 1 previous error
```
This commit modifies the parser to check if an attribute value is an
ident before suggesting.1 parent c672773 commit ef15235
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
| |||
0 commit comments