summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-08-01rustdoc: don't treat methods under const impls or traits as constDeadbeef-0/+36
2025-08-01thread name in stack overflow messagejoboet-3/+9
2025-07-24Update another test for rustc_alignJosh Stone-1/+3
2025-07-24Mitigate `#[align]` name resolution ambiguity regression with a renameJieyou Xu-107/+105
From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc` are always perma-unstable and feature-gated by `feature(rustc_attrs)`. See regression RUST-143834. For the underlying problem where even introducing new feature-gated unstable built-in attributes can break user code such as ```rs macro_rules! align { () => { /* .. */ }; } pub(crate) use align; // `use` here becomes ambiguous ``` refer to RUST-134963. Since the `#[align]` attribute is still feature-gated by `feature(fn_align)`, we can rename it as a mitigation. Note that `#[rustc_align]` will obviously mean that current unstable user code using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`, but this is a short-term mitigation to buy time, and is expected to be changed to a better name with less collision potential. See <https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-07-17/near/529290371> where mitigation options were considered. (cherry picked from commit 69b71e44107b4905ec7ad84ccb3edf4f14b3df69)
2025-07-24Add test demonstrating current beta `#[align]` name resolution regressionJieyou Xu-0/+43
See RUST-143834. (cherry picked from commit b2e94bf020a99473cf80f05f410af8a5cfc486a6)
2025-07-24tests: Add a regression test for crt-static with target featuresJens Reidel-0/+32
Signed-off-by: Jens Reidel <adrian@travitia.xyz> (cherry picked from commit 1b35d5f89c4e3c605cd455a28f00aad24de0a662)
2025-07-24Reword mismatched-lifetime-syntaxes text based on feedbackJake Goulding-348/+462
Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion. (cherry picked from commit 553074431875701f66107049339dc1e67f0cdeba)
2025-07-17trait_sel: `MetaSized` always holds temporarilyDavid Wood-232/+70
As a temporary measure while a proper fix for `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` is implemented, make `MetaSized` obligations always hold. In effect, temporarily reverting the `sized_hierarchy` feature. This is a small change that can be backported. (cherry picked from commit 8d64937dc25eb2b01596a3581ec2660d8e81b9b2)
2025-07-17Fix rustdoc not correctly showing attributes with re-exportsJonathan Brouwer-0/+13
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com> (cherry picked from commit 58418d881a91e9f37b0c8fd07f0218850725efda)
2025-07-17Taint body on invalid call ABIMichael Goulet-0/+23
(cherry picked from commit e776065164f22872e8cadf5bc5e47352c27982dc)
2025-07-17Add rust-invalid ABIMichael Goulet-0/+22
(cherry picked from commit e245570def155191b61f73647eb543dd45685b2f)
2025-07-10Do not optimize stable-mir ui tests.Camille GILLOT-189/+472
(cherry picked from commit b1fdb4bdc8818aced53e46a34a3e92cfcfcc8ece)
2025-07-10Do not unify borrowed locals in CopyProp.Camille GILLOT-92/+358
(cherry picked from commit bab9c752e836bb94d87249422d48f8c85b4f41a4)
2025-07-10Add a regression test for ld64dianqk-0/+24
(cherry picked from commit 32115c3a1710d1ac98b2ffea23014e0d2ee19c0d)
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. (cherry picked from commit 8469966710a16fd11af832d592569bcdf2298081)
2025-06-23Update version placeholdersJosh Stone-1/+1
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-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
2025-06-21Enable textrel-on-minimal-lib for WindowsDaniel Paoliello-5/+3
2025-06-21Auto merge of #142546 - cjgillot:reachable-jump, r=compiler-errorsbors-1/+12
Only traverse reachable blocks in JumpThreading. Fixes https://github.com/rust-lang/rust/issues/131451 We only compute loop headers for reachable blocks. We shouldn't try to perform an opt on unreachable blocks anyway.
2025-06-21Enable fmt-write-bloat for WindowsDaniel Paoliello-7/+2
2025-06-21All HIR attributes are outerDavid Tolnay-45/+41
2025-06-21Add regression test for issue 142649David Tolnay-0/+22
2025-06-21Rollup merge of #142698 - tgross35:concat-byte-cstr-diag, r=petrochenkovJana Dönszelmann-29/+95
Improve diagnostics for `concat_bytes!` with C string literals Use the same error as other invalid types for `concat_bytes!`, rather than using `ConcatCStrLit` from `concat!`. Also add more information with a note about why this doesn't work, and a suggestion to use a null-terminated byte string instead.
2025-06-21Rollup merge of #142788 - lolbinarycat:core-AsciiChar-alias, r=tgross35Matthias Krüger-0/+12
add doc(alias("AsciiChar")) to core::ascii::Char Added it to the reexported, which is intended rustdoc behavior, but is apparently untested, so I also added a test for it.
2025-06-21Rollup merge of #142787 - samueltardieu:diag-items-for-clippy, ↵Matthias Krüger-10/+0
r=Manishearth,Urgau Add diagnostic items for Clippy Clippy still uses some paths to access items from the standard library. Adding the missing diagnostic items allows removing the last remaining paths. Closes rust-lang/rust-clippy#5393
2025-06-21Rollup merge of #142597 - folkertdev:abi-cannot-be-called, r=workingjubileeMatthias Krüger-184/+1307
error on calls to ABIs that cannot be called We recently added `extern "custom"`, which cannot be called using a rust call expression. But there are more ABIs that can't be called in that way, because the call does not semantically make sense. More details are in https://github.com/rust-lang/rust/issues/140566#issuecomment-2846205457 r? `@workingjubilee` try-job: x86_64-gnu-llvm-19-3
2025-06-21Rollup merge of #142502 - nnethercote:rustdoc-json-GenericArgs, r=aDotInTheVoidMatthias Krüger-0/+20
rustdoc_json: improve handling of generic args This PR fixes some inconsistencies and inefficiencies in how generic args are handled by rustdoc-json-types. r? `@aDotInTheVoid`
2025-06-21rustdoc_json: represent generic args consistently.Nicholas Nethercote-2/+2
They show up in three places: once as `Option<Box<GenericArgs>>`, once as `Box<GenericArgs>`, and once as `GenericArgs`. The first option is best. It is more compact because generic args are often missing. This commit changes the latter two to the former. Example output, before and after, for the `AssocItemConstraint` change: ``` {"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}},"binding":{...}} {"name":"Offset","args":null,"binding":{...}} ``` Example output, before and after, for the `Type::QualifiedPath` change: ``` {"qualified_path":{"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}}, ...}} {"qualified_path":{"name":"Offset","args":null, ...}} ``` This reduces JSON output size, but not by much (e.g. 0.5%), because `AssocItemConstraint` and `Type::QualifiedPath` are uncommon.