about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-07Rollup merge of #108583 - ↵Matthias Krüger-0/+25
compiler-errors:rpitit-default-method-with-nested-rpitits, r=spastorino Account for binders correctly when adding default RPITIT method assumption As of #108203, we install extra projection predicates into the param-env of a default trait method when it has return-position `impl Trait` (or is async). The implementation didn't account for the fact that it's walking into and out of binders, so we just need to shift all the debruijn indices accordingly when constructing the projection predicates. Fixes #108579 r? types
2023-03-07Auto merge of #108863 - JohnTitor:rollup-haydnsw, r=JohnTitorbors-8/+105
Rollup of 7 pull requests Successful merges: - #108619 (Remove the option to disable `llvm-version-check`) - #108728 (infer: fix and improve comments) - #108731 (feat: impl better help for `.poll()` not found on `impl Future`) - #108774 (Greatly improve the error messages when `run-make/translation` fails) - #108805 (Update askama to 0.12 and improve whitespace control) - #108823 (Add tracking issue for cf-protection to unstable book) - #108855 (Custom MIR: Support `as` casts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-07Rollup merge of #108855 - cbeuw:mir-cast, r=tmiaskoYuki Okushi-0/+73
Custom MIR: Support `as` casts Small changes to support this low hanging fruit r? `@oli-obk` or `@tmiasko` or `@JakobDegen`
2023-03-07Rollup merge of #108774 - jyn514:translation-errors, r=davidtwcoYuki Okushi-8/+8
Greatly improve the error messages when `run-make/translation` fails Before: ``` LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message" ------------------------------------------ --- stderr ------------------------------- make: *** [Makefile:51: sysroot] Error 1 ------------------------------------------ failures: [run-make] tests/run-make/translation ``` After: ``` LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message" [[[ begin stdout ]]] error: failed to load fluent bundle: failed to add resource: Attempt to override an existing message: "parse_struct_literal_body_without_path". [[[ end stdout ]]] Error: cannot match: this is a test message ------------------------------------------ --- stderr ------------------------------- make: *** [Makefile:51: sysroot] Error 1 ------------------------------------------ failures: [run-make] tests/run-make/translation ```
2023-03-07Rollup merge of #108731 - Ezrashaw:pin-suggestion-on-impl-future, r=petrochenkovYuki Okushi-0/+24
feat: impl better help for `.poll()` not found on `impl Future` Partially address #108572 I'd like to also address suggestions for generalized `Self` parameters as well. That'll be a separate PR.
2023-03-07Auto merge of #108763 - scottmcm:indexing-nuw-lengths, r=cuviperbors-0/+62
Use `nuw` when calculating slice lengths from `Range`s An `assume` would definitely not be worth it, but since the flag is almost free we might as well tell LLVM this, especially on `_unchecked` calls where there's no obvious way for it to deduce it. (Today neither safe nor unsafe indexing gets it: <https://rust.godbolt.org/z/G1jYT548s>)
2023-03-07Custom MIR: Support as castsAndy Wang-0/+73
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-05Use `nuw` when calculating slice lengths from `Range`sScott McMurray-0/+62
An `assume` would definitely not be worth it, but since the flag is almost free we might as well tell LLVM this, especially on `_unchecked` calls where there's no obvious way for it to deduce it. (Today neither safe nor unsafe indexing gets it: <https://rust.godbolt.org/z/G1jYT548s>)
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-05Greatly improve the error messages when `run-make/translation` failsJoshua Nelson-8/+8
Before: ``` LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message" ------------------------------------------ --- stderr ------------------------------- make: *** [Makefile:51: sysroot] Error 1 ------------------------------------------ failures: [run-make] tests/run-make/translation ``` After: ``` LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message" [[[ begin stdout ]]] error: failed to load fluent bundle: failed to add resource: Attempt to override an existing message: "parse_struct_literal_body_without_path". [[[ end stdout ]]] Error: cannot match: this is a test message ------------------------------------------ --- stderr ------------------------------- make: *** [Makefile:51: sysroot] Error 1 ------------------------------------------ failures: [run-make] tests/run-make/translation ```
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-05feat: impl better help for `.poll()` not found on `impl Future`Ezra Shaw-0/+24
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