about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-849763/+0
2023-01-11Rollup merge of #106690 - GuillaumeGomez:item-declaration-scrolling, r=notriddleYuki Okushi-0/+173
Fix scrolling for item declaration block Fixes https://github.com/rust-lang/rust/issues/105580. The `contain: layout` was the issue here and the bug was actually on both mobile and desktop. r? `@notriddle`
2023-01-11Rollup merge of #106653 - ehuss:allow-features-help, r=nilstriebYuki Okushi-1/+1
Fix help docs for -Zallow-features The arguments for -Zallow-features are comma-separated (`parse_opt_comma_list`), not space separated (`parse_list`).
2023-01-11Rollup merge of #106645 - c410-f3r:rfc-2397-1, r=oli-obkYuki Okushi-0/+63
[RFC 2397] Initial implementation cc #51992 Because of previous experiences where ppl didn't have the time to review large PRs (or any at all), the implementation of this feature will be delivered in small chunks to hopefully make things faster. In this initial PR, only the attribute is being declared and gated with ordinary tests.
2023-01-11Rollup merge of #106642 - albertlarsan68:test-106062, r=JohnTitorYuki Okushi-0/+42
Add test for #106062 Add a regression test for #106062 Closes #106062
2023-01-11Rollup merge of #106521 - oskgo:remove-E0280, r=jackh726Yuki Okushi-44/+43
remove E0280 After looking at #61137 I tried my hand at E0280. I'm unable to find a reasonable example that emits the error. There are a couple of old examples that compile with the current compiler ([#26217](https://github.com/rust-lang/rust/issues/26217), [#42114](https://github.com/rust-lang/rust/issues/42114), [#27113](https://github.com/rust-lang/rust/issues/27113)) and there is a [bug with chalk](https://github.com/rust-lang/rust/blob/b7cdb635c4b973572307ad288466fba64533369c/src/test/ui/chalkify/bugs/async.rs) that makes it emit the error, with a couple more chalk bugs on zulip. It seems like the error is supposed to be emitted from unfulfilled where bounds, of which two are related to borrow checking (error in where T: 'a or where 'a: 'b) and thus tend to emit errors like "lifetime may not live long enough" from borrow checking instead. The final case is with type equality constraints (where <T as Iterator>::Item == u32), which is unimplemented ([#20041](https://github.com/rust-lang/rust/issues/20041)). That such different problems are supposed to have the same error code also seems strange to me. Since the error seems to only be emitted when using chalk I propose to remove it and replace it with an ICE instead. A crater run might be warranted. Pinging `@jackh726` due to removal of chalk test that now ICEs.
2023-01-10Add GUI test for item declaration block scrollingGuillaume Gomez-0/+173
2023-01-10Auto merge of #106607 - ↵bors-22/+133
compiler-errors:be-more-accurate-abt-method-suggestions, r=oli-obk Consider return type when giving various method suggestions 1. Fix a bug in method probe where we weren't normalizing `xform_ret_ty` for non-`impl` method candidates. This shouldn't affect happy-path code, since we only use `xform_ret_ty` when probing methods for diagnostics (I think). 2. Pass the return type expectation down to `lookup_probe`/`probe_for_name` usages in diagnostics. Added a few UI tests to gate against bad suggestions. 3. Make a `FnCtxt::lookup_probe_for_diagnostic` which properly passes down `IsSuggestion(true)`. Should help suppress other weird notes in some corner cases.
2023-01-10Auto merge of #106656 - JohnTitor:rollup-rk2qltg, r=JohnTitorbors-57/+160
Rollup of 9 pull requests Successful merges: - #105034 (Add example for iterator_flatten) - #105708 (Enable atomic cas for bpf targets) - #106175 (Fix bad import suggestion with nested `use` tree) - #106204 (No need to take opaques in `check_type_bounds`) - #106387 (Revert "bootstrap: Get rid of `tail_args` in `stream_cargo`") - #106636 (Accept old spelling of Fuchsia target triples) - #106639 (update Miri) - #106640 (update test for inductive canonical cycles) - #106647 (rustdoc: merge common CSS for `a`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-10remove E0280 and ICE insteadbowlerman-44/+43
2023-01-10Auto merge of #106495 - JohnTitor:issue-100772, r=compiler-errorsbors-0/+11
Add regression test for #100772 Closes #100772 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-09[RFC 2397] Initial implementationCaio-0/+63
2023-01-10Rollup merge of #106640 - lcnr:update-test, r=jackh726Yuki Okushi-43/+58
update test for inductive canonical cycles the previous test always resulted in a cycle :sweat_smile: cc https://github.com/rust-lang/chalk/pull/787. I checked with #102713 and this is the only test which fails with that PR. r? ``@jackh726``
2023-01-10Rollup merge of #106175 - compiler-errors:bad-import-sugg, r=oli-obkYuki Okushi-14/+102
Fix bad import suggestion with nested `use` tree Fixes #105566 Fixes #105373 Ideally, we'd find some way to turn these into structured suggestions -- perhaps on a separate line as a different `use` statement, but I have no idea how to access the span for the whole `use` from this point in the import resolution code.
2023-01-09Fix help docs for -Zallow-featuresEric Huss-1/+1
2023-01-09Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-deadbors-1134/+2029
Rollup of 10 pull requests Successful merges: - #105292 (Change a commit_if_ok call to probe) - #105655 (Remove invalid case for mutable borrow suggestion) - #106047 (Fix ui constant tests for big-endian platforms) - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64) - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`) - #106291 (Fix incorrect suggestion for extra `&` in pattern) - #106389 (Simplify some canonical type alias names) - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`) - #106549 (Use fmt named parameters in rustc_borrowck) - #106614 (error-code docs improvements (No. 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-09hack: don't normalize xform_ret_ty for trait/object candidates unless neededMichael Goulet-14/+0
2023-01-09Consider method return type for various method suggestionsMichael Goulet-22/+147
2023-01-09Add test for issue 106062Albert Larsan-0/+42
2023-01-09update test for inductive canonical cycleslcnr-43/+58
2023-01-09Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomezfee1-dead-1/+44
error-code docs improvements (No. 2) - Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord. - Wrote docs and UI test for `E0711`, again with the header. - `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though. r? ```@GuillaumeGomez```
2023-01-09Rollup merge of #106291 - obeis:issue-106182, r=oli-obkfee1-dead-3/+48
Fix incorrect suggestion for extra `&` in pattern Closes #106182
2023-01-09Rollup merge of #106047 - uweigand:s390x-test-bigendian-ui, r=oli-obkfee1-dead-1130/+1716
Fix ui constant tests for big-endian platforms A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files. Fix this by a combination of two types of changes: - Where possible (i.e. where the particular value of a constant does not affect the purpose of the test), choose constant values that have the same encoding on big- and little-endian platforms. - Where this is not possible, provide a normalize-stderr-test rule that transforms the printed big-endian encoding of such constants into the corresponding little-endian form. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2023-01-09Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obkfee1-dead-0/+26
Remove invalid case for mutable borrow suggestion If we have a call such as `foo(&mut buf)` and after reference collapsing the type is inferred as `&T` where-as the required type is `&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically and the issue lies elsewhere, not in the borrow. Fixes #105645
2023-01-09Rollup merge of #105292 - JulianKnodt:no_eager_commit, r=BoxyUwUfee1-dead-0/+195
Change a commit_if_ok call to probe Removes an over-eager `commit_if_ok` which makes inference worse. I'm not entirely sure whether it's ok to remove the check that types are the same, because casting seems to cause equality checks with incorrect types? Fixes #105037 r? ```@BoxyUwU```
2023-01-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-189/+814
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-09Auto merge of #106340 - saethlin:propagate-operands, r=oli-obkbors-0/+46
Always permit ConstProp to exploit arithmetic identities Fixes https://github.com/rust-lang/rust/issues/72751 Initially, I thought I would need to enable operand propagation then do something else, but actually https://github.com/rust-lang/rust/pull/74491 already has the fix for the issue in question! It looks like this optimization was put under MIR opt level 3 due to possible soundness/stability implications, then demoted further to MIR opt level 4 when MIR opt level 2 became associated with `--release`. Perhaps in the past we were doing CTFE on optimized MIR? We aren't anymore, so this optimization has no stability implications. r? `@oli-obk`
2023-01-09Clean upkadmin-2/+124
Simplify match statement Add multiple tests - 1 test for checking `N + 1 + 1` does not unify with `N+1` - 2 tests for checking that a function that uses two parameters only returns the parameter that is actually used. - Check exact repeat predicates
2023-01-09Set !const_evaluatable if ambig. and not inferredkadmin-0/+38
This prevents an ICE due to a value not actually being evaluatable later.
2023-01-09Change based on commentskadmin-1/+12
Instead of just switching to a probe, check for different matches, and see how many there are. If one, unify it, otherwise return true and let it be unified later.
2023-01-09Change commit_if_ok to probekadmin-13/+37
2023-01-09Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnrbors-87/+64
Improve spans of non-WF implied bound types Fixes #60980
2023-01-09fix: fix CI errorsEzra Shaw-1/+11
2023-01-08Rollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errorsMichael Goulet-0/+14
Do not emit structured suggestion for turbofish with wrong span Fix #79161.
2023-01-08Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-SimulacrumMichael Goulet-14/+34
Add goml scripts to tidy checks r? ``@notriddle``
2023-01-08Rollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebankMichael Goulet-8/+35
Suppress type errors that come from private fields Fixes #57320 There was some discussion here (https://github.com/rust-lang/rust/issues/57320#issuecomment-451308420), but I honestly think the second error is worth suppressing regardless. I would be open to feedback though -- perhaps we can suppress the `.len()` suggestion if there's type error (since we have access to [`Expectation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/enum.Expectation.html), we can determine that). r? ``@estebank``
2023-01-08Rollup merge of #106497 - chenyukang:yukang/fix-106443-sugg-clone, r=estebankMichael Goulet-0/+107
Suggest using clone when we have &T and T implemented Clone Fixes #106443
2023-01-08Rollup merge of #106363 - estebank:mutability-mismatch-arg, r=NilstriebMichael Goulet-23/+46
Structured suggestion for `&mut dyn Iterator` when possible Fix #37914.
2023-01-08Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwcoMichael Goulet-102/+102
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible Fixes #80929 Fixes #67296
2023-01-09docs/test: add error-docs and UI test for `E0711`Ezra Shaw-0/+33
2023-01-09Add regression test for #100772Yuki Okushi-0/+11
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-08Do not emit structured suggestion for turbofish with wrong spanEsteban Küber-0/+14
Fix #79161.
2023-01-08Fix tidy issues in goml scriptsGuillaume Gomez-14/+34
2023-01-08Suppress type errors that come from private fieldsMichael Goulet-8/+35
2023-01-08Don't store spans in assumed_wf_types actuallyMichael Goulet-2/+29
2023-01-08Normalize assumed_wf_types after wfchecking is complete, for better spansMichael Goulet-14/+14
2023-01-08Improve spans of non-WF implied bound typesMichael Goulet-102/+52
2023-01-08Remove extra spaceYukang-1/+1
2023-01-08Rollup merge of #106581 - estebank:bad-suggestion, r=compiler-errorsYuki Okushi-0/+29
Do not emit wrong E0308 suggestion for closure mismatch Found in #76353.
2023-01-08Rollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomezYuki Okushi-0/+34
Add some UI tests and reword error-code docs Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit. I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously. r? ``@GuillaumeGomez``