about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-08-29Auto merge of #145978 - Zalathar:rollup-0dzk72g, r=Zalatharbors-0/+25
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143713 (Add a mailmap entry for gnzlbg) - rust-lang/rust#144275 (implement Sum and Product for Saturating(u*)) - rust-lang/rust#144354 (fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0) - rust-lang/rust#145387 (Remove TmpLayout in layout_of_enum) - rust-lang/rust#145793 (std library: use execinfo library also on NetBSD.) - rust-lang/rust#145884 (Test `instrument-mcount` codegen) - rust-lang/rust#145947 (Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml`) - rust-lang/rust#145972 (fix `core::marker::Destruct` doc) - rust-lang/rust#145977 (tests: Ignore basic-stepping.rs on riscv64) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-29Rollup merge of #145977 - CaiWeiran:basic-stepping-test, r=jieyouxuStuart Cook-0/+1
tests: Ignore basic-stepping.rs on riscv64 Same as [PR 145745](https://github.com/rust-lang/rust/pull/145745) r? `@lqd`
2025-08-29tests: Ignore basic-stepping.rs on riscv64Caiweiran-0/+1
2025-08-29Rollup merge of #145884 - clubby789:test-mcount, r=Mark-SimulacrumStuart Cook-0/+24
Test `instrument-mcount` codegen Closes rust-lang/rust#92109 by testing that a call to `mcount` is actually emitted
2025-08-29Auto merge of #145377 - ChayimFriedman2:solver-def-id, r=lcnrbors-1/+1
Switch next solver to use a specific associated type for trait def id The compiler just puts `DefId` in there, but rust-analyzer uses different types for each kind of item. See [the Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/Implmentating.20New.20Trait.20Solver/near/534329794). In short, it will be a tremendous help to r-a to use specific associated types, while for the solver and the compiler it's a small change. So I ported `TraitId`, as a proof of concept and it's also likely the most impactful. r? types
2025-08-29compiler: Add `{x86_64,aarch64,riscv64gc}-unknown-managarm-mlibc` targetsno92-4/+14
Co-authored-by: Dennis Bonke <dennis@managarm.org>
2025-08-28Auto merge of #145970 - GuillaumeGomez:rollup-pr11qds, r=GuillaumeGomezbors-41/+186
Rollup of 6 pull requests Successful merges: - rust-lang/rust#142472 (Add new `doc(attribute = "...")` attribute) - rust-lang/rust#145368 (CFI: Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`) - rust-lang/rust#145853 (Improve error messages around invalid literals in attribute arguments) - rust-lang/rust#145920 (bootstrap: Explicitly mark the end of a failed test's captured output) - rust-lang/rust#145937 (add doc-hidden to exports in attribute prelude) - rust-lang/rust#145965 (Move exporting of profiler and sanitizer symbols to the LLVM backend) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-28Rollup merge of #145853 - JonathanBrouwer:fix-lit-parsing, r=jdonszelmannGuillaume Gomez-36/+12
Improve error messages around invalid literals in attribute arguments r? `@jdonszelmann` This previously created two errors, which is a bit ugly and the second one didn't add any value Blocked on https://github.com/rust-lang/rust/pull/143193
2025-08-28Rollup merge of #145368 - rcvalle:rust-cfi-fix-142284, r=dianqkGuillaume Gomez-0/+22
CFI: Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins` Fix rust-lang/rust#142284 by ensuring that `#![no_builtins]` crates can still emit bitcode when proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto) is used.
2025-08-28Rollup merge of #142472 - GuillaumeGomez:doc-attribute-attribute, r=fmeaseGuillaume Gomez-5/+152
Add new `doc(attribute = "...")` attribute Fixes rust-lang/rust#141123. The implementation and purpose of this new `#[doc(attribute = "...")]` attribute is very close to `#[doc(keyword = "...")]`. Which means that luckily for us, most of the code needed was already in place and `@Noratrieb` nicely wrote a first draft that helped me implement this new attribute very fast. Now with all this said, there is one thing I didn't do yet: adding a `rustdoc-js-std` test. I added GUI tests with search results for attributes so should be fine but I still plan on adding one for it once documentation for builtin attributes will be written into the core/std libs. You can test it [here](https://rustdoc.crud.net/imperio/doc-attribute-attribute/foo/index.html). cc `@Noratrieb` `@Veykril`
2025-08-28fix(lexer): Don't require frontmatters to be escaped with indented fencesEd Page-53/+38
The RFC only limits hyphens at the beginning of lines and not if they are indented or embedded in other content. Sticking to that approach was confirmed by the T-lang liason at https://github.com/rust-lang/rust/issues/141367#issuecomment-3202217544 There is a regression in error message quality which I'm leaving for someone if they feel this needs improving.
2025-08-28compiler: Include span of too huge enum with -Cdebuginfo=2Martin Nordholts-4/+14
We have a ui test to ensure we emit an error if we encounter too big enums. Before this fix, compiling the test with `-Cdebuginfo=2` would not include the span of the instantiation site, because the error is then emitted from a different code path that does not include the span. Propagate the span to the error also in the debuginfo case, so the test passes regardless of debuginfo level.
2025-08-28Update uitest stderrJonathan Brouwer-50/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Add another case to the bad-lit-suffixes testJonathan Brouwer-1/+23
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Auto merge of #145807 - zachs18:only-consider-auto-traits-empty, ↵bors-0/+161
r=compiler-errors When determining if a trait has no entries for the purposes of omitting vptrs from subtrait vtables, consider its transitive supertraits' entries, instead of just its own entries. When determining if a non-first supertrait vptr can be omitted from a subtrait vtable, check if the supertrait or any of its (transitive) supertraits have methods, instead of only checking if the supertrait itself has methods. This fixes the soundness issue where a vptr would be omitted for a supertrait with no methods but that itself had a supertrait with methods, while still optimizing the case where the supertrait is "truly" empty (it has no own vtable entries, and none of its (transitive) supertraits have any own vtable entries). Fixes <https://github.com/rust-lang/rust/issues/145752> ----- Old description: ~~Treat all non-auto traits as non-empty (possibly having methods) for purposes of determining if we need to emit a vptr for a non-direct supertrait (and for new "sibling" entries after a direct or non-direct supertrait).~~ This fixes (I believe) the soundness issue, ~~but regresses vtable sizes and possibly upcasting perf in some cases when using trait hierarchies with empty non-auto traits (see `tests/ui/traits/vtable/multiple-markers.stderr`) since we use vptrs in some cases where we could re-use the vtable.~~ Fixes <https://github.com/rust-lang/rust/issues/145752> Re-opens (not anymore) <https://github.com/rust-lang/rust/issues/114942> Should not affect <https://github.com/rust-lang/rust/issues/131813> (i.e. the soundness issue is still fixed, ~~though the relevant vtables in the `trait Evil` example will be larger now~~) cc implementation history <https://github.com/rust-lang/rust/pull/131864> <https://github.com/rust-lang/rust/pull/113856> ----- ~~It should be possible to check if a trait has any methods from itself *or* supertraits (instead of just from itself), but to fix the immediate soundness issue, just assume any non-auto trait could have methods. A more optimistic check can be implemented later (or if someone does it soon it could just supercede this PR :smile:).~~ Done in latest push `@rustbot` label A-dyn-trait F-trait_upcasting
2025-08-28Add ui test for unsupported `doc(attribute = "...")` case for attributes ↵Guillaume Gomez-0/+17
with namespace
2025-08-28Add tests for `doc(attribute = "...")` attributeGuillaume Gomez-5/+135
2025-08-28Rollup merge of #145941 - Urgau:int_to_ptr_transmutes-unsized, r=lcnrStuart Cook-0/+50
Disable `integer_to_ptr_transmutes` suggestion for unsized types This PR disables the machine-applicable `integer_to_ptr_transmutes` lint suggestion for unsized types, as [`std::ptr::with_exposed_provenance`](https://doc.rust-lang.org/std/ptr/fn.with_exposed_provenance.html) requires sized types. We should probably mention [`std::ptr::from_raw_parts`](https://doc.rust-lang.org/std/ptr/fn.from_raw_parts.html) when it becomes stable. Related to https://github.com/rust-lang/rust/issues/145935
2025-08-28Rollup merge of #145928 - Darksonn:file_as_c_str, r=joshtriplettStuart Cook-3/+3
Rename `Location::file_with_nul` to `file_as_c_str` This renames the method to be consistent with the ongoing T-libs-api FCP found at https://github.com/rust-lang/rust/issues/141727#issuecomment-3228016708. I did not rename the unstable feature as we are going to be stabilizing it soon anyway. This will probably break RfL, so it will require an updated commit hash for the Linux Kernel that I will add here soon. r? `@Amanieu`
2025-08-28Rollup merge of #144864 - Muscraft:no-source-fixes, r=jieyouxuStuart Cook-19/+63
No source fixes This PR started as a fix for a rendering bug that [got noticed in #143661](https://github.com/rust-lang/rust/pull/143661#discussion_r2199109530), but turned into a fix for any rendering bugs related to files with no source. - Don't add an end column separator after a file with no source - Add column separator before secondary messages with no source - Render continuation between no source labels Before ``` error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap` ╭▸ $DIR/multi-suggestion.rs:17:13 │ LL │ let _ = std::collections::HashMap(); │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ╭▸ $SRC_DIR/std/src/collections/hash/map.rs:LL:COL │ ╰ note: `std::collections::HashMap` defined here ╰╴ note: constructor is not visible here due to private fields ╭▸ $SRC_DIR/alloc/src/boxed.rs:LL:COL │ ╰ note: private field │ ╰ note: private field ``` After ``` error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap` ╭▸ $DIR/multi-suggestion.rs:17:13 │ LL │ let _ = std::collections::HashMap(); │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ╰╴ ╭▸ $SRC_DIR/std/src/collections/hash/map.rs:LL:COL │ ╰ note: `std::collections::HashMap` defined here note: constructor is not visible here due to private fields ╭▸ $SRC_DIR/alloc/src/boxed.rs:LL:COL │ ├ note: private field │ ╰ note: private field ``` Note: This PR also makes it so `rustc` and `annotate-snippets` match in these cases
2025-08-28Rollup merge of #143193 - JonathanBrouwer:link_rework, r=jdonszelmannStuart Cook-365/+942
Port `#[link]` to the new attribute parsing infrastructure Ports `link` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
2025-08-28Auto merge of #145949 - jhpratt:rollup-smzd7tr, r=jhprattbors-0/+143
Rollup of 5 pull requests Successful merges: - rust-lang/rust#145382 (Add assembly test for `-Zreg-struct-return` option) - rust-lang/rust#145746 (Fix STD build failing for target_os = "espidf") - rust-lang/rust#145826 (Use AcceptContext in AttribueParser::check_target) - rust-lang/rust#145894 (Ensure the coordinator thread terminates before its channels drop) - rust-lang/rust#145946 (Remove unnecessary `[dependencies.unicode-properties]` entries.) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-27Rollup merge of #145382 - winstonallo:reg-struct-return-asm-test, r=tgross35Jacob Pratt-0/+143
Add assembly test for `-Zreg-struct-return` option r? `@tgross35` As discussed in rust-lang/rust#145309 with `@tgross35` and `@ojeda,` I added assembly tests for the `-Zreg-struct-return` option verifying that it changes the ABI from hidden pointer to register-return on x86_32. The test covers: - Direct struct construction, showing register return vs hidden pointer - External function calls returning structs, showing ABI mismatch handling Different memory layouts affect ABI mismatch handling, but register returns use the same register allocation regardless of struct field layout (apart from the fact that they use smaller registers for smaller structs, of course). [Here](https://godbolt.org/z/dcW6rnMG3) is a compiler explorer with 2 examples. Let me know if there is anything more I could add. Since register returns only happen for structs up to the size of 2 registers, I figured testing the pivot value (8 bytes) would be most critical.
2025-08-28Auto merge of #145877 - nikic:capture-address, r=tmiaskobors-17/+32
Use captures(address) instead of captures(none) for indirect args While provenance cannot be captured through these arguments, the address / object identity can. Fixes https://github.com/rust-lang/rust/issues/137668. r? `@ghost`
2025-08-27fix target-pointer-width in testsWaffle Lapkin-2/+2
2025-08-27turn pointer width into an integer in target.jsonWaffle Lapkin-8/+8
2025-08-27Add test batch 2Oneirical-37/+41
2025-08-27Disable `int_to_ptr_transmutes` suggestion for unsized typesUrgau-0/+50
2025-08-27Stabilize BTree{Map,Set}::extract_ifSidney Cammeresi-1/+0
2025-08-27Changes to the uitestsJonathan Brouwer-365/+942
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-27Add assembly tests verifying the functionality of `-Zreg-struct-return` for ↵winstonallo-0/+143
structs of different sizes. This test covers: * The callee side, making sure that the structs are correctly loaded into registers when `-Zreg-struct-return` is enabled * The caller side, making sure that callers do receive returned structs in registers when `-Zreg-struct-return` is enabled Structs of the size of up to 2 registers (8 bytes) can be returned in registers in x86_32. Therefore, the tests are done with 3 different struct sizes: * 2 bytes (register returns should happen) * 8 bytes (last value where register returns should happen) * 12 bytes (register returns should not happen even when `-Zreg-struct-return` is enabled)
2025-08-27Fix format string grammar in docs and improve alignment error messageNilotpal Gupta-7/+15
2025-08-27inline at the callsite & warn when target features mismatchJames Barford-Evans-12/+154
Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
2025-08-27Rename `Location::file_with_nul` to `file_as_c_str`Alice Ryhl-3/+3
2025-08-27Auto merge of #145923 - matthiaskrgr:rollup-rkejtos, r=matthiaskrgrbors-4/+21
Rollup of 6 pull requests Successful merges: - rust-lang/rust#144274 (add Option::reduce) - rust-lang/rust#145562 (Simplify macro generating ToString implementations for `&…&str`) - rust-lang/rust#145625 (improve float to_degrees/to_radians rounding comments and impl) - rust-lang/rust#145740 (Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`) - rust-lang/rust#145885 (Inherit TCC in debuginfo tests on macOS) - rust-lang/rust#145905 (Stop calling unwrap when format foreign has trailing dollar) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-27Rollup merge of #145905 - TaKO8Ki:fix-137580, r=nnethercoteMatthias Krüger-4/+21
Stop calling unwrap when format foreign has trailing dollar Fixes rust-lang/rust#137580
2025-08-27Auto merge of #140737 - amandasystems:revised-constraint-search, r=lcnrbors-28/+25
Region inference: Use outlives-static constraints in constraint search Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`. This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that. The PR was extracted out of rust-lang/rust#130227 and consists of one-third of its functional payload. r? lcnr
2025-08-27Rollup merge of #142215 - saethlin:mir-building-tests, r=cjgillotMatthias Krüger-47/+69
Use -Zmir-opt-level=0 in tests for MIR building The mir-opt test suite currently defaults all tests in it to `-Zmir-opt-level=4`, so if a test is trying to test MIR _building_ not optimizations and it is in that directory, it _must_ override the default mir-opt-level.
2025-08-27remove old crash testTakayuki Maeda-6/+3
2025-08-27Add test batch 1Oneirical-80/+66
2025-08-26Use -Zmir-opt-level=0 in tests for MIR buildingBen Kimock-47/+69
2025-08-27Auto merge of #144841 - cjgillot:typeck-no-attrs, r=davidtwcobors-4/+27
Access less HIR attributes from typeck Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions. This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: https://github.com/rust-lang/rust/pull/144841#issuecomment-3153339771 Fixes https://github.com/rust-lang/rust/issues/124352
2025-08-26Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`Matthew Maurer-0/+22
Fix #142284 by ensuring that `#![no_builtins]` crates can still emit bitcode when proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto) is used.
2025-08-26Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmannSamuel Tardieu-171/+537
Use attribute name in message for "outer attr used as inner attr" errors
2025-08-26Rollup merge of #144499 - Enselic:ci-debuginfo-level-tests, r=davidtwcoSamuel Tardieu-3/+19
ci: Begin running ui tests with `rust.debuginfo-level-tests=1` To reduce risk of regressing on generating debuginfo e.g. in the form of ICE:s. This will also ensure that future ui tests work with different debuginfo levels. See https://github.com/rust-lang/rust/issues/61117. When I looked at run time for different CI jobs, **x86_64-gnu-debug** was far from the bottleneck, so it should be fine to make it perform more work. A handful of tests are failing so we need to force debuginfo=0 on those for now. We'll start small with debuginfo=1. We'll step up to debuginfo=2 once most (all?) tests can handle debuginfo=1. There are more failures with debuginfo=2 than with debuginfo=1.
2025-08-26fix: Render continuation between no source labelsScott Schafer-1/+1
2025-08-26fix: Add col separator before secondary messages with no sourceScott Schafer-0/+62
2025-08-26fix: Don't add an end column separator after a file with no sourceScott Schafer-18/+0
2025-08-27stop returning errors when format foreign has trailing dollarTakayuki Maeda-0/+20
2025-08-26Rollup merge of #145481 - mu001999-contrib:fix/closure-sugg, r=SparrowLiiGuillaume Gomez-2/+52
Add parentheses for closure when suggesting calling closure Fixes rust-lang/rust#145404