about summary refs log tree commit diff
path: root/tests/ui/parser
AgeCommit message (Collapse)AuthorLines
2025-07-01moved testsKivooeo-0/+11
2025-07-01Rollup merge of #143210 - Kivooeo:tf19, r=tgross35Guillaume Gomez-0/+20
`tests/ui`: A New Order [19/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-01Fix duplicate errors for `link_section`, ↵Jonathan Brouwer-2/+12
`rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end`
2025-07-01Fix `#[must_use = 1]` not giving an errorJonathan Brouwer-10/+19
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01moved testsKivooeo-0/+9
2025-07-01cleaned up some testsKivooeo-2/+25
2025-07-01moved test filesKivooeo-0/+11
2025-07-01Auto merge of #142921 - JonathanBrouwer:rustc_attributes_parser, r=oli-obkbors-1/+12
Port `#[rustc_layout_scalar_valid_range_start/end]` to the new attrib… Ports `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@jdonszelmann`
2025-07-01moved testsKivooeo-0/+53
2025-06-30Rollup merge of #143195 - Kivooeo:tf17, r=tgross35dianqk-0/+19
`tests/ui`: A New Order [17/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-06-30cleaned up some testsKivooeo-0/+6
2025-06-30cleaned up some testsKivooeo-4/+10
2025-06-29moved & deleted some testsKivooeo-0/+14
2025-06-29moved testsKivooeo-0/+13
2025-06-29Rollup merge of #142214 - Kivooeo:tf9, r=jieyouxuGuillaume Gomez-0/+37
`tests/ui`: A New Order [9/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-29Fix the span of trait bound modifier `[const]`León Orell Valerian Liehr-2/+2
2025-06-28cleaned up some testsKivooeo-0/+37
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-16/+16
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27Port `#[rustc_layout_scalar_valid_range_start/end]` to the new attribute ↵Jonathan Brouwer-1/+12
parsing infrastructure Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-26Rewrite `macro_rules!` parser to not use the MBE engine itselfJosh Triplett-6/+6
The `macro_rules!` parser was written to match the series of rules using the macros-by-example (MBE) engine and a hand-written equivalent of the left-hand side of a MBE macro. This was complex to read, difficult to extend, and produced confusing error messages. Because it was using the MBE engine, any parse failure would be reported as if some macro was being applied to the `macro_rules!` invocation itself; for instance, errors would talk about "macro invocation", "macro arguments", and "macro call", when they were actually about the macro *definition*. And in practice, the `macro_rules!` parser only used the MBE engine to extract the left-hand side and right-hand side of each rule as a token tree, and then parsed the rest using a separate parser. Rewrite it to parse the series of rules using a simple loop, instead. This makes it more extensible in the future, and improves error messages. For instance, omitting a semicolon between rules will result in "expected `;`" and "unexpected token", rather than the confusing "no rules expected this token in macro call". This work was greatly aided by pair programming with Vincenzo Palazzo and Eric Holk.
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-16/+16
2025-06-24Rollup merge of #142657 - tgross35:nonoptional-fragment-specifiers-cleanup, ↵Matthias Krüger-9/+17
r=petrochenkov mbe: Clean up code with non-optional `NonterminalKind` Since [rust-lang/rust#128425], the fragment specifier is unconditionally required in all editions. This means `NonTerminalKind` no longer needs to be optional, as we can reject this code during the expansion of `macro_rules!` rather than handling it throughout the code. Do this cleanup here. [rust-lang/rust#128425]: https://github.com/rust-lang/rust/pull/128425
2025-06-24mbe: Clean up code with non-optional `NonterminalKind`Trevor Gross-9/+17
Since [1], the fragment specifier is unconditionally required in all editions. This means `NonTerminalKind` no longer needs to be optional, as we can reject this code during the expansion of `macro_rules!` rather than handling it throughout the code. Do this cleanup here. [1]: https://github.com/rust-lang/rust/pull/128425
2025-06-22Rollup merge of #142798 - camsteffen:recover-semi, r=compiler-errorsGuillaume Gomez-9/+9
Don't fail to parse a struct if a semicolon is used to separate fields The first commit is a small refactor.
2025-06-22Port `#[must_use]` to new attribute parsing infrastructureJonathan Brouwer-19/+3
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-20Rollup merge of #142485 - mu001999-contrib:dead-code/adt-pattern, r=petrochenkovTrevor Gross-1/+3
Marks ADT live if it appears in pattern Marks ADT live if it appears in pattern, it implies the construction of the ADT. 1. Then we can detect unused private ADTs impl `Default`, without special logics for `Default` and other std traits. 2. We can also remove `rustc_trivial_field_reads` on `Default`, and the logic in `should_ignore_item` (introduced by rust-lang/rust#126302). Fixes rust-lang/rust#120770 Extracted from rust-lang/rust#128637. r? `@petrochenkov`
2025-06-20Recover from semicolon field separatorCameron Steffen-9/+9
2025-06-18Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, ↵Jakub Beránek-4/+10
r=lcnr,traviscross Stabilize `feature(generic_arg_infer)` Fixes rust-lang/rust#85077 r? lcnr cc ````@rust-lang/project-const-generics````
2025-06-16Rollup merge of #142341 - xizheyin:142311, r=fee1-deadJakub Beránek-0/+77
Don't suggest converting `///` to `//` when expecting `,` Fixes rust-lang/rust#142311
2025-06-16Dont suggest converting `///` to regular comment when it appears after ↵xizheyin-0/+77
missing `,` in list Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-14Marks ADT live if it appears in patternMu001999-1/+3
2025-06-13Rollup merge of #142302 - JonathanBrouwer:invalid-const-token, r=jdonszelmannJubilee-117/+187
Rework how the disallowed qualifier in function type diagnostics are generated This pull request fixes two independent issues: 1. When qualifiers of a function type ptr are in the wrong order and one of them is async/const (not permitted on function types), the diagnostic suggests removing the incorrect qualifier. Fixes https://github.com/rust-lang/rust/issues/142268, which is an issue created by https://github.com/rust-lang/rust/pull/133151. This is fixed by moving the check into `parse_fn_front_matter`, where better span information is available to generate the right suggestions. 2. When qualifiers of a function type ptr are in the wrong order and one of them is async/const (not permitted on function types), `cargo fix` crashes because "cannot replace slice of data that was already replaced". This is fixed by not generating a suggestion for the "wrong order" diagnostic if the "disallowed qualifier" diagnostic is triggered. There is a commit with failing tests so the test diff is clearer r? `@jdonszelmann`
2025-06-13Rework how the disallowed qualifier lints are generatedJonathan Brouwer-219/+117
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-13Add failing testsJonathan Brouwer-3/+175
2025-06-12Make `missing_fragment_specifier` an unconditional errorTrevor Gross-17/+8
This was attempted in [1] then reverted in [2] because of fallout. Recently, this was made an edition-dependent error in [3]. Make missing fragment specifiers an unconditional error again. [1]: https://github.com/rust-lang/rust/pull/75516 [2]: https://github.com/rust-lang/rust/pull/80210 [3]: https://github.com/rust-lang/rust/pull/128006
2025-06-11Add expectation for `{` when parsing lone coroutine qualifiersLukas Wirth-7/+7
2025-06-11stabilize gaiBoxy-4/+10
2025-06-04Rollup merge of #141959 - ferrocene:lw/2015-edition-directives2, ↵Matthias Krüger-16/+24
r=compiler-errors Add more missing 2015 edition directives These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-06-03Add missing `dyn` keywords to tests that do not test for them Part 2Lukas Wirth-6/+2
2025-06-03Add missing 2015 edition directivesLukas Wirth-16/+24
These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-05-30Rollup merge of #141077 - chenyukang:yukang-fix-140991-comma, r=wesleywiserJubilee-0/+74
Fix the issue of typo of comma in arm parsing Fixes #140991 I also checked is it a '/', since it's near from ',' from keyboard.
2025-05-27Report text_direction_codepoint_in_literal when parsingMatthew Jasper-18/+143
- The lint is now reported in code that gets removed/modified/duplicated by macro expansion. - Spans are more accurate - Fixes #140281
2025-05-16Fix the issue of typo of comma in arm parsingyukang-0/+74
2025-05-14Improve ternary operator recoveryJamie-5/+23
2025-05-09Merge typeck loop with static/const item eval loopOli Scherer-6/+6
2025-05-07Rollup merge of #140671 - xizheyin:issue-140169, r=petrochenkovGuillaume Gomez-52/+45
Parser: Recover error from named params while parse_path Fixes #140169 I added test to the first commit and the second added the code and changes to test. r? `@petrochenkov`
2025-05-07Use `parse_param_general` when parsing `(T, U)->R` in `parse_path_segment`xizheyin-52/+45
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2025-05-04Auto merge of #140616 - petrochenkov:noannempty, r=jieyouxubors-10/+5
compiletest: Do not require annotations on empty labels and suggestions Unlike other empty diagnostics, empty labels (only underlining spans) and empty suggestions (suggestions to remove something) are quite usual and do not require any special attention and annotations. This effectively reverts a part of https://github.com/rust-lang/rust/pull/139485. r? `@jieyouxu`
2025-05-04Rollup merge of #140286 - xizheyin:issue-139104, r=lcnrStuart Cook-0/+105
Check if format argument is identifier to avoid error err-emit Fixes #139104 When `argument` is not an identifier, it should not be considered a field access. I checked this and if not emit an invalid format string error. I think we could do with a little finer error handling, I'll open an issue to track this down later. The first commit submits the ui test, the second commits the code and the changes to the test output. r? compiler
2025-05-03compiletest: Do not require annotations on empty labels and suggestionsVadim Petrochenkov-10/+5