summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-09-03More robust extension checkingChris Denton-1/+3
2024-08-29rustdoc: move invalid langstring test to UIMichael Howell-0/+6
(cherry picked from commit 1d19c2c009529fff08a95cbe548bcb1a6e02651c)
2024-08-29rustdoc: do not run doctests with invalid langstringsMichael Howell-0/+11
(cherry picked from commit 7c4150fce0510218304b726174029fbb2c33ee03)
2024-08-29Emit specific message for `time<0.3.35` inference failureEsteban Küber-0/+19
``` error[E0282]: type annotations needed for `Box<_>` --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on crate `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.35` ``` Partially address #127343. (cherry picked from commit b013a3ddf0060b62ee8050e241f80d024c48cc59)
2024-08-15Fix bug in `Parser::look_ahead`.Nicholas Nethercote-0/+58
The special case was failing to handle invisible delimiters on one path. Fixes #128895. (cherry picked from commit 46b4c5adc5698c3e9543e17a1ed0f8073bafd1d3)
2024-08-15derive(SmartPointer): register helper attributesDing Xiang Fei-12/+164
(cherry picked from commit 5534cb0a4a3907db50956f7664ab2e5c3b2bc00a)
2024-08-15Revert "Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwU"Boxy-126/+217
This reverts commit 8c3a94a1c79c67924558a4adf7fb6d98f5f0f741, reversing changes made to 3d68afc9e821b00d59058abc9bda670b07639955.
2024-08-12Normalize when equating dyn tails in MIR borrowckMichael Goulet-0/+21
(cherry picked from commit c6f8672dd5e128766298ed0d53bb32a94188f886)
2024-08-12Disable jump threading of float equalityNilstrieb-0/+130
Jump threading stores values as `u128` (`ScalarInt`) and does its comparisons for equality as integer comparisons. This works great for integers. Sadly, not everything is an integer. Floats famously have wonky equality semantcs, with `NaN!=NaN` and `0.0 == -0.0`. This does not match our beautiful integer bitpattern equality and therefore causes things to go horribly wrong. While jump threading could be extended to support floats by remembering that they're floats in the value state and handling them properly, it's signficantly easier to just disable it for now. (cherry picked from commit f305e188041b586fb162161f961298f1532fe83b)
2024-08-03Bless test falloutMichael Goulet-6/+10
2024-08-03Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-180/+61
This reverts commit 13314df21b0bb0cdd02c6760581d1b9f1052fa7e, reversing changes made to 6e534c73c35f569492ed5fb5f349075d58ed8b7e.
2024-08-03Revert "Rollup merge of #126315 - mu001999-contrib:fix/126289, r=petrochenkov"Michael Goulet-33/+0
This reverts commit 977c5fd419ade52467f7de79d5bfc25c0c893275, reversing changes made to 24c94f0e4f5aa333c665fbbba423172c30176624.
2024-08-03Revert "Rollup merge of #126618 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-50/+20
This reverts commit 2724aeaaeb127a8073e39461caacbe21a128ce7b, reversing changes made to d929a42a664c026167800801b26d734db925314f.
2024-08-03Revert "Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix"Michael Goulet-152/+23
This reverts commit 31fe9628cf830a08e7194a446f66c668aaea86e9, reversing changes made to f20307851ead9fbbb9fa88bbffb3258a069230a6.
2024-07-20Auto merge of #127663 - Oneirical:fuzzy-testure, r=jieyouxubors-73/+154
Migrate 9 more very similar FFI `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). For the tracking issue: - return-non-c-like-enum-from-c - pass-non-c-like-enum-to-c - c-static-dylib - c-static-rlib - extern-fn-generic - extern-fn-with-union - lto-no-link-whole-rlib - linkage-attr-on-static - issue-28595
2024-07-20Auto merge of #127658 - compiler-errors:precise-capturing-rustdoc-cross, ↵bors-0/+20
r=fmease Add cross-crate precise capturing support to rustdoc Follow-up to #127632. Fixes #127228. r? `@fmease` Tracking: * https://github.com/rust-lang/rust/issues/123432
2024-07-20Auto merge of #127998 - matthiaskrgr:rollup-ykp0h5r, r=matthiaskrgrbors-88/+134
Rollup of 9 pull requests Successful merges: - #123196 (Add Process support for UEFI) - #127556 (Replace a long inline "autoref" comment with method docs) - #127693 (Migrate `crate-hash-rustc-version` to `rmake`) - #127866 (Conditionally build `wasm-component-ld` ) - #127918 (Safely enforce thread name requirements) - #127948 (fixes panic error `index out of bounds` in conflicting error) - #127980 (Avoid ref when using format! in compiler) - #127984 (Avoid ref when using format! in src) - #127987 (More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait`) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-20Auto merge of #127003 - GrigorenkoPV:107975, r=SparrowLiibors-0/+799
Add a test for #107975 The int is zero. But also not zero. This is so much fun. This is a part of #105107. Initially I was going to just rebase #108445, but quite a few things changed since then: * The [mcve](https://github.com/rust-lang/rust/issues/105787#issuecomment-1750112388) used for #105787 got fixed.[^upd2] * You can't just `a ?= b` for #107975 anymore. Now you have to `a-b ?= 0`. This is what this PR does. As an additional flex, it show that three ways of converting a pointer to its address have this issue: 1. `as usize` 2. `.expose_provenance()` 3. `.addr()` * #108425 simply got fixed. Yay. As an aside, the naming for `addr_of!` is quite unfortunate in context of provenance APIs. Because `addr_of!` gives you a pointer, but what provenance APIs refer to as "address" is the `usize` value. Oh well. UPD1: GitHub is incapable of parsing #107975 in the PR name, so let's add it here. [^upd2]: UPD2: [The other mcve](https://github.com/rust-lang/rust/issues/105787#issue-1500501670) does not work anymore either, saying "this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details."
2024-07-20Rollup merge of #127987 - estebank:impl-trait-sugg, r=cjgillotMatthias Krüger-50/+37
More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait` When encountering `-> Trait`, suggest `-> Box<dyn Trait>` (instead of `-> Box<Trait>`. If there's a single returned type within the `fn`, suggest `-> impl Trait`.
2024-07-20Rollup merge of #127948 - surechen:fix_127915, r=compiler-errorsMatthias Krüger-0/+40
fixes panic error `index out of bounds` in conflicting error fixes #127915
2024-07-20Rollup merge of #127693 - Rejyr:migrate-crate-hash-rustc-version-rmake, ↵Matthias Krüger-38/+57
r=jieyouxu Migrate `crate-hash-rustc-version` to `rmake` Part of #121876. r? ``@jieyouxu`` try-job: x86_64-gnu-llvm-18 try-job: dist-x86_64-linux
2024-07-19Auto merge of #127968 - fmease:upd-jsondocck-directive-style, r=GuillaumeGomezbors-1043/+1043
Update jsondocck directives to follow ui_test-style Context: Comment chain in #125813. Follow-up to #126788. Use the same temporary approach of "double parsing" until we figure out how we want to support compiletest/ui_test directive "add-ons" for child test runners like HtmlDocCk and JsonDocCk. I didn't touch much of jsondocck because I want to refactor it some other time (for robustness, maintainability and better diagnostics; basically by following a similar design of my WIP HtmlDocCk-next, cc #125780). r? `@GuillaumeGomez`
2024-07-19Add a bunch of tests for #107975Pavel Grigorenko-0/+799
2024-07-19More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait`Esteban Küber-50/+37
When encountering `-> Trait`, suggest `-> Box<dyn Trait>` (instead of `-> Box<Trait>`. If there's a single returned type within the `fn`, suggest `-> impl Trait`.
2024-07-19Auto merge of #127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgrbors-69/+344
Rollup of 6 pull requests Successful merges: - #127295 (CFI: Support provided methods on traits) - #127814 (`C-cmse-nonsecure-call`: improved error messages) - #127949 (fix: explain E0120 better cover cases when its raised) - #127966 (Use structured suggestions for unconstrained generic parameters on impl blocks) - #127976 (Lazy type aliases: Diagostics: Detect bivariant ty params that are only used recursively) - #127978 (Avoid ref when using format! for perf) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Rollup merge of #127976 - fmease:lta-cyclic-bivariant-param-better-err, ↵Matthias Krüger-14/+13
r=compiler-errors Lazy type aliases: Diagostics: Detect bivariant ty params that are only used recursively Follow-up to errs's #127871. Extends the logic to cover LTAs, too, not just ADTs. This change only takes effect with the next-gen solver enabled as cycle errors like the one we have here are fatal in the old solver. That's my explanation anyways. r? compiler-errors
2024-07-19Rollup merge of #127814 - folkertdev:c-cmse-nonsecure-call-error-messages, ↵Matthias Krüger-55/+325
r=oli-obk `C-cmse-nonsecure-call`: improved error messages tracking issue: #81391 issue for the error messages (partially implemented by this PR): #81347 related, in that it also deals with CMSE: https://github.com/rust-lang/rust/pull/127766 When using the `C-cmse-nonsecure-call` ABI, both the arguments and return value must be passed via registers. Previously, when violating this constraint, an ugly LLVM error would be shown. Now, the rust compiler itself will print a pretty message and link to more information.
2024-07-19Rollup merge of #127295 - maurer:default-impl-cfi, r=estebankMatthias Krüger-0/+6
CFI: Support provided methods on traits Provided methods currently don't get type erasure performed on them because they are not in an `impl` block. If we are instantiating a method that is an associated item, but *not* in an impl block, treat it as a provided method instead.
2024-07-19LTA: Diag: Detect bivariant ty params that are only used recursivelyLeón Orell Valerian Liehr-14/+13
2024-07-19rewrite pass-non-c-like-enum-to-c to rmakeOneirical-8/+25
2024-07-19rewrite linkage-attr-on-static to rmakeOneirical-12/+15
2024-07-19rewrite lto-no-link-whole-rlib to rmakeOneirical-9/+18
2024-07-19rewrite extern-fn-with-union to rmakeOneirical-7/+17
2024-07-19rewrite extern-fn-generic to rmakeOneirical-7/+15
2024-07-19rewrite c-static-rlib to rmakeOneirical-12/+19
2024-07-19rewrite c-static-dylib to rmakeOneirical-13/+20
2024-07-19rewrite and rename issue-28595 to rmakeOneirical-7/+16
2024-07-19rewrite return-non-c-like-enum-from-c to rmakeOneirical-6/+17
2024-07-19Auto merge of #127969 - matthiaskrgr:rollup-nhxmwhn, r=matthiaskrgrbors-182/+115
Rollup of 7 pull requests Successful merges: - #112328 (Feat. adding ext that returns change_time) - #126199 (Add `isqrt` to `NonZero<uN>`) - #127856 (interpret: add sanity check in dyn upcast to double-check what codegen does) - #127934 (Improve error when a compiler/library build fails in `checktools.sh`) - #127960 (Cleanup dll/exe filename calculations in `run_make_support`) - #127963 (Fix display of logo "border") - #127967 (Disable run-make/split-debuginfo test for RISC-V 64) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Rollup merge of #127967 - ↵Matthias Krüger-0/+2
joshua-zivkovic:joshua-zivkovic/disable-split-debuginfo, r=jieyouxu Disable run-make/split-debuginfo test for RISC-V 64 Together with `@Hoverbear,` we've been improving the state of the riscv64gc-unknown-linux-gnu target. This is in relation to https://github.com/rust-lang/rust/pull/125220 where `tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs` was disabled for RISC-V 64 in that another test, `tests/run-make/split-debuginfo` also needs to be disabled due to https://github.com/llvm/llvm-project/issues/56642 and the changes made in https://github.com/rust-lang/rust/pull/120518. This test appears to be a host test, not a target test, so it isn't seen failing in https://github.com/rust-lang/rust/pull/126641, however, we are in the process of testing host tools for riscv64-gc-unknown-linux-gnu so this test has now been noticed to be a problem.
2024-07-19Rollup merge of #127856 - RalfJung:interpret-cast-sanity, r=oli-obkMatthias Krüger-182/+113
interpret: add sanity check in dyn upcast to double-check what codegen does For dyn receiver calls, we already have two codepaths: look up the function to call by indexing into the vtable, or alternatively resolve the DefId given the dynamic type of the receiver. With debug assertions enabled, the interpreter does both and compares the results. (Without debug assertions we always use the vtable as it is simpler.) This PR does the same for dyn trait upcasts. However, for casts *not* using the vtable is the easier thing to do, so now the vtable path is the debug-assertion-only path. In particular, there are cases where the vtable does not contain a pointer for upcasts but instead reuses the old pointer: when the supertrait vtable is a prefix of the larger vtable. We don't want to expose this optimization and detect UB if people do a transmute assuming this optimization, so we cannot in general use the vtable indexing path. r? ``@oli-obk``
2024-07-19Update all rustdoc-json/ tests to use the new styleLeón Orell Valerian Liehr-1043/+1043
2024-07-19Auto merge of #127957 - matthiaskrgr:rollup-1u5ivck, r=matthiaskrgrbors-58/+279
Rollup of 6 pull requests Successful merges: - #127350 (Parser: Suggest Placing the Return Type After Function Parameters) - #127621 (Rewrite and rename `issue-22131` and `issue-26006` `run-make` tests to rmake) - #127662 (When finding item gated behind a `cfg` flag, point at it) - #127903 (`force_collect` improvements) - #127932 (rustdoc: fix `current` class on sidebar modnav) - #127943 (Don't allow unsafe statics outside of extern blocks) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Disable run-make/split-debuginfo test for RISC-V 64Joshua Zivkovic-0/+2
Due to https://github.com/rust-lang/rust/pull/120518
2024-07-19Auto merge of #127956 - tgross35:rollup-8ten7pk, r=tgross35bors-123/+1394
Rollup of 7 pull requests Successful merges: - #121533 (Handle .init_array link_section specially on wasm) - #127825 (Migrate `macos-fat-archive`, `manual-link` and `archive-duplicate-names` `run-make` tests to rmake) - #127891 (Tweak suggestions when using incorrect type of enum literal) - #127902 (`collect_tokens_trailing_token` cleanups) - #127928 (Migrate `lto-smoke-c` and `link-path-order` `run-make` tests to rmake) - #127935 (Change `binary_asm_labels` to only fire on x86 and x86_64) - #127953 ([compiletest] Search *.a when getting dynamic libraries on AIX) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Rollup merge of #127943 - compiler-errors:no-unsafe, r=spastorinoMatthias Krüger-2/+17
Don't allow unsafe statics outside of extern blocks This PR fixes a regression where we allowed `unsafe static` items in top-level modules (i.e. outside of `unsafe extern` blocks). It's harder IMO to integrate this into the `check_item_safety` function, so I opted to just put this check on the `static` item itself. Beta version of this lives at #127944. r? ```@oli-obk``` or ```@spastorino```
2024-07-19Rollup merge of #127932 - notriddle:notriddle/current, r=GuillaumeGomezMatthias Krüger-0/+4
rustdoc: fix `current` class on sidebar modnav | Before | After | | -- | -- | | ![image](https://github.com/user-attachments/assets/35866be8-5a58-41eb-9169-b2bb403fe7cd) | ![image](https://github.com/user-attachments/assets/89b087ea-82bf-49f5-9c87-20162880eb32)
2024-07-19Rollup merge of #127662 - estebank:gate-span, r=TaKO8KiMatthias Krüger-24/+104
When finding item gated behind a `cfg` flag, point at it Previously we would only mention that the item was gated out, and opportunisitically mention the feature flag name when possible. We now point to the place where the item was gated, which can be behind layers of macro indirection, or in different modules. ``` error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` --> $DIR/diagnostics-cross-crate.rs:18:23 | LL | cfged_out::inner::doesnt_exist::hello(); | ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner` | note: found an item that was configured out --> $DIR/auxiliary/cfged_out.rs:6:13 | LL | pub mod doesnt_exist { | ^^^^^^^^^^^^ note: the item is gated here --> $DIR/auxiliary/cfged_out.rs:5:5 | LL | #[cfg(FALSE)] | ^^^^^^^^^^^^^ ```
2024-07-19Rollup merge of #127621 - Oneirical:hypnotest-show, r=jieyouxuMatthias Krüger-32/+62
Rewrite and rename `issue-22131` and `issue-26006` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: i686-mingw
2024-07-19Rollup merge of #127350 - veera-sivarajan:bugfix-126311, r=lcnrMatthias Krüger-0/+92
Parser: Suggest Placing the Return Type After Function Parameters Fixes #126311 This PR suggests placing the return type after the function parameters when it's misplaced after a `where` clause. This also tangentially improves diagnostics for cases like [this](https://github.com/veera-sivarajan/rust/blob/86d6f1312a77997ef994240e716288d61a343a6d/tests/ui/parser/issues/misplaced-return-type-without-where-issue-126311.rs#L1C1-L1C28) and adds doc comments for `parser::AllowPlus`.