about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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-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`
2025-05-07Rollup merge of #140614 - yuk1ty:fix-invalid-module-name-visibility, r=davidtwcoGuillaume Gomez-1/+53
Correct warning message in restricted visibility Fixes #131220
2025-05-07Only prefer param-env candidates if they remain non-global after normMichael Goulet-19/+16
2025-05-07Check `&` before suggest remove deref when trait_selectionxizheyin-5/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-07Use `parse_param_general` when parsing `(T, U)->R` in `parse_path_segment`xizheyin-69/+86
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2025-05-07Add regression test for #139899Guillaume Gomez-0/+42
2025-05-07Add ui test suggest-remove-deref-issue-140166xizheyin-0/+44
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-06error early when mixing deref patterns with normal constructorsdianne-0/+91
Without adding proper support for mixed exhaustiveness, mixing deref patterns with normal constructors would either violate `ConstructorSet::split`'s invariant 4 or 7. We'd either be ignoring rows with normal constructors or we'd have problems in unspecialization from non-disjoint constructors. Checking mixed exhaustivenss similarly to how unions are currently checked should work, but the diagnostics for unions are confusing. Since mixing deref patterns with normal constructors is pretty niche (currently it only makes sense for `Cow`), emitting an error lets us avoid committing to supporting mixed exhaustiveness without a good answer for the diagnostics.
2025-05-06add exhaustiveness/usefulness tests for deref patternsdianne-0/+269
2025-05-06let deref patterns participate in usefulness/exhaustivenessdianne-15/+9
This does not yet handle the case of mixed deref patterns with normal constructors; it'll ICE in `Constructor::is_covered_by`. That'll be fixed in a later commit.
2025-05-07Rollup merge of #140713 - compiler-errors:check_ref_cast, r=lcnrJacob Pratt-0/+22
Structurally resolve in `check_ref_cast` in new solver Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/203 r? lcnr
2025-05-07Rollup merge of #140709 - notriddle:rm-unportable-markdown, r=GuillaumeGomezJacob Pratt-85/+0
rustdoc: remove unportable markdown lint and old parser Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-07Rollup merge of #140607 - lcnr:opaque-type-storage, r=compiler-errorsJacob Pratt-0/+25
support duplicate entries in the opaque_type_storage Necessary for the new solver as we may unify keys when eagerly resolving for canonical queries. See the relevant comment when instantiating query responses: ```rust // We eagerly resolve inference variables when computing the query response. // This can cause previously distinct opaque type keys to now be structurally equal. // // To handle this, we store any duplicate entries in a separate list to check them // at the end of typeck/borrowck. We could alternatively eagerly equate the hidden // types here. However, doing so is difficult as it may result in nested goals and // any errors may make it harder to track the control flow for diagnostics. if let Some(prev) = prev { self.delegate.add_duplicate_opaque_type(key, prev, self.origin_span); } ``` This will be far more relevant with #140497. r? `@compiler-errors`
2025-05-07Rollup merge of #139534 - madhav-madhusoodanan:apx-target-feature-addition, ↵Jacob Pratt-0/+20
r=workingjubilee Added support for `apxf` target feature
2025-05-07Rollup merge of #134273 - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscrossJacob Pratt-70/+12
de-stabilize bench attribute This has been soft-unstable since forever (https://github.com/rust-lang/rust/pull/64066), and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274). The feature covering `bench` itself is tracked in https://github.com/rust-lang/rust/issues/50297, which has been closed despite still having active feature gates referencing it. Cc `@rust-lang/libs-api`
2025-05-06Structurally resolve in check_ref_castMichael Goulet-0/+22
2025-05-06added error handle for error code > 9999Kivooeo-0/+74
2025-05-06Added apxf target feature testMadhav Madhusoodanan-0/+20
2025-05-06rustdoc: remove unportable markdown lint and old parserMichael Howell-85/+0
Follow up https://github.com/rust-lang/rust/pull/127127
2025-05-06Rollup merge of #139966 - Zalathar:span-merge, r=oli-obkGuillaume Gomez-1765/+2836
coverage: Only merge adjacent coverage spans For a long time, coverage instrumentation has automatically “merged” spans with the same control-flow into a smaller number of larger spans, even when the spans being merged are not overlapping or adjacent. This causes any source text between the original spans to be included in the merged span, which is then associated with an execution count when shown in coverage reports. That approach causes a number of problems: - The intervening source text can contain all sorts of things that shouldn't really be marked as executable code (e.g. nested items, parts of macro invocations, long comments). In some cases we have complicated workarounds (e.g. bucketing to avoid merging spans across nested items), but in other cases there isn't much we can do. - Merging can have aesthetically weird effects, such as including unbalanced parentheses, because the merging process doesn't really understand what it's doing at a source code level. - It generally leads to an accumulation of piled-on heuristics and special cases that give decent-looking results, but are fiendishly difficult to modify or replace. Therefore, this PR aims to abolish the merging of non-adjacent coverage spans. The big tradeoff here is that the resulting coverage metadata (embedded in the instrumented binary) tends to become larger, because the overall number of distinct spans has increased. That's unfortunate, but I see it as the inevitable cost of cleaning up the messes and inaccuracies that were caused by the old approach. And the resulting spans do tend to be more accurate to the program's actual control-flow. --- The `.coverage` snapshot changes give an indication of how this PR will affect user-visible coverage reports. In many cases the changes to reporting are minor or even nonexistent, despite substantial changes to the metadata (as indicated by `.cov-map` snapshots). --- try-job: aarch64-gnu