summary refs log tree commit diff
path: root/src/test/ui/macros
AgeCommit message (Collapse)AuthorLines
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-3/+5
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-07-16fix ui testsJane Lusby-1/+1
2021-07-08Move [debug_]assert_matches to mod {core, std}::assert.Mara Bos-0/+2
2021-07-06Add s to non_fmt_panicRyan Levick-7/+12
2021-07-06Change or_patterns_back_compat lint to rust_2021_incompatible_or_patternsRyan Levick-4/+4
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+14
2021-06-25Fix new broken testsRyan Levick-12/+12
2021-06-24Don't lint :pat when re-parsing a macro from another crate.Mara Bos-5/+23
2021-06-22Rollup merge of #86192 - hi-rustin:rustin-patch-lint, r=nikomatsakisYuki Okushi-12/+41
Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint close https://github.com/rust-lang/rust/issues/84869 r? `@nikomatsakis`
2021-06-21Do not set depth to 0 in fully_expand_fragmentDeadbeef-0/+30
2021-06-10Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible linthi-rustin-12/+41
2021-06-07Include macro name in 'local ambiguity' errorAaron Hill-2/+2
Currently, we only point at the span of the macro argument. When the macro call is itself generated by another macro, this can make it difficult or impossible to determine which macro is responsible for producing the error.
2021-05-29Use correct edition when parsing `:pat` matchersAaron Hill-0/+32
As described in issue #85708, we currently do not properly decode `SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a result, when we decode a span from a foreign crate with `SyntaxContext::root()`, we end up up considering it to have the edition of the *current* crate, instead of the foreign crate where it was originally created. A full fix for this issue will be a fairly significant undertaking. Fortunately, it's possible to implement a partial fix, which gives us the correct edition-dependent behavior for `:pat` matchers when the macro is loaded from another crate. Since we have the edition of the macro's defining crate available, we can 'recover' from seeing a `SyntaxContext::root()` and use the edition of the macro's defining crate. Any solution to issue #85708 must reproduce the behavior of this targeted fix - properly preserving a foreign `SyntaxContext::root()` means (among other things) preserving its edition, which by definition is the edition of the foreign crate itself. Therefore, this fix moves us closer to the correct overall solution, and does not expose any new incorrect behavior to macros.
2021-05-15Remove some unncessary spaces from pretty-printed tokenstream outputAaron Hill-7/+7
In addition to making the output look nicer for all crates, this also aligns the pretty-printing output with what the `rental` crate expects. This will allow us to eventually disable a backwards-compat hack in a follow-up PR.
2021-05-13Add support for const operands and options to global_asm!Amanieu d'Antras-5/+5
On x86, the default syntax is also switched to Intel to match asm!
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-54/+54
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-12Update stderrAaron Hill-23/+8
The spans generated by `quote!` are (intentionally) no longer all the same, so I removed that check entirely.
2021-04-28Auto merge of #83386 - mark-i-m:stabilize-pat2015, r=nikomatsakisbors-43/+41
Stabilize `:pat_param` and remove `:pat2021` Blocked on #83384 cc `@rust-lang/lang` #79278 If I understand `@nikomatsakis` in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873, another FCP is not needed. r? `@nikomatsakis`
2021-04-27remove pat2021mark-27/+25
2021-04-23Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"Santiago Pastorino-121/+0
This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b.
2021-04-15update testmark-4/+4
2021-04-15rename pat2015 to pat_parammark-15/+15
2021-04-15Run buffered lints attached to anon constsAaron Hill-0/+34
Fixes #84195
2021-04-15Rollup merge of #84185 - hi-rustin:rustin-patch-macro, r=nikomatsakisDylan DPC-0/+113
add more pat2021 tests close https://github.com/rust-lang/rust/issues/84138 r? ```@nikomatsakis```
2021-04-14test: add reasonable casehi-rustin-2/+2
2021-04-14test: add more caseshi-rustin-3/+69
2021-04-14add macro-or-patterns-2021 testhi-rustin-0/+47
2021-04-12Fix lookahead with None-delimited groupAaron Hill-0/+15
2021-04-10Expand derive invocations in left-to-right orderAaron Hill-20/+20
While derives were being collected in left-to-order order, the corresponding `Invocation`s were being pushed in the wrong order.
2021-04-06Rollup merge of #83814 - petrochenkov:emptyexpr, r=davidtwcoYuki Okushi-0/+31
expand: Do not ICE when a legacy AST-based macro attribute produces and empty expression Fixes https://github.com/rust-lang/rust/issues/80251 The reported error is the same as for `let _ = #[cfg(FALSE)] EXPR;`
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-7/+5
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-04-03expand: Do not ICE when a legacy AST-based macro attribute produces and ↵Vadim Petrochenkov-0/+31
empty expression
2021-04-02address commentshi-rustin-12/+12
2021-04-01add OR_PATTERNS_BACK_COMPAT linthi-rustin-0/+84
test: add more cases test: add comments refine msg
2021-03-28Rollup merge of #83348 - osa1:issue83344, r=jackh726Yuki Okushi-0/+14
format macro argument parsing fix When the character next to `{}` is "shifted" (when mapping a byte index in the format string to span) we should avoid shifting the span end index, so first map the index of `}` to span, then bump the span, instead of first mapping the next byte index to a span (which causes bumping the end span too much). Regression test added. Fixes #83344 --- r? ```@estebank```
2021-03-27format macro argument parsing fixÖmer Sinan Ağacan-0/+14
When the character next to `{}` is "shifted" (when mapping a byte index in the format string to span) we should avoid shifting the span end index, so first map the index of `}` to span, then bump the span, instead of first mapping the next byte index to a span (which causes bumping the end span too much). Regression test added. Fixes #83344
2021-03-27Rollup merge of #83343 - osa1:issue83340, r=jackh726Yuki Okushi-0/+16
Simplify and fix byte skipping in format! string parser Fixes '\\' handling in format strings. Fixes #83340
2021-03-23Rollup merge of #83384 - mark-i-m:rename-pat2018, r=joshtriplettYuki Okushi-1/+1
rename :pat2018 -> :pat2015 as requested by T-lang on zulip: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873 No functional changes here... just renaming. r? `@nikomatsakis`
2021-03-22Auto merge of #79278 - mark-i-m:stabilize-or-pattern, r=nikomatsakisbors-1/+0
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in https://github.com/rust-lang/rust/pull/78935#issuecomment-731564021 - [x] The resolution of the unresolved questions and a second crater run (https://github.com/rust-lang/rust/pull/78935#issuecomment-735412705) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (https://github.com/rust-lang/rust/pull/80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in https://github.com/rust-lang/rust/pull/79278#issuecomment-772815177
2021-03-22rename :pat2018 -> :pat215mark-1/+1
2021-03-21Simplify and fix byte skipping in format! string parserÖmer Sinan Ağacan-0/+16
Fixes '\\' handling in format strings. Fixes #83340
2021-03-20Move some tests to more reasonable directories - 5Caio-0/+18
2021-03-19update testsmark-1/+0
2021-03-13Add regression testshyd-dev-0/+29
2021-02-23Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakisDylan DPC-0/+121
Support `pub` on `macro_rules` This rebases and updates `since` version of #78166 from ``@petrochenkov`` r? ``@nikomatsakis``
2021-02-21Suggest `return`ing tail expressions that match return typeEsteban Küber-0/+5
Some newcomers are confused by the behavior of tail expressions, interpreting that "leaving out the `;` makes it the return value". To help them go in the right direction, suggest using `return` instead when applicable.
2021-02-19Support `pub` on `macro_rules`Vadim Petrochenkov-0/+121
2021-02-18Rollup merge of #82203 - c410-f3r:tests-tests-tests, r=Dylan-DPCYuki Okushi-0/+94
Move some tests to more reasonable directories - 4 cc #81941
2021-02-16Move some tests to more reasonable directoriesCaio-0/+94
2021-02-16Ensure debug_assert! tests get runTeddy Katz-0/+1