about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-08-13Ignore cross compile check for `tests/run-make/doctests-keep-binaries-2024` testGuillaume Gomez-0/+2
2024-08-13Update `tests/run-make/doctests-keep-binaries-2024/rmake.rs` test to new ↵Guillaume Gomez-6/+5
run-make API
2024-08-13Run fmtGuillaume Gomez-2/+4
2024-08-13Fix commands syntax in rustdoc-ui testsGuillaume Gomez-9/+9
2024-08-13Only keep "useful" code in `tests/rustdoc-ui/2024-doctests-checks.rs`Guillaume Gomez-24/+8
2024-08-13Add doctest to ensure that doctests with crate-level attributes are not part ↵Guillaume Gomez-0/+34
of merged doctest
2024-08-13Add more merged doctests testsGuillaume Gomez-0/+21
2024-08-13Don't special-case if there is only one merged doctestGuillaume Gomez-39/+19
2024-08-13Run mergeable doctest as part of standalone doctests if there is only oneGuillaume Gomez-11/+30
2024-08-13Add 2024 edition doctests to cover corner casesGuillaume Gomez-0/+55
2024-08-13Disable merged doctests by defaultGuillaume Gomez-1/+0
2024-08-13Add new `run-make` tests for doctestsGuillaume Gomez-0/+171
2024-08-13Add/update `rustdoc-ui` tests to check new merged doctestsGuillaume Gomez-9/+42
2024-08-13Correctly handle doctests with invalid ASTGuillaume Gomez-0/+111
2024-08-13Rollup merge of #129026 - ↵Matthias Krüger-1/+1
rcvalle:rust-cfi-move-cfi-ui-tests-to-cfi-directory, r=compiler-errors CFI: Move CFI ui tests to cfi directory Move the CFI ui tests to the cfi directory and removes the cfi prefix from tests file names similarly to how the cfi codegen tests are organized.
2024-08-13Rollup merge of #128643 - beetrees:ppc64-abi-fix, r=bjorn3Matthias Krüger-0/+132
Refactor `powerpc64` call ABI handling As the [specification](https://openpowerfoundation.org/specifications/64bitelfabi/) for the ELFv2 ABI states that returned aggregates are returned like arguments as long as they are at most two doublewords, I've merged the `classify_arg` and `classify_ret` functions to reduce code duplication. The only functional change is to fix #128579: the `classify_ret` function was incorrectly handling aggregates where `bits > 64 && bits < 128`. I've used the aggregate handling implementation from `classify_arg` which doesn't have this issue. `@awilfox` could you test this on `powerpc64-unknown-linux-musl`? I'm only able to cross-test on `powerpc64-unknown-linux-gnu` and `powerpc64le-unknown-linux-gnu` locally at the moment, and as a tier 3 target `powerpc64-unknown-linux-musl` has zero CI coverage. Fixes: #128579
2024-08-13Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlinbors-77/+152
miri: make vtable addresses not globally unique Miri currently gives vtables a unique global address. That's not actually matching reality though. So this PR enables Miri to generate different addresses for the same type-trait pair. To avoid generating an unbounded number of `AllocId` (and consuming unbounded amounts of memory), we use the "salt" technique that we also already use for giving constants non-unique addresses: the cache is keyed on a "salt" value n top of the actually relevant key, and Miri picks a random salt (currently in the range `0..16`) each time it needs to choose an `AllocId` for one of these globals -- that means we'll get up to 16 different addresses for each vtable. The salt scheme is integrated into the global allocation deduplication logic in `tcx`, and also used for functions and string literals. (So this also fixes the problem that casting the same function to a fn ptr over and over will consume unbounded memory.) r? `@saethlin` Fixes https://github.com/rust-lang/miri/issues/3737
2024-08-12CFI: Move CFI ui tests to cfi directoryRamon de C Valle-1/+1
Moves the CFI ui tests to the cfi directory and removes the cfi prefix from tests file names similarly to how the cfi codegen tests are organized.
2024-08-12Rollup merge of #129013 - Kobzol:remove-unused-git-clone-sha-file, r=jieyouxuMatthias Krüger-23/+0
Remove unused script from run-make tests Its last usage was removed in https://github.com/rust-lang/rust/pull/128636. Tracking issue: https://github.com/rust-lang/rust/issues/121876 r? jieyouxu
2024-08-12Rollup merge of #128912 - compiler-errors:do-not-recommend-impl, r=lcnrMatthias Krüger-0/+42
Store `do_not_recommend`-ness in impl header Alternative to #128674 It's less flexible, but also less invasive. Hopefully it's also performant. I'd recommend we think separately about the design for how to gate arbitrary diagnostic attributes moving forward.
2024-08-12Rollup merge of #128712 - compiler-errors:normalize-borrowck, r=lcnrMatthias Krüger-1/+19
Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on #128694
2024-08-12Remove unused script from run-make testsJakub Beránek-23/+0
2024-08-12Rollup merge of #128994 - nnethercote:fix-Parser-look_ahead-more, ↵Guillaume Gomez-0/+58
r=compiler-errors Fix bug in `Parser::look_ahead`. The special case was failing to handle invisible delimiters on one path. Fixes (but doesn't close until beta backported) #128895. r? `@davidtwco`
2024-08-12Rollup merge of #128937 - lqd:clean-rmake-tests, r=jieyouxuGuillaume Gomez-83/+49
Fix warnings in rmake tests on `x86_64-unknown-linux-gnu` r? `@jieyouxu` This PR fixes some warnings I saw in rmake tests. I didn't deny more warnings in this PR until `@jieyouxu` gives their opinion, but maybe we should actually deny all warnings in `rmake.rs` files? I've also only looked at non-ignored tests on `x86_64-unknown-linux-gnu`, and denying warnings would require a try build for all targets 😓.
2024-08-12Rollup merge of #128929 - saethlin:enable-codegen-units-tests, r=compiler-errorsGuillaume Gomez-57/+38
Fix codegen-units tests that were disabled 8 years ago I don't know if any of these tests still have value. They were disabled by https://github.com/rust-lang/rust/pull/33890, and we've survived without them for a while. But considering how small this test suite is, maybe it's worth having them. I also had to add some normalization to the codegen-units tests output. I think the fact that I had to add some underscores how poor our test coverage is.
2024-08-12Rollup merge of #128886 - GrigorenkoPV:untranslatable-diagnostic, r=nnethercoteGuillaume Gomez-4/+0
Get rid of some `#[allow(rustc::untranslatable_diagnostic)]` `@rustbot` label +A-translation cc https://github.com/rust-lang/rust/issues/100717
2024-08-12Rollup merge of #128537 - Jamesbarford:118980-const-vector, r=RalfJung,nikicGuillaume Gomez-0/+107
const vector passed through to codegen This allows constant vectors using a repr(simd) type to be propagated through to the backend by reusing the functionality used to do a similar thing for the simd_shuffle intrinsic #118209 r​? RalfJung
2024-08-12Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdocGuillaume Gomez-61/+82
Unify run button display with "copy code" button and with mdbook buttons Follow-up of https://github.com/rust-lang/rust/pull/128339. It looks like this (coherency++, yeay!): ![Screenshot from 2024-07-30 15-16-31](https://github.com/user-attachments/assets/5e262e5b-f338-4085-94ca-e223033a43db) Can be tested [here](https://rustdoc.crud.net/imperio/run-button/foo/struct.Bar.html). r? `@notriddle`
2024-08-12Rollup merge of #128149 - RalfJung:nontemporal_store, r=jieyouxu,Amanieu,JubileeGuillaume Gomez-3/+27
nontemporal_store: make sure that the intrinsic is truly just a hint The `!nontemporal` flag for stores in LLVM *sounds* like it is just a hint, but actually, it is not -- at least on x86, non-temporal stores need very special treatment by the programmer or else the Rust memory model breaks down. LLVM still treats these stores as-if they were normal stores for optimizations, which is [highly dubious](https://github.com/llvm/llvm-project/issues/64521). Let's avoid all that dubiousness by making our own non-temporal stores be truly just a hint, which is possible on some targets (e.g. ARM). On all other targets, non-temporal stores become regular stores. ~~Blocked on https://github.com/rust-lang/stdarch/pull/1541 propagating to the rustc repo, to make sure the `_mm_stream` intrinsics are unaffected by this change.~~ Fixes https://github.com/rust-lang/rust/issues/114582 Cc `@Amanieu` `@workingjubilee`
2024-08-12Auto merge of #128371 - andjo403:rangeAttribute, r=nikicbors-10/+77
Add range attribute to scalar function results and arguments as LLVM 19 adds the range attribute this starts to use it for better optimization. hade been interesting to see a perf run with the https://github.com/rust-lang/rust/pull/127513 closes https://github.com/rust-lang/rust/issues/50156 cc https://github.com/rust-lang/rust/issues/49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.
2024-08-12make the codegen test also cover an ill-behaved arch, and add linksRalf Jung-3/+12
2024-08-12Auto merge of #128862 - cblh:fix/128855, r=scottmcmbors-0/+13
fix: #128855 Ensure `Guard`'s `drop` method is removed at `opt-level=s` for `… fix: #128855 …Copy` types Added `#[inline]` to the `drop` method in the `Guard` implementation to ensure that the method is removed by the compiler at optimization level `opt-level=s` for `Copy` types. This change aims to align the method's behavior with optimization expectations and ensure it does not affect performance. r​? `@scottmcm`
2024-08-12Fix bug in `Parser::look_ahead`.Nicholas Nethercote-0/+58
The special case was failing to handle invisible delimiters on one path. Fixes #128895.
2024-08-12Auto merge of #126793 - saethlin:mono-rawvec, r=scottmcmbors-71/+131
Apply "polymorphization at home" to RawVec The idea here is to move all the logic in RawVec into functions with explicit size and alignment parameters. This should eliminate all the fussing about how tweaking RawVec code produces large swings in compile times. This uncovered https://github.com/rust-lang/rust-clippy/issues/12979, so I've modified the relevant test in a way that tries to preserve the spirit of the test without tripping the ICE.
2024-08-11Normalize struct tail properly in borrowck and hir typeckMichael Goulet-1/+19
2024-08-11Fix debuginfo providers/testsBen Kimock-6/+6
2024-08-11Add range attribute to scalar function results and argumentsAndreas Jonson-10/+77
2024-08-11Refactor `powerpc64` call ABI handlingbeetrees-0/+132
2024-08-11tests: ignore `dump-ice-to-disk` on windows许杰友 Jieyou Xu (Joe)-3/+4
2024-08-11use `rfs` in rustdoc io rmake testRémy Rakic-7/+5
2024-08-11tests: tidy up `dump-ice-to-disk` and make assertion failures extremely verbose许杰友 Jieyou Xu (Joe)-113/+172
2024-08-10Auto merge of #128572 - compiler-errors:fix-elaborate-box-derefs-on-debug, ↵bors-0/+68
r=saethlin Fix `ElaborateBoxDerefs` on debug varinfo Slightly simplifies the `ElaborateBoxDerefs` pass to fix cases where it was applying the wrong projections to debug var infos containing places that deref boxes. From what I can tell[^1], we don't actually have any tests (or code anywhere, really) that exercise `debug x => *(...: Box<T>)`, and it's very difficult to trigger this in surface Rust, so I wrote a custom MIR test. What happens is that the pass was turning `*(SOME_PLACE: Box<T>)` into `*(*((((SOME_PLACE).0: Unique<T>).0: NonNull<T>).0: *const T))` in debug var infos. In particular, notice the *double deref*, which was wrong. This is the root cause of #128554, so this PR fixes #128554 as well. The reason that async closures was affected is because of the way that we compute the [`ByMove` body](https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs), which resulted in `*(...: Box<T>)` in debug var info. But this really has nothing to do with async closures. [^1]: Validated by literally replacing the `if elem == PlaceElem::Deref && base_ty.is_box() { ... }` innards with a `panic!()`, which compiled all of stage2 without panicking.
2024-08-10remove other warnings from rmake testsRémy Rakic-25/+25
2024-08-10remove unused imports from rmake testsRémy Rakic-52/+20
2024-08-10Fix and enable disabled codegen-units testsBen Kimock-57/+38
2024-08-10Auto merge of #128927 - GuillaumeGomez:rollup-ei2lr0f, r=GuillaumeGomezbors-59/+170
Rollup of 8 pull requests Successful merges: - #128273 (Improve `Ord` violation help) - #128807 (run-make: explaing why fmt-write-bloat is ignore-windows) - #128903 (rustdoc-json-types `Discriminant`: fix typo) - #128905 (gitignore: Add Zed and Helix editors) - #128908 (diagnostics: do not warn when a lifetime bound infers itself) - #128909 (Fix dump-ice-to-disk for RUSTC_ICE=0 users) - #128910 (Differentiate between methods and associated functions in diagnostics) - #128923 ([rustdoc] Stop showing impl items for negative impls) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-10Rollup merge of #128923 - GuillaumeGomez:negative-impls-items, r=fmeaseGuillaume Gomez-0/+26
[rustdoc] Stop showing impl items for negative impls Fixes https://github.com/rust-lang/rust/issues/128799. As discussed with `@fmease,` they have a broader patch in progress, so this (small) PR will at least allow for them to have a regression test. :) r? `@fmease`
2024-08-10Rollup merge of #128910 - estebank:assoc-fn, r=compiler-errorsGuillaume Gomez-55/+55
Differentiate between methods and associated functions in diagnostics Accurately refer to assoc fn without receiver as assoc fn instead of methods. Add `AssocItem::descr` method to centralize where we call methods and associated functions.
2024-08-10Rollup merge of #128909 - saethlin:run-make-ice-yes, r=jieyouxuGuillaume Gomez-1/+1
Fix dump-ice-to-disk for RUSTC_ICE=0 users Before this change, the test fails if you run it with `RUSTC_ICE=0`.
2024-08-10Rollup merge of #128908 - notriddle:notriddle/self-inferred-lifetime-bounds, ↵Guillaume Gomez-0/+82
r=compiler-errors diagnostics: do not warn when a lifetime bound infers itself Fixes #119228