diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-12 09:55:50 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-12 15:54:25 +1100 |
| commit | 226edf64fa58e591d8abc6afef5e38c15c181698 (patch) | |
| tree | 794954d943af6c79141f6a967b6d3dfb23ea2518 /tests/rustdoc-js-std/full-path-function.js | |
| parent | 57010939ed1d00076b4af0ed06a81ec69ea5e4a8 (diff) | |
| download | rust-226edf64fa58e591d8abc6afef5e38c15c181698.tar.gz rust-226edf64fa58e591d8abc6afef5e38c15c181698.zip | |
Improve an error involving attribute values.
Attribute values must be literals. The error you get when that doesn't hold is pretty bad, e.g.: ``` unexpected expression: 1 + 1 ``` You also get the same error if the attribute value is a literal, but an invalid literal, e.g.: ``` unexpected expression: "foo"suffix ``` This commit does two things. - Changes the error message to "attribute value must be a literal", which gives a better idea of what the problem is and how to fix it. It also no longer prints the invalid expression, because the carets below highlight it anyway. - Separates the "not a literal" case from the "invalid literal" case. Which means invalid literals now get the specific error at the literal level, rather than at the attribute level.
Diffstat (limited to 'tests/rustdoc-js-std/full-path-function.js')
0 files changed, 0 insertions, 0 deletions
