about summary refs log tree commit diff
path: root/tests/ui/macros
AgeCommit message (Collapse)AuthorLines
2023-05-10refactor(resolve): clean up the early error return caused by non-callbohan-6/+9
2023-05-08Move testsCaio-0/+12
2023-05-01fix testsyukang-9/+6
2023-05-01Rip it outNilstrieb-8/+10
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-28Rollup merge of #110873 - clubby789:migrate-rustc-parse-trivial, ↵Matthias Krüger-2/+12
r=compiler-errors Migrate trivially translatable `rustc_parse` diagnostics cc #100717 Migrate diagnostics in `rustc_parse` which are emitted in a single statement. I worked on this by expanding the lint introduced in #108760, although that isn't included here as there is much more work to be done to satisfy it
2023-04-27Migrate trivially translatable `rustc_parse` diagnosticsclubby789-2/+12
2023-04-26Update tests.Mara Bos-1/+1
2023-04-21offset_ofDrMeepster-0/+9
2023-04-20Move test filesCaio-0/+97
2023-04-15Add some reasons why tests are ignored.Eric Huss-1/+1
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-2/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-04-12compiler: print the suggestion only for local macrosLena Milizé-1/+1
And wrap the link in the diagnostic in angle brackets. Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-12compiler: improve captured metavariables diagnosticLena Milizé-1/+3
Adds a link to the relevant part of The Rust Reference in the eror message, and suggests a possible fix (replacing the fragment specifier with :tt in the macro definition). Fixes typos in the original message. Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-11Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errorsbors-7/+19
Migrate most of `rustc_builtin_macros` to diagnostic impls cc #100717 This is a couple of days work, but I decided to stop for now before the PR becomes too big. There's around 50 unresolved failures when `rustc::untranslatable_diagnostic` is denied, which I'll finish addressing once this PR goes thtough A couple of outputs have changed, but in all instances I think the changes are an improvement/are more consistent with other diagnostics (although I'm happy to revert any which seem worse)
2023-04-10Auto merge of #109638 - NotStirred:suggest/non-derive, r=davidtwcobors-0/+48
Add suggestion to remove `derive()` if invoked macro is non-derive Adds to the existing `expected derive macro, found {}` error message: ``` help: remove the surrounding "derive()": --> $DIR/macro-path-prelude-fail-4.rs:1:3 | LL | #[derive(inline)] | ^^^^^^^ ^ ``` This suggestion will either fix the issue, in the case that the macro was valid, or provide a better error message if not Not ready for merge yet, as the highlighted span is only valid for trivial formatting. Is there a nice way to get the parent span of the macro path within `smart_resolve_macro_path`? Closes #109589
2023-04-10Migrate most of `rustc_builtin_macros` to diagnostic implsclubby789-7/+19
Co-authored-by: Joe ST <joe@fbstj.net> Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-07Rewrite added diagnostics as translatableTom Martin-2/+2
Start messages with lowercase
2023-04-07Add more complex test cases for new suggestionTom Martin-0/+40
2023-04-03remove invalid ignore-prettyPietro Albini-7/+3
2023-04-01BlessTom Martin-4/+6
2023-03-30Update non-derive macro error message to match suggestionTom Martin-6/+6
It's now split between two errors, one to remove the invalid derive macro and one suggesting adding a new non-derive macro
2023-03-27check for write macro and write_fmt with err msgJames Dietz-0/+76
added ui test blessed stderrs fixed typo reblessed
2023-03-26Add suggestion to remove derive() if invoked macro is non-deriveTom Martin-0/+6
2023-03-19fix: modify the condition that `resolve_imports` stopsbohan-0/+83
2023-03-17Suggest surrounding the macro with `{}` to interpret as a statementMu42-0/+25
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-8/+1
2023-03-11Auto merge of #109019 - matthiaskrgr:rollup-ihjntil, r=matthiaskrgrbors-4/+56
Rollup of 9 pull requests Successful merges: - #104363 (Make `unused_allocation` lint against `Box::new` too) - #106633 (Stabilize `nonzero_min_max`) - #106844 (allow negative numeric literals in `concat!`) - #108071 (Implement goal caching with the new solver) - #108542 (Force parentheses around `match` expression in binary expression) - #108690 (Place size limits on query keys and values) - #108708 (Prevent overflow through Arc::downgrade) - #108739 (Prevent the `start_bx` basic block in codegen from having two `Builder`s at the same time) - #108806 (Querify register_tools and post-expansion early lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-11Rollup merge of #108542 - bwmf2:expanded, r=wesleywiserMatthias Krüger-1/+25
Force parentheses around `match` expression in binary expression This attempts to solve https://github.com/rust-lang/rust/issues/98790.
2023-03-11Rollup merge of #106844 - Ezrashaw:concat-negative-int-lit, r=dtolnayMatthias Krüger-3/+31
allow negative numeric literals in `concat!` Fixes #106837 While *technically* negative numeric literals are implemented as unary operations, users can reasonably expect that negative literals are treated the same as positive literals.
2023-03-10Add note when matching token with nonterminalNilstrieb-0/+1
The current error message is _really_ confusing.
2023-03-02Rollup merge of #108573 - kornelski:runtimeenvs, r=WaffleLapkinMatthias Krüger-4/+5
Explain compile-time vs run-time difference in env!() error message This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067 It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables. I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
2023-03-02Add UI testbwmf2-0/+24
2023-03-02Fix UI testbwmf2-1/+1
2023-02-28Explain compile-time vs run-time difference in env!() error messageKornel-4/+5
2023-02-28Exit when there are unmatched delims to avoid noisy diagnosticsyukang-54/+1
2023-02-07Expand const-if-const trait bounds correctlyMichael Goulet-3/+3
2023-01-26Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obkbors-18/+18
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-25Rollup merge of #106897 - estebank:issue-99430, r=davidtwcoMatthias Krüger-0/+4
Tweak E0597 CC #99430
2023-01-21Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat reportAaron Hill-0/+68
2023-01-17note -> helpMichael Goulet-5/+5
2023-01-17Account for method call and indexing when looking for inner-most path in ↵Esteban Küber-0/+4
expression
2023-01-15allow negative numeric literals in `concat!`Ezra Shaw-3/+31
2023-01-12Bless tests.Mara Bos-18/+18
2023-01-11Move /src/test to /testsAlbert Larsan-0/+16460