about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-06-29cleaned up some testsKivooeo-97/+157
2025-06-24Auto merge of #142956 - GuillaumeGomez:rollup-867246h, r=GuillaumeGomezbors-35/+255
Rollup of 9 pull requests Successful merges: - rust-lang/rust#140005 (Set MSG_NOSIGNAL for UnixStream) - rust-lang/rust#140622 (compiletest: Improve diagnostics for line annotation mismatches) - rust-lang/rust#142354 (Fixes firefox copy paste issue) - rust-lang/rust#142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - rust-lang/rust#142779 (Add note about `str::split` handling of no matches.) - rust-lang/rust#142894 (phantom_variance_markers: fix identifier usage in macro) - rust-lang/rust#142928 (Fix hang in --print=file-names in bootstrap) - rust-lang/rust#142932 (rustdoc-json: Keep empty generic args if parenthesized) - rust-lang/rust#142933 (Simplify root goal API of solver a bit) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-24Rollup merge of #142932 - Enselic:keep-empty-generic-params, r=aDotInTheVoidGuillaume Gomez-0/+3
rustdoc-json: Keep empty generic args if parenthesized Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements. This is an amendment to https://github.com/rust-lang/rust/pull/142502, so: r? ``@aDotInTheVoid`` cc ``@nnethercote`` cc https://github.com/cargo-public-api/cargo-public-api/pull/798
2025-06-24Rollup merge of #142695 - ↵Guillaume Gomez-0/+114
GrigorenkoPV:attributes/rustc_skip_during_method_dispatch, r=jdonszelmann Port `#[rustc_skip_during_method_dispatch]` to the new attribute system Part of rust-lang/rust#131229 r? ``@jdonszelmann``
2025-06-24Rollup merge of #140622 - petrochenkov:annusexp, r=jieyouxuGuillaume Gomez-35/+138
compiletest: Improve diagnostics for line annotation mismatches When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient. This PR attempts to improve the user experience. - The "expected ... not found" messages are no longer duplicated. - The `proc_res.status` and `proc_res.cmdline` message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end. - Compiletest now makes suggestions if there are fuzzy matches between expected and actually reported errors (e.g. the annotation is put on a wrong line). - Missing diagnostic kinds are no longer produce an error eagerly, but instead treated as always mismatching kinds, so they can produce suggestions telling the right kind. I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test `tests/ui/compiletest-self-test/line-annotation-mismatches.rs`. This also fixes https://github.com/rust-lang/rust/issues/140940. r? ``@jieyouxu``
2025-06-24Auto merge of #142930 - cuviper:normalize-beta-versions, r=workingjubileebors-8/+8
Account for beta revisions when normalizing versions Several UI tests have a `normalize-stderr` for "you are using x.y.z" rustc versions, and that regex is flexible enough for suffixes like "-nightly" and "-dev", but not for "-beta.N". We can just add '.' to that trailing pattern to include this.
2025-06-24rustdoc-json: Keep empty generic args if parenthesizedMartin Nordholts-0/+3
Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements.
2025-06-23Account for beta revisions when normalizing versionsJosh Stone-8/+8
Several UI tests have a `normalize-stderr` for "you are using x.y.z" rustc versions, and that regex is flexible enough for suffixes like "-nightly" and "-dev", but not for "-beta.N". We can just add '.' to that trailing pattern to include this.
2025-06-23Rollup merge of #142923 - folkertdev:min-function-alignment-no-attributes, ↵Jubilee-4/+6
r=workingjubilee fix `-Zmin-function-alignment` on functions without attributes tracking issue: https://github.com/rust-lang/rust/issues/82232 related: https://github.com/rust-lang/rust/pull/142854 The minimum function alignment was skipped on functions without attributes (because the logic was in a loop that only runs if there is at least one attribute). The underlying reason we didn't catch this before is that in our testing we generally apply `#[no_mangle]` to functions that are tested. I've added a test now that deliberately has no attributes. r? `@workingjubilee`
2025-06-23Rollup merge of #142873 - Urgau:issue-139830, r=BoxyUwUJubilee-2/+32
Don't suggest changing a method inside a expansion Fixes https://github.com/rust-lang/rust/issues/139830 r? compiler
2025-06-23Port `#[rustc_skip_during_method_dispatch]` to the new attribute systemPavel Grigorenko-0/+114
2025-06-23compiletest: Improve diagnostics for line annotation mismatchesVadim Petrochenkov-35/+138
2025-06-23fix `-Zmin-function-alignment` without attributesFolkert de Vries-4/+6
the minimum function alignment was skipped on functions without attributes. That is because in our testing we generally apply `#[no_mangle]` to functions that are tested. I've added a test now that deliberately has no attributes
2025-06-23tests: Bless cannot-be-called and dedup with unsupported ABI testJubilee Young-1147/+414
2025-06-23tests: Verify varargs with unsupported fn ptr ABIs must errorJubilee Young-0/+27
2025-06-23tests: Adopt ABI transmute tests from crashtestsJubilee Young-7/+31
2025-06-23tests: Update and bless cmse-nonsecure ABI testsJubilee Young-32/+29
2025-06-23tests: Update raw-dylib unsupported ABI testJubilee Young-2/+2
2025-06-23tests: Enhance unsupported ABI testsJubilee Young-1856/+1096
We have fairly different error messages now and handle more cases, so we augment the test in tests/ui/abi/unsupported.rs with more examples to handle structs, traits, and impls on same when those feature the unsupported ABIs of interest.
2025-06-23tests: Bless abi_gpu_kernel feature gate testJubilee Young-66/+57
2025-06-23Rollup merge of #142892 - jdonszelmann:fix-142891, r=oli-obkJana Dönszelmann-0/+19
Fix ICE on debug builds where lints are delayed on the crate root r? ``@oli-obk`` Closes rust-lang/rust#142891 thanks to ``@JonathanBrouwer`` for finding it!
2025-06-23Rollup merge of #142822 - oli-obk:const-partial-eq, r=fee1-deadJana Dönszelmann-597/+101
Make `PartialEq` a `const_trait` r? ``@fee1-dead`` or ``@compiler-errors`` something generally useful but also required for https://github.com/rust-lang/rust/pull/142789
2025-06-23move naked checks out of check_attr.rsJana Dönszelmann-22/+22
2025-06-23fix 142891Jana Dönszelmann-0/+16
2025-06-23test for lint on root node crashJana Dönszelmann-0/+3
2025-06-23Make `PartialEq` a `const_trait`Oli Scherer-597/+101
2025-06-23Rollup merge of #142823 - JonathanBrouwer:no_mangle_parser, r=jdonszelmannMatthias Krüger-12/+12
Port `#[no_mangle]` to new attribute parsing infrastructure Ports `no_mangle` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-06-23Rollup merge of #141597 - Oneirical:unquestionable-instruction, r=jieyouxuMatthias Krüger-0/+1594
Document subdirectories of UI tests with README files Part of rust-lang/rust#133895 and the [2025 Google Summer of Code](https://blog.rust-lang.org/2025/05/08/gsoc-2025-selected-projects/) associated project. When adding a new UI test, one is faced with hundreds of subdirectories in `tests/ui` reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, `moves` does not only refer to the `move` keyword but to functions taking ownership in general, whereas `allocator` does not refer to allocation in general but rather to the very specific `allocator_api` and `global_allocator` features. Many contributors will therefore place their test at the top level of ̀`tests/ui` where it will be mixed with hundreds of unrelated tests. This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside `tests/ui`. r? ``@jieyouxu``
2025-06-22Port `#[no_mangle]` to new attribute parsing infrastructureJonathan Brouwer-12/+12
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22Auto merge of #142508 - Mark-Simulacrum:skip-noop-drop-glue, r=fee1-deadbors-16/+76
Skip no-op drop glue Since rust-lang/rust#122662 this no longer gets used in vtables, so we're safe to fully drop generating functions from vtables. Those are eventually cleaned up by LLVM, but it's wasteful to produce them in the first place. This doesn't appear to be a significant win (and shows some slight regressions) but seems like the right thing to do. At minimum it reduces noise in the LLVM IR we generate, which seems like a good thing.
2025-06-22Auto merge of #142878 - GuillaumeGomez:rollup-53dohob, r=GuillaumeGomezbors-350/+325
Rollup of 10 pull requests Successful merges: - rust-lang/rust#142458 (Merge unboxed trait object error suggestion into regular dyn incompat error) - rust-lang/rust#142593 (Add a warning to LateContext::get_def_path) - rust-lang/rust#142594 (Add DesugaringKind::FormatLiteral) - rust-lang/rust#142740 (Clean-up `FnCtxt::is_destruct_assignment_desugaring`) - rust-lang/rust#142780 (Port `#[must_use]` to new attribute parsing infrastructure) - rust-lang/rust#142798 (Don't fail to parse a struct if a semicolon is used to separate fields) - rust-lang/rust#142856 (Add a few inline directives in rustc_serialize.) - rust-lang/rust#142868 (remove few allow(dead_code)) - rust-lang/rust#142874 (cranelift: fix target feature name typo: "fxsr") - rust-lang/rust#142877 (Document why tidy checks if `eslint` is installed via `npm`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-22Add a SUMMARY.md outlining immediate subdirectories of the ui test suiteOneirical-0/+1594
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2025-06-22Fix tests to drop now-skipped codegenMark Rousskov-16/+53
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-22Rollup merge of #142780 - JonathanBrouwer:must_use_new_attr, r=jdonszelmannGuillaume Gomez-40/+36
Port `#[must_use]` to new attribute parsing infrastructure Ports `must_use` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@jdonszelmann`
2025-06-22Rollup merge of #142594 - mejrs:new_desugaring, r=chenyukangGuillaume Gomez-148/+211
Add DesugaringKind::FormatLiteral Implements `DesugaringKind::FormatLiteral` to mark the FormatArgs desugaring of format literals. The main use for this is to stop yapping about about formatting parameters if we're not anywhere near a format literal. The other use case is to fix suggestions such as https://github.com/rust-lang/rust/issues/141350. It might also be useful for new or existing diagnostics that check whether they're in a format-like macro. cc `@xizheyin` `@fmease`
2025-06-22Rollup merge of #142458 - oli-obk:dyn-incompat, r=compiler-errorsGuillaume Gomez-153/+69
Merge unboxed trait object error suggestion into regular dyn incompat error Another hir-walker removed from the well-formed queries. This error was always a duplicate of another, but it was able to provide more information because it could invoke `is_dyn_compatible` without worrying about cycle errors. That's also the reason we can't put the error directly into hir_ty_lowering when lowering a `dyn Trait` within an associated item signature. So instead I packed it into the error handling of wf obligation checking.
2025-06-22Don't suggest changing a method inside a expansionUrgau-2/+32
2025-06-22Auto merge of #142706 - fee1-dead-contrib:push-zsznlqyrzsqo, r=oli-obkbors-2/+4
completely deduplicate `Visitor` and `MutVisitor` r? oli-obk This closes rust-lang/rust#127615. ### Discussion > * Give every `MutVisitor::visit_*` method a corresponding `flat_map_*` method. Not every AST node exists in a location where they can be mapped to multiple instances of themselves. Not every AST node exists in a location where they can be removed from existence (e.g. `filter_map_expr`). I don't think this is doable. > * Give every `MutVisitor::visit_*` method a corresponding `Visitor` method and vice versa The only three remaining method-level asymmetries after this PR are `visit_stmt` and `visit_nested_use_tree` (only on `Visitor`) and `visit_span` (only on `MutVisitor`). `visit_stmt` doesn't seem applicable to `MutVisitor` because `walk_flat_map_stmt_kind` will ask `flat_map_item` / `filter_map_expr` to potentially turn a single `Stmt` to multiple based on what a visitor wants. So only using `flat_map_stmt` seems appropriate. `visit_nested_use_tree` is used for `rustc_resolve` to track stuff. Not useful for `MutVisitor` for now. `visit_span` is currently not used for `MutVisitor` already, it was just kept in case we want to revive rust-lang/rust#127241. cc `@cjgillot` maybe we could remove for now and re-insert later if we find a use-case? It does involve some extra effort to maintain. * Remaining FIXMEs `visit_lifetime` has an extra param for `Visitor` that's not in `MutVisitor`. This is again something only used by `rustc_resolve`. I think we can keep that symmetry for now.
2025-06-22Port `#[must_use]` to new attribute parsing infrastructureJonathan Brouwer-40/+36
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22Stop dbg! macro yapping about format modifiersmejrs-9/+25
2025-06-22Implement DesugaringKind::FormatLiteralmejrs-143/+190
2025-06-22Rollup merge of #142850 - tshepang:patch-1, r=jieyouxuJacob Pratt-1/+0
remove asm_goto feature annotation, for it is now stabilized This was stabilized in https://github.com/rust-lang/rust/pull/133870
2025-06-22Rollup merge of #142845 - dpaoliello:textrel-on-minimal-lib, r=jieyouxuJacob Pratt-5/+3
Enable textrel-on-minimal-lib for Windows `bin_name` needs to be used when building a runnable executable. Addresses item in rust-lang/rust#128602 --- try-job: x86_64-mingw-* try-job: x86_64-msvc-* try-job: i686-msvc-*
2025-06-22Rollup merge of #142841 - dpaoliello:fmt-write-bloat, r=jieyouxuJacob Pratt-7/+2
Enable fmt-write-bloat for Windows Seems to be working fine for MSVC once it has the correct binary name. Addresses item in rust-lang/rust#128602 --- try-job: x86_64-mingw-* try-job: x86_64-msvc-* try-job: i686-msvc-*
2025-06-22Rollup merge of #142776 - dtolnay:hirattrstyle2, r=jdonszelmannJacob Pratt-45/+63
All HIR attributes are outer Fixes https://github.com/rust-lang/rust/issues/142649. Closes https://github.com/rust-lang/rust/pull/142759. All HIR attributes, including parsed and not yet parsed, will now be rendered as outer attributes by `rustc_hir_pretty`. The original style of the corresponding AST attribute(s) is not relevant for pretty printing, only for diagnostics. r? ````@jdonszelmann````
2025-06-22Auto merge of #141856 - folkertdev:run-make-forward-compiletest-runner, ↵bors-1/+2
r=jieyouxu forward the bootstrap `runner` to `run-make` The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions. The configuration can look like this ```toml # in bootstrap.toml [target.s390x-unknown-linux-gnu] runner = "qemu-s390x -L /usr/s390x-linux-gnu" ``` Any C compilation automatically sets the correct target. Calls to rustc must use `.target(target())`. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary: ``` ./x test tests/run-make/c-link-to-rust-va-list-fn --target s390x-unknown-linux-gnu ``` The runner can also be used for e.g. running with `valgrind`. This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure? r? `@jieyouxu` try-job: test-various try-job: armhf-gnu
2025-06-22forward the bootstrap `runner` to `run-make`Folkert de Vries-1/+2
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
2025-06-21Skip collecting no-op DropGlue in vtablesMark Rousskov-0/+23
Since 122662 this no longer gets used in vtables, so we're safe to fully drop generating these empty functions. Those are eventually cleaned up by LLVM, but it's wasteful to produce them in the first place. This also adds a missing test for fn-ptr casts, which do still need to generate no-op drop glue. It's possible a future optimization could point all of those at the same drop glue (e.g., for *mut ()) rather than for each separate type, but that would require extra work for CFI and isn't particularly easy to do anyway.
2025-06-21remove asm_goto feature annotation, for it is now stabilizedTshepang Mbambo-1/+0