about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-07Auto merge of #108691 - aliemjay:closure-subject, r=jackh726bors-16/+94
fix multiple issues when promoting type-test subject Multiple interdependent fixes. See linked issues for a short description of each. When Promoting a type-test `T: 'a` from within the closure back to its parent function, there are a couple pre-existing bugs and limitations. They were exposed by the recent changes to opaque types because the type-test subject (`T`) is no longer a simple ParamTy. Commit 1: Fixes #108635 Fixes #107426 Commit 2: Fixes #108639 Commit 3: Fixes #107516
2023-03-06Auto merge of #108821 - matthiaskrgr:rollup-cmkbgpr, r=matthiaskrgrbors-6/+376
Rollup of 8 pull requests Successful merges: - #107801 (const_eval: `implies_by` in `rustc_const_unstable`) - #108750 (Fix `ObligationCtxt::sub`) - #108780 (Add regression tests for issue 70919) - #108786 (Check for free regions in MIR validation) - #108790 (Do not ICE when interpreting a cast between non-monomorphic types) - #108803 (Do not ICE when failing to normalize in ConstProp.) - #108807 (Emit the suspicious_auto_trait_impls for negative impls as well) - #108812 (Add regression test for #98444) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-06Rollup merge of #108812 - albertlarsan68:test-98444, r=NilstriebMatthias Krüger-0/+17
Add regression test for #98444 cc #108730 this will need to be changed to a `check-fail` test once it lands. Fixes #98444
2023-03-06Rollup merge of #108807 - MU001999:lint/suspicious_auto_trait_impls, r=lcnrMatthias Krüger-5/+128
Emit the suspicious_auto_trait_impls for negative impls as well Fixes #108804
2023-03-06Rollup merge of #108803 - cjgillot:const-prop-normalize, r=oli-obkMatthias Krüger-1/+7
Do not ICE when failing to normalize in ConstProp. There is no reason to delay a bug there, as we bubble up the failure as TooGeneric. Fixes https://github.com/rust-lang/rust/issues/97728
2023-03-06Rollup merge of #108790 - cjgillot:mono-cast, r=oli-obkMatthias Krüger-0/+15
Do not ICE when interpreting a cast between non-monomorphic types Fixes https://github.com/rust-lang/rust/issues/101596
2023-03-06Rollup merge of #108780 - Zeegomo:close-70919, r=WaffleLapkinMatthias Krüger-0/+63
Add regression tests for issue 70919 Desugaring DropAndReplace at MIR build (#107844) fixed #70919. Add regressions tests, borrowed from #102078, to ensure we check for this in the future. cc ``@Aaron1011``
2023-03-06Rollup merge of #107801 - davidtwco:stability-implies-const, r=NilstriebMatthias Krüger-0/+146
const_eval: `implies_by` in `rustc_const_unstable` Fixes #107605. Extend support for `implies_by` (from `#[stable]` and `#[unstable]`) to `#[rustc_const_stable]` and `#[rustc_const_unstable]`. cc ``@steffahn``
2023-03-06Add regression test for 98444Albert Larsan-0/+17
2023-03-06Bless the suspicious-negative-impls-lint.rsMu42-33/+3
2023-03-06Bless the remaining ui testsMu42-5/+55
2023-03-06Moves the negative impls into a separate test fileMu42-67/+115
2023-03-06Auto merge of #108402 - clubby789:diag-bool-not-unit, r=davidtwcobors-40/+59
Allow using `bool` instead of `Option<()>` in diagnostics ~~Disallow the unit type for `#[help]`, `#[note]` etc, instead using `bool` to express optional annotations without a span which I believe is more intuitive.~~ ~~Test output ordering has changed in a few places, where a field was of type `()` and the annotation has been moved to the struct itself. If any of these changes are an issue, this can be restricted to allowing specifically `()`, and not `Option<()>`~~ ~~Actual changes here: https://github.com/rust-lang/rust/pull/108402/files#diff-815b1d8debfc564112bd51093791d7c3f2ee288a37a8f5c0e89c11d1f609b4c0~~ Allows using `bool` in derive diagnostics to indicate an optional subdiagnostic without a span, where previously `Option<()>` had to be used `@rustbot` label +A-diagnostics
2023-03-06emit the suspicious_auto_trait_impls for negative impls as wellMu42-12/+67
2023-03-06Do not ICE when failing to normalize in ConstProp.Camille GILLOT-1/+7
2023-03-06Auto merge of #108787 - cjgillot:sroa-lifetime, r=compiler-errorsbors-469/+720
Erase regions even when failing to normalize type in MIR opts The first commit just moves the tests around. Fixes https://github.com/rust-lang/rust/issues/108720 cc `@saethlin`
2023-03-06Auto merge of #108789 - matthiaskrgr:rollup-nyurto8, r=matthiaskrgrbors-0/+76
Rollup of 7 pull requests Successful merges: - #108244 (Add test for semicolon recovery ICE) - #108746 (Don't project to RPITIT that has no default value) - #108764 (Tweaks to -Zdrop-tracking-mir) - #108770 (Improve documentation and argument naming of some TyCtxt methods) - #108773 (x fmt: Only check modified files locally) - #108775 (Use the correct bound vars in return type suggestion.) - #108776 (Make `x test tidy` less noisy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-05Auto merge of #108157 - scottmcm:tuple-gt-via-partialcmp, r=dtolnaybors-0/+121
Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt` In today's implementation, `(A, B)::gt` contains calls to *both* `A::eq` *and* `A::gt`. That's fine for primitives, but for things like `String`s it's kinda weird -- `(String, usize)::gt` has a call to both `bcmp` and `memcmp` (<https://rust.godbolt.org/z/7jbbPMesf>) because when `bcmp` says the `String`s aren't equal, it turns around and calls `memcmp` to find out which one's bigger. This PR changes the implementation to instead implement `(A, …, C, Z)::gt` using `A::partial_cmp`, `…::partial_cmp`, `C::partial_cmp`, and `Z::gt`. (And analogously for `lt`, `le`, and `ge`.) That way expensive comparisons don't need to be repeated. Technically this is an observable change on stable, so I've marked it `needs-fcp` + `T-libs-api` and will r? rust-lang/libs-api I'm hoping that this will be non-controversial, however, since it's very similar to the observable changes that were made to the derives (#81384 #98655) -- like those, this only changes behaviour if a type overrode behaviour in a way inconsistent with the rules for the various traits involved. (The first commit here is #108156, adding the codegen test, which I used to make sure this doesn't regress behaviour for primitives.) Zulip conversation about this change: <https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/.60.3E.60.20on.20Tuples/near/328392927>.
2023-03-05Add test.Camille GILLOT-0/+15
2023-03-05Rollup merge of #108775 - cjgillot:issue-107860, r=compiler-errorsMatthias Krüger-0/+18
Use the correct bound vars in return type suggestion. Fixes https://github.com/rust-lang/rust/issues/107860
2023-03-05Rollup merge of #108764 - cjgillot:dpm-adapt, r=compiler-errorsMatthias Krüger-0/+3
Tweaks to -Zdrop-tracking-mir Split from https://github.com/rust-lang/rust/pull/107421 3 commits: 1 diagnostic improvement and 2 ICEs.
2023-03-05Rollup merge of #108746 - ↵Matthias Krüger-0/+37
compiler-errors:rpitit-dont-project-default-w-no-valu, r=cjgillot Don't project to RPITIT that has no default value Replicates this behavior, but for RPITIT projection logic (which currently is separate) https://github.com/rust-lang/rust/blob/b1719530f44e3c8ec903f76020a52bd8764d5d10/compiler/rustc_trait_selection/src/traits/project.rs#L2105-L2115 Fixes #108738
2023-03-05Rollup merge of #108244 - lukas-code:semicolon-recovery-span, r=cjgillotMatthias Krüger-0/+18
Add test for semicolon recovery ICE closes https://github.com/rust-lang/rust/issues/108242
2023-03-05Remove -Zverbose.Camille GILLOT-136/+125
2023-03-05Erase lifetimes in SROA.Camille GILLOT-0/+262
2023-03-05Move SROA tests.Camille GILLOT-469/+469
2023-03-05Use the correct bound vars in return type suggestion.Camille GILLOT-0/+18
2023-03-05Add regression tests for issue 70919Giacomo Pasini-0/+63
Desugaring DropAndReplace at MIR build (#107844) fixed issue 70919. Add regressions tests, borrowed from #102078, to ensure we check for this in the future. Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2023-03-05Rollup merge of #108744 - ↵Matthias Krüger-0/+33
compiler-errors:non_lifetime_binders-bad-copy-clone, r=jackh726 Don't ICE when encountering bound var in builtin copy/clone bounds Fixes #108742
2023-03-05Rollup merge of #108626 - ozkanonur:consistent-json-docs, r=aDotInTheVoidMatthias Krüger-9/+5
rustdoc-json: switch from HashMap to FxHashMap to fix non-determinism Using `HashMap` in `rustdoc_json_types::Crate` were causing creating randomly ordered objects in the json doc files. Which might cause problems to people who are doing comparison on those files specially in CI pipelines. See https://github.com/rust-lang/rust/issues/103785#issuecomment-1307425590 This PR fixes that issue and extends the coverage of `tests/run-make/rustdoc-verify-output-files` testing ability.
2023-03-05add test for https://github.com/rust-lang/rust/issues/108242Lukas Markeffsky-0/+18
2023-03-05drop_tracking_mir: diagnose recursive generator.Camille GILLOT-0/+3
2023-03-05Auto merge of #107844 - Zeegomo:no-drop-and-rep, r=cjgillotbors-131/+191
Desugaring of drop and replace at MIR build This commit desugars the drop and replace deriving from an assignment at MIR build, avoiding the construction of the `DropAndReplace` terminator (which will be removed in a following PR). In order to retain the same error messages for replaces a new `DesugaringKind::Replace` variant is introduced. The changes in the borrowck are also useful for future work in moving drop elaboration before borrowck, as no `DropAndReplace` would be present there anymore. Notes on test diffs: * `tests/ui/borrowck/issue-58776-borrowck-scans-children`: the assignment deriving from the desugaring kills the borrow. * `tests/ui/async-await/async-fn-size-uninit-locals.rs`, `tests/mir-opt/issue_41110.test.ElaborateDrops.after.mir`, `tests/mir-opt/issue_41888.main.ElaborateDrops.after.mir`: drop elaboration generates (or reads from) a useless drop flag due to an issue with the dataflow analysis. Will be fixed independently by https://github.com/rust-lang/rust/pull/106430. See https://github.com/rust-lang/rust/pull/104488 for more context
2023-03-05fix inconsistent json outputs from rustdocozkanonur-9/+5
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-04Rollup merge of #108734 - clubby789:rustdoc-layout-uninhabited, r=GuillaumeGomezMatthias Krüger-0/+8
rustdoc: Note in a type's layout/size if it is uninhabited Closes #87008 ![image](https://user-images.githubusercontent.com/13556931/222900244-8e326d51-8d3b-4700-a935-96830179e2e9.png)
2023-03-04Rollup merge of #108723 - notriddle:notriddle/where-clause, r=GuillaumeGomezMatthias Krüger-0/+42
rustdoc: function signature search with traits in `where` clause ## Before ![image](https://user-images.githubusercontent.com/1593513/222873534-a640a72a-c654-4702-9f3b-175129d9591d.png) ## After ![image](https://user-images.githubusercontent.com/1593513/222873544-fdfc431d-2b65-4b56-bede-0302ea9f153a.png)
2023-03-04Rollup merge of #108627 - estebank:suggestion-hightlight, r=WaffleLapkinMatthias Krüger-0/+65
Properly colorize multi-part suggestions in the same line Fix #108547.
2023-03-04Don't project to RPITIT that has no default valueMichael Goulet-0/+37
2023-03-04Don't ICE when encountering bound var in builtin copy/clone boundsMichael Goulet-0/+33
2023-03-04rustdoc: function signature search with traits in `where` clauseMichael Howell-0/+42
2023-03-04rustdoc: Note in a type's layout/size if it is uninhabitedclubby789-0/+8
2023-03-04Rollup merge of #108656 - GuillaumeGomez:rustdoc-search-unclosed-generic, ↵Dylan DPC-0/+10
r=notriddle Rustdoc search: Emit an error for unclosed generic Now, search like `a<` will error as it should (and as written in the eBNF). r? `@notriddle`
2023-03-04Rollup merge of #108298 - TaKO8Ki:fix-104440, r=cjgillotDylan DPC-0/+13
Fix ICE: check if snippet is `)` Fixes #107705
2023-03-04tweak debug output and bless testsAli MJ Al-Nasrawy-16/+16
2023-03-04Properly colorize multi-part suggestions in the same lineEsteban Küber-0/+65
Fix #108547.
2023-03-03Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgrbors-28/+82
Rollup of 8 pull requests Successful merges: - #104549 (add -Zexport-executable-symbols to unstable book) - #108292 (Label opaque type for 'captures lifetime' error message) - #108540 (Add `Atomic*::from_ptr`) - #108634 (Add link to component dashboard) - #108647 (Remove dead pgo.sh file) - #108678 (Use `Option::as_slice` where applicable) - #108681 (Improve comments in `needs_process_obligation`.) - #108688 (Match unmatched backticks in library/) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-03Add test for unclosed genericGuillaume Gomez-0/+10
2023-03-03Rollup merge of #108292 - compiler-errors:opaque-captures-where, r=oli-obkMatthias Krüger-28/+82
Label opaque type for 'captures lifetime' error message Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
2023-03-03Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkovMatthias Krüger-4/+4
Match unmatched backticks in compiler/ Found with GNU grep: ``` grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```' ```
2023-03-03Rollup merge of #108674 - flip1995:clippy_backport, r=ManishearthMatthias Krüger-0/+40
Clippy Fix array-size-threshold config deserialization error Complementary PR to https://github.com/rust-lang/rust/pull/108673 in order to also get this into the **next** beta. r? ``@Mark-Simulacrum``