about summary refs log tree commit diff
path: root/tests/ui/attributes
AgeCommit message (Collapse)AuthorLines
2023-12-12Improve an error involving attribute values.Nicholas Nethercote-22/+15
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-11-24Show number in error message even for one errorNilstrieb-23/+23
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-26Tweak suggestion spans for invalid crate-level inner attributeEsteban Küber-2/+6
CC #89566.
2023-10-24Auto merge of #117126 - matthiaskrgr:rollup-8huie8f, r=matthiaskrgrbors-0/+95
Rollup of 5 pull requests Successful merges: - #117081 (fix typos in comments) - #117091 (`OptWithInfcx` naming nits, trait bound simplifications) - #117092 (Add regression test for #117058) - #117093 (Update books) - #117105 (remove change-id assertion in bootstrap test) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-24Add regression test for #117058Matthew Jasper-0/+95
2023-10-23Update `since` stability attributes in testsDavid Tolnay-3/+3
2023-09-01Return ident for ExprField and PatField HIR nodesGurinder Singh-0/+36
2023-08-07check_attrs: Warn when #[macro_export] is used on macros 2.0Arthur Cohen-0/+25
The compiler should emit a more specific error when the `#[macro_export]` attribute is present on a decl macro, instead of silently ignoring it. This commit adds the required error message in rustc_passes/messages.ftl, as well as a note. A new variant is added to the `errors::MacroExport` enum, specifically for the case where the attribute is added to a macro 2.0.
2023-07-24validate `doc(masked)`Lukas Markeffsky-110/+0
2023-07-16Add infrastructure `#[rustc_confusables]` attribute to allow targeted许杰友 Jieyou Xu (Joe)-0/+126
"no method" errors on standard library types The standard library developer can annotate methods on e.g. `BTreeSet::push` with `#[rustc_confusables("insert")]`. When the user mistypes `btreeset.push()`, `BTreeSet::insert` will be suggested if there are no other candidates to suggest.
2023-05-29Add test for `#![doc(test(...)]` with literal parameterObei Sideg-0/+24
2023-04-27Add invalid_macro_export_arguments to built-in macro listMichael Goulet-19/+30
2023-04-26Migrate `rustc_passes` to translatable diagnosticsclubby789-2/+2
2023-04-17add test for invalid places of repr alignDeadbeef-0/+17
2023-04-03fix ignore-thumbv8m.basePietro Albini-1/+1
2023-03-28Skip no_mangle if the item has no name.Camille GILLOT-0/+19
2023-03-02Restrict `#[rustc_box]` to `Box::new` callsclubby789-0/+52
2023-02-22Add check for invalid \`#[macro_export]\` argumentsblyxyas-0/+42
2023-02-07Replace a command line flag with an env var to allow tools to initialize the ↵Oli Scherer-2/+2
tracing loggers at their own discretion
2023-01-26Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obkbors-6/+1
Move format_args!() into AST (and expand it during AST lowering) Implements https://github.com/rust-lang/compiler-team/issues/541 This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier. This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`. This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-12Bless tests.Mara Bos-6/+1
2023-01-12Add log-backtrace option to show backtraces along with loggingYuki Omoto-0/+9
2023-01-11Move /src/test to /testsAlbert Larsan-0/+2050