about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-12-12 17:40:54 +0100
committerGitHub <noreply@github.com>2023-12-12 17:40:54 +0100
commitcd7809b953d1ae8c9421a408639b4d864011977b (patch)
treec85964ddbe51c08b656aa3bcf209c2fba61c10d2 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent111c40ec22dbd34e0016e8ca2eceac034d76e8d3 (diff)
parent226edf64fa58e591d8abc6afef5e38c15c181698 (diff)
downloadrust-cd7809b953d1ae8c9421a408639b4d864011977b.tar.gz
rust-cd7809b953d1ae8c9421a408639b4d864011977b.zip
Rollup merge of #118855 - nnethercote:improve-attribute-value-error, r=compiler-errors,petrochenkov
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.

r? `@compiler-errors`
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions