about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-05-10gui testSpecificProtagonist-0/+24
2025-05-10Auto merge of #140854 - oli-obk:merge-queries, r=nnethercotebors-119/+119
Merge typeck loop with static/const item eval loop r? `@ghost` Let's try a small one first. Doing this in general has some bad cache coherence issues because the query caches are laid out in `Vec<QueryResult>` lists per query where each index refers to a `DefId` in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-09Rollup merge of #140848 - kornelski:not-a-dead-end, r=compiler-errorsMatthias Krüger-26/+26
Improved error message for top-level or-patterns I was confused by "top-level or-patterns are not allowed in `let` bindings" error, because it sounded like or-patterns were completely unsupported. This error has an auto-fix suggestion that shows otherwise, but the auto-fix isn't always visible in IDEs. I've changed the wording to be consistent with "`Fn` bounds require arguments in parentheses", and it doesn't sound like a dead-end any more.
2025-05-09Rollup merge of #140843 - jieyouxu:broken-pipe, r=KobzolMatthias Krüger-3/+5
Fix `broken-pipe-no-ice` run-make test for rpath-less builds The `broken-pipe-no-ice` run-make test currently fails on rpath-less builds, because host compiler runtime libs are not configured for raw std command usages. This PR is an alternative approach to #140744. However, instead of duplicating `run_make_support::util::set_host_compiler_dylib_path` logic, we instead support "ejecting" the "configured" underlying std `Command` from `bare_rustc()` and `rustdoc()`, where host compiler runtime libs are already set. cc `@jchecahi` r? `@Kobzol`
2025-05-09Rollup merge of #140819 - reddevilmidzy:add-test, r=petrochenkovMatthias Krüger-0/+53
Add regression test for 125877 close: #125877 https://github.com/rust-lang/rust/issues/125877#issuecomment-2143704586 has been resolved https://github.com/rust-lang/rust/pull/128171
2025-05-09Rollup merge of #139863 - fmease:simp-doctest-build-arg-passing, ↵Matthias Krüger-8/+8
r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: https://github.com/rust-lang/rust/issues/134172. Context: https://github.com/rust-lang/rust/pull/137096#issuecomment-2776318800 Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle
2025-05-09Merge typeck loop with static/const item eval loopOli Scherer-119/+119
2025-05-09Error message for top-level or-patterns suggesting a solutionKornel-26/+26
2025-05-09Auto merge of #140839 - pietroalbini:pa-version-bump, r=pietroalbinibors-27/+0
Bump version number to 1.89.0 Part of the release process. This PR must not be rolled up. Closes #129461. r? `@ghost`
2025-05-09tests: fix `broken-pipe-no-ice` to use `bare_rustc`/`rustc`Jieyou Xu-3/+5
Where host compiler runtime libs are properly configured, instead of raw `RUSTC`/`RUSTDOC` commands. Co-authored-by: Jesus Checa Hidalgo <jchecahi@redhat.com>
2025-05-09Disarm `time` bomb (diagnostics)Jieyou Xu-27/+0
Revert "Rollup merge of #129343 - estebank:time-version, r=jieyouxu" This reverts commit 26f75a65d70773e4520634b9f6599ddf08c499e6, reversing changes made to 2572e0e8c9d5d671eccb1d5791e55c929c4720f4. Imports are modified to fix merge conflicts and remove unused ones.
2025-05-09Rollup merge of #140804 - bend-n:signed, r=lcnrStuart Cook-14/+58
add signed ints to unn- transmutes to ensure feature parity i forgot a few cases https://github.com/rust-lang/rust-clippy/pull/14703/#pullrequestreview-2824194994 adds - char -> i32 - i32 -> char - float -> size () - size -> float - i32 -> float ``@rustbot`` label L-unnecessary_transmutes
2025-05-09Rollup merge of #140801 - xizheyin:issue-140747, r=SparrowLiiStuart Cook-0/+34
Use span before macro expansion in lint for-loops-over-falibles Fixes #140747 I think there are going to be a lot of cases where macros are expanded in the compiler resulting in span offsets, and I'd like to know how that's typically handled. Does it have to be handled specially every time?
2025-05-09Auto merge of #140176 - dpaoliello:arm64ecdec, r=wesleywiserbors-1/+51
Fix linking statics on Arm64EC Arm64EC builds recently started to fail due to the linker not finding a symbol: ``` symbols.o : error LNK2001: unresolved external symbol #_ZN3std9panicking11EMPTY_PANIC17hc8d2b903527827f1E (EC Symbol) C:\Code\hello-world\target\arm64ec-pc-windows-msvc\debug\deps\hello_world.exe : fatal error LNK1120: 1 unresolved externals ``` It turns out that `EMPTY_PANIC` is a new static variable that was being exported then imported from the standard library, but when exporting LLVM didn't prepend the name with `#` (as only functions are prefixed with this character), whereas Rust was prefixing with `#` when attempting to import it. The fix is to have Rust not prefix statics with `#` when importing. Adding tests discovered another issue: we need to correctly mark static exported from dylibs with `DATA`, otherwise MSVC's linker assumes they are functions and complains that there is no exit thunk for them. CI found another bug: we only apply `DllImport` to non-local statics that aren't foreign items (i.e., in an `extern` block), that is we want to use `DllImport` for statics coming from other Rust crates. However, `__rust_no_alloc_shim_is_unstable` is a static generated by the Rust compiler if required, but downstream crates consider it a foreign item since it is declared in an `extern "Rust"` block, thus they do not apply `DllImport` to it and so fails to link if it is exported by the previous crate as `DATA`. The fix is to apply `DllImport` to foreign items that are marked with the `rustc_std_internal_symbol` attribute (i.e., we assume they aren't actually foreign and will be in some Rust crate). Fixes #138541 --- try-job: dist-aarch64-msvc try-job: dist-x86_64-msvc try-job: x86_64-msvc-1 try-job: x86_64-msvc-2
2025-05-08Rollup merge of #140800 - GuillaumeGomez:rustdoc-tempdir-removal, r=jieyouxuMatthias Krüger-3/+11
Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linux Follow-up of #140706. r? `@jieyouxu`
2025-05-08Rollup merge of #140716 - Urgau:improve-remap_scope-tests, r=jieyouxuMatthias Krüger-9/+292
Improve `-Zremap-path-scope` tests with dependency This PR greatly improves our coverage of `-Zremap-path-scope` for diagnostic paths and macros with dependencies. r? `@jieyouxu` (since we talked about it) try-job: x86_64-msvc-1
2025-05-08Rollup merge of #140707 - compiler-errors:range-pat-struct-norm, r=lcnrMatthias Krüger-0/+24
Structurally normalize in range pattern checking in HIR typeck Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/200 r? lcnr
2025-05-08Rollup merge of #140684 - compiler-errors:unnecessary-assoc, r=lcnrMatthias Krüger-3/+46
Only include `dyn Trait<Assoc = ...>` associated type bounds for `Self: Sized` associated types if they are provided Since #136458, we began filtering out associated types with `Self: Sized` bounds when constructing the list of associated type bounds to put into our `dyn Trait` types. For example, given: ```rust trait Trait { type Assoc where Self: Sized; } ``` After #136458, even if a user writes `dyn Trait<Assoc = ()>`, the lowered ty would have an empty projection list, and thus be equivalent to `dyn Trait`. However, this has the side effect of no longer constraining any types in the RHS of `Assoc = ...`, not implying any WF implied bounds, and not requiring that they hold when unsizing. After this PR, we include these bounds, but (still) do not require that they are provided. If the are not provided, they are skipped from the projections list. This results in `dyn Trait` types that have differing numbers of projection bounds. This will lead to re-introducing type mismatches e.g. between `dyn Trait` and `dyn Trait<Assoc = ()>`. However, this is expected and doesn't suffer from any of the deduplication unsoundness from before #136458. We may want to begin to ignore thse bounds in the future by bumping `unused_associated_type_bounds` to an FCW. I don't want to tangle that up into the fix that was originally intended in #136458, so I'm doing a "fix-forward" in this PR and deferring thinking about this for the future. Fixes #140645 r? lcnr
2025-05-09Add regression test for 125877reddevilmidzy-0/+53
2025-05-08add signed integers to unnecessary_lints to ensure feature parity with clippybendn-14/+58
2025-05-08Structurally resolve in check_ref_cast and calc_adjust_modeMichael Goulet-0/+24
2025-05-08Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linuxGuillaume Gomez-3/+11
2025-05-08Use span before macro expansion in lint for-loops-over-faliblesxizheyin-16/+8
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-08Add ui test for for-loops-over-faliblesxizheyin-0/+42
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-08Rework `-Zremap-path-scope` macro test with dependency checkUrgau-9/+103
2025-05-08Add tests for `-Zremap-path-scope` and paths in diagnostics with depsUrgau-0/+189
2025-05-08Rollup merge of #140756 - dpaoliello:paclink, r=jieyouxuMatthias Krüger-1/+1
[arm64] Pointer auth test should link with C static library statically While trying to get the aarch64-msvc build working correctly (#140136), the `pointer-auth-link-with-c` test was failing. The pointer auth test builds its C library statically: https://github.com/rust-lang/rust/blob/3ef8e64ce9f72ee8d600d55bc43b36eed069b252/tests/run-make/pointer-auth-link-with-c/rmake.rs#L15 However, the Rust code did not indicate the link kind, so it defaulted to dynamic which then fails on Windows.
2025-05-08Rollup merge of #140755 - dpaoliello:arm64windebuginfo, r=jieyouxuMatthias Krüger-0/+10
[win][arm64] Disable various DebugInfo tests that don't work on Arm64 Windows While trying to get the aarch64-msvc build working correctly (#140136), various DebugInfo related tests were failing. I've added comments to each test to indicate why it is disabled and linked to appropriate bugs. * `tests/debuginfo/step-into-match.rs`: Stepping at the end of a function on goes to the callsite, not the instruction after it. * `tests/debuginfo/type-names.rs`: Arm64 Windows cdb doesn't support JavaScript extensions. Followed up with the Microsoft Debugger Tools team to fix this. * `tests/ui/runtime/backtrace-debuginfo.rs`: Backtraces are truncated due to #140489
2025-05-08Rollup merge of #140736 - xizheyin:issue-140166, r=petrochenkovMatthias Krüger-0/+40
trait selection: check `&` before suggest remove deref FIxes #140166 r? compiler
2025-05-08Rollup merge of #140769 - Zoxc:fix-140731, r=oli-obkMatthias Krüger-0/+42
Add `DefPathData::OpaqueLifetime` to avoid conflicts for remapped opaque lifetimes This adds `DefPathData::OpaqueLifetime` to ensure the def paths for remapped opaque lifetimes remain unique. Fixes https://github.com/rust-lang/rust/issues/140731. r? ``@oli-obk``
2025-05-08Rollup merge of #140762 - aDotInTheVoid:popnl, r=GuillaumeGomezMatthias Krüger-12/+12
rustdoc-json: Remove newlines from attributes Fixes #140689 Not sure if this needs to bump `FORMAT_VERSION` or not. r? ``@GuillaumeGomez`` cc ``@obi1kenobi``
2025-05-08Rollup merge of #140711 - compiler-errors:combine-maybes, r=lcnrMatthias Krüger-0/+56
Do not discard constraints on overflow if there was candidate ambiguity Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/201. There's a pretty chunky justification in the test. r? lcnr
2025-05-08Rollup merge of #140523 - compiler-errors:late-early-mismatch, r=jackh726Matthias Krüger-35/+164
Better error message for late/early lifetime param mismatch Rework the way we report early-/late-bound lifetime param mismatches to equate the trait and impl signatures using region variables, so that we can detect when a late-bound param is present in the signature in place of an early-bound param, or vice versa. The diagnostic is a bit more technical, but it's more obviously clear to see what the problem is, even if it's not great at explaining how to fix it. I think this could be improved further, but I still think it's much better than what exists today. Note to reviewer(s): I'd appreciate if we didn't bikeshed *too* much about this verbiage, b/c I hope it's clear that the old message sucked a lot. I'm happy to file bugs for interested new contributors to improve the messaging further. Edit(fmease): Fixes https://github.com/rust-lang/rust/issues/33624.
2025-05-08Rollup merge of #140260 - compiler-errors:only-global-post-norm, r=lcnrMatthias Krüger-19/+16
Only prefer param-env candidates if they remain non-global after norm Introduce `CandidateSource::GlobalParamEnv`, and dynamically compute the `CandidateSource` based on whether the predicate contains params *post-normalization*. This code needs some cleanup and documentation. I'm just putting this up for review. cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/179 r? lcnr
2025-05-08Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrierilbors-15/+369
allow deref patterns to participate in exhaustiveness analysis Per [this proposal](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Exhaustiveness), this PR allows deref patterns to participate in exhaustiveness analysis. Currently all deref patterns enforce `DerefPure` bounds on their scrutinees, so this assumes all patterns it's analyzing are well-behaved. This also doesn't support [mixed exhaustiveness](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Mixed-exhaustiveness), and instead emits an error if deref patterns are used together with normal constructors. I think mixed exhaustiveness would be nice to have (especially if we eventually want to support arbitrary `Deref` impls[^1]), but it'd require more work to get reasonable diagnostics[^2]. Tracking issue for deref patterns: #87121 r? `@Nadrieril` [^1]: Regardless of whether we support limited exhaustiveness checking for untrusted `Deref` or always require other arms to be exhaustive, I think it'd be useful to allow mixed matching for user-defined smart pointers. And it'd be strange if it worked there but not for `Cow`. [^2]: I think listing out witnesses of non-exhaustiveness can be confusing when they're not necessarily disjoint, and when you only need to cover some of them, so we'd probably want special formatting and/or explanatory subdiagnostics. And if it's implemented similarly to unions, we'd probably also want some way of merging witnesses; the way witnesses for unions can appear duplicated is pretty unfortunate. I'm not sure yet how the diagnostics should look, especially for deeply nested patterns.
2025-05-07Auto merge of #140751 - GuillaumeGomez:rollup-eahw4ta, r=GuillaumeGomezbors-53/+264
Rollup of 8 pull requests Successful merges: - #140234 (Separate dataflow analysis and results) - #140614 (Correct warning message in restricted visibility) - #140671 (Parser: Recover error from named params while parse_path) - #140700 (Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 ) - #140706 ([rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed) - #140734 (Fix regression from #140393 for espidf / horizon / nuttx / vita) - #140741 (add armv5te-unknown-linux-gnueabi target maintainer) - #140745 (run-make-support: set rustc dylib path for cargo wrapper) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-07Add `DefPathData::OpaqueLifetime` to avoid conflicts for remapped opaque ↵John Kåre Alsaker-0/+42
lifetimes
2025-05-07Auto merge of #140590 - lcnr:closure-in-dead-code, r=compiler-errorsbors-0/+78
borrowck nested items in dead code fixes https://github.com/rust-lang/rust/issues/140583 r? `@compiler-errors`
2025-05-07rustdoc-json: Remove newlines from attributesAlona Enraght-Moony-12/+12
2025-05-07Better error message for late/early lifetime param mismatchMichael Goulet-46/+164
2025-05-07[arm64] Pointer auth test should link with C static library staticallyDaniel Paoliello-1/+1
2025-05-07[win][arm64] Disable various DebugInfo tests that don't work on Arm64 WindowsDaniel Paoliello-0/+10
2025-05-07[Arm64EC] Only decorate functions with `#`Daniel Paoliello-1/+51
2025-05-07ReviewMichael Goulet-1/+1
2025-05-07Point out region bound mismatches in check_region_bounds_on_impl_itemMichael Goulet-3/+14
2025-05-07Use MaybeCause::or to allow constraints from overflows if they are combined ↵Michael Goulet-0/+56
with ambiguity
2025-05-07Only include associated type bounds for Self:Sized associated types if they ↵Michael Goulet-3/+46
are provided
2025-05-07Rollup merge of #140706 - GuillaumeGomez:fix-missing-temp-dir-cleanup, ↵Guillaume Gomez-0/+42
r=notriddle [rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed Fixes #139899. The bug was due to the fact that if any doctest fails for any reason, we call `exit` (or it's called inside `libtest` if not edition 2024), meaning that `TempDir`'s destructor isn't called, and therefore the temporary folder isn't cleaned up. Took me a while to figure out how to reproduce but finally I was able to reproduce the bug with: `````rust #![doc(test(attr(deny(warnings))))] //! ``` //! let a = 12; //! ``` ````` And then I ensured that panicking doctests were cleaned up as well: `````rust //! ``` //! panic!(); //! ``` ````` And finally I checked if it was fixed for merged doctests too (`--edition 2024`). To make this work, I needed to add a new public function in `libtest` too which would call a function once all tests have been run. So only issue is: I have absolutely no idea how we can add a regression test for this fix. If anyone has an idea... r? `@notriddle`
2025-05-07Rollup merge of #140700 - Kivooeo:new-fix-six, r=davidtwco,fmeaseGuillaume Gomez-0/+74
Don't crash on error codes passed to `--explain` which exceed our internal limit of 9999 removed panic in case where we do `--explain > 9999` and added check for it now error looks like this instead of ICE ``` $ rustc.exe --explain E10000 error: E10000 is not a valid error code ``` fixes #140647 r? `@fmease`
2025-05-07Rollup merge of #140671 - xizheyin:issue-140169, r=petrochenkovGuillaume Gomez-52/+95
Parser: Recover error from named params while parse_path Fixes #140169 I added test to the first commit and the second added the code and changes to test. r? `@petrochenkov`