rust/tests/ui/attributes
Nicholas Nethercote 226edf64fa 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.
2023-12-12 15:54:25 +11:00
..
auxiliary
main-removed-2
unix_sigpipe Show number in error message even for one error 2023-11-24 19:15:52 +01:00
attr-before-view-item2.rs
attr-before-view-item.rs
attr-eq-token-tree.rs
attr-eq-token-tree.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
attr-mix-new.rs
attrs-on-params.rs
attrs-on-params.stderr
attrs-with-no-formal-in-generics-1.rs
attrs-with-no-formal-in-generics-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
attrs-with-no-formal-in-generics-2.rs
attrs-with-no-formal-in-generics-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
attrs-with-no-formal-in-generics-3.rs
attrs-with-no-formal-in-generics-3.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
class-attributes-1.rs
class-attributes-2.rs
collapse-debuginfo-invalid.rs
collapse-debuginfo-invalid.stderr
const-stability-on-macro.rs
const-stability-on-macro.stderr
doc-attr.rs
doc-attr.stderr
doc-test-literal.rs
doc-test-literal.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
duplicated-attributes.rs
duplicated-attributes.stderr
extented-attribute-macro-error.rs
extented-attribute-macro-error.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
field-attributes-vis-unresolved.rs
field-attributes-vis-unresolved.stderr
invalid_macro_export_argument.deny.stderr
invalid_macro_export_argument.rs
invalid-repr.rs
invalid-repr.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-40962.rs
issue-90873.rs Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
issue-90873.stderr Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
issue-100631.rs
issue-100631.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-105594-invalid-attr-validation.rs
issue-105594-invalid-attr-validation.stderr
issue-115264-expr-field.rs
issue-115264-pat-field.rs
item-attributes.rs
key-value-expansion-on-mac.rs Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
key-value-expansion-on-mac.stderr Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
key-value-expansion.rs Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
key-value-expansion.stderr Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
key-value-non-ascii.rs
key-value-non-ascii.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
log-backtrace.rs
macro_export_on_decl_macro.rs
macro_export_on_decl_macro.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
main-removed-1.rs
main-removed-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
method-attributes.rs
multiple-invalid.rs
multiple-invalid.stderr
no-mangle-closure.rs
no-mangle-closure.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
nonterminal-expansion.rs
nonterminal-expansion.stderr
obsolete-attr.rs
obsolete-attr.stderr
rustc_confusables.rs
rustc_confusables.stderr
rustc-box.rs
rustc-box.stderr
statement-attribute-validation.rs
statement-attribute-validation.stderr
suffixed-literal-meta.rs
suffixed-literal-meta.stderr
tool_attributes.rs
unknown-attr.rs
unknown-attr.stderr
unnamed-field-attributes-dup.rs
unnamed-field-attributes-vis.rs
unnamed-field-attributes.rs
unrestricted-attribute-tokens.rs
unused-item-in-attr.rs Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
unused-item-in-attr.stderr Improve an error involving attribute values. 2023-12-12 15:54:25 +11:00
used_with_arg_no_mangle.rs
used_with_arg.rs
used_with_arg.stderr
used_with_multi_args.rs
used_with_multi_args.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
variant-attributes.rs
z-crate-attr.rs