Commit Graph

214640 Commits

Author SHA1 Message Date
Ezra Shaw
02005e9f22
remove unreachable error code E0490 2023-01-12 14:15:21 +13:00
bors
0442fbabe2 Auto merge of #106607 - 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-10 06:22:01 +00:00
bors
deba5ddd07 Auto merge of #106656 - JohnTitor:rollup-rk2qltg, r=JohnTitor
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-10 03:26:29 +00:00
bors
d53924d8c7 Auto merge of #106495 - JohnTitor:issue-100772, r=compiler-errors
Add regression test for #100772

Closes #100772
r? `@compiler-errors`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-10 00:22:16 +00:00
Yuki Okushi
ed840a6c3b
Rollup merge of #106647 - notriddle:notriddle/a, r=GuillaumeGomez
rustdoc: merge common CSS for `a`
2023-01-10 08:05:37 +09:00
Yuki Okushi
9bed3d96e6
Rollup merge of #106640 - lcnr:update-test, r=jackh726
update test for inductive canonical cycles

the previous test always resulted in a cycle 😅 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-10 08:05:36 +09:00
Yuki Okushi
0ba27de3ac
Rollup merge of #106639 - RalfJung:miri, r=RalfJung
update Miri

Notable PRs:
- https://github.com/rust-lang/miri/pull/2748
- https://github.com/rust-lang/miri/pull/2752

r? `@ghost`
2023-01-10 08:05:36 +09:00
Yuki Okushi
96e53c0c6c
Rollup merge of #106636 - djkoloski:accept_old_fuchsia_triple, r=tmandry
Accept old spelling of Fuchsia target triples

The old spelling of Fuchsia target triples was changed in #106429 to add a proper vendor. Because the old spelling is widely used, some projects may need time to migrate their uses to the new triple spelling. The old spelling may eventually be removed altogether.

r? ``@tmandry``
2023-01-10 08:05:35 +09:00
Yuki Okushi
b102673698
Rollup merge of #106387 - jyn514:clippy, r=Mark-Simulacrum
Revert "bootstrap: Get rid of `tail_args` in `stream_cargo`"

This reverts commit 9dfe50440e. (Note: that merged as part of https://github.com/rust-lang/rust/pull/106305, but https://github.com/rust-lang/rust/pull/106305/ contains more commits than just 9dfe50440e6d48bd2fd40a4b7b3992998e55eace.)

Fixes `x clippy`. It turns out `clippy` was the only one using `tail_args` 🤦 sorry for not testing this earlier.

r? `@Mark-Simulacrum`
2023-01-10 08:05:35 +09:00
Yuki Okushi
e5e116dca9
Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obk
No need to take opaques in `check_type_bounds`

`InferCtxt` already has its defining use anchor set to err

r? ``@oli-obk``
2023-01-10 08:05:34 +09:00
Yuki Okushi
684a3717cb
Rollup merge of #106175 - compiler-errors:bad-import-sugg, r=oli-obk
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-10 08:05:34 +09:00
Yuki Okushi
5773e8baf0
Rollup merge of #105708 - tomerze:enable-atomic-cas-bpf, r=nagisa
Enable atomic cas for bpf targets

It seems like LLVM now supports it.

https://reviews.llvm.org/D72184 - the PR in LLVM
2023-01-10 08:05:33 +09:00
Yuki Okushi
002eccc752
Rollup merge of #105034 - HintringerFabian:improve_iterator_flatten_doc, r=cuviper
Add example for iterator_flatten

Adds an Example to iterator_flatten
Fixes #82687
2023-01-10 08:05:32 +09:00
bors
3254bef9a7 Auto merge of #105855 - arcnmx:rust-analyzer-2022-12, r=lnicola
⬆️ rust-analyzer

Updates rust-analyzer to 368e0bb32f

This is a continuation/replacement of #105834, close that if this is chosen instead.
2023-01-09 21:14:32 +00:00
arcnmx
06e705f13d ⬆️ rust-analyzer
Merge commit '368e0bb32f1178cf162c2ce5f7e10b7ae211eb26'
2023-01-09 10:36:22 -08:00
Tyler Mandry
9c23629158
Add issue number to FIXMEs 2023-01-09 13:23:50 -05:00
bors
3020239de9 Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-dead
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-09 18:20:00 +00:00
Michael Goulet
f769d34291 Assert defining anchor is set in take_opaque_types 2023-01-09 18:14:28 +00:00
Michael Howell
1c766d03a7 rustdoc: merge common CSS for a 2023-01-09 11:09:19 -07:00
Michael Goulet
1d66a675bb review comment 2023-01-09 18:07:34 +00:00
Michael Goulet
4f15034b55 hack: don't normalize xform_ret_ty for trait/object candidates unless needed 2023-01-09 17:48:22 +00:00
Michael Goulet
2600d6245b Add lookup_probe_for_diagnostic 2023-01-09 17:48:22 +00:00
Michael Goulet
38491c6579 Consider method return type for various method suggestions 2023-01-09 17:48:22 +00:00
Michael Goulet
5132e13f13 No need to take opaques in check_type_bounds 2023-01-09 17:27:42 +00:00
Michael Goulet
7ee6cebd8a Unconditionally normalize xform_ret_ty in probe 2023-01-09 17:26:00 +00:00
David Koloski
42aa075310 Accept old spelling of Fuchsia target triples
Because the old spelling is widely used, some projects may need time to
migrate their uses to the new triple spelling. The old spelling may
eventually be removed altogether.
2023-01-09 12:18:12 -05:00
bors
368e0bb32f Auto merge of #13848 - ian-h-chamberlain:feature/color-compiler-diagnostics, r=ian-h-chamberlain
Colorize `cargo check` diagnostics in VSCode via text decorations

Fixes #13648

![colored-rustc-diagnostics](https://user-images.githubusercontent.com/11131775/209479884-10eef8ca-37b4-4aae-88f7-3591ac01b25e.gif)

Use ANSI control characters to display text decorations matching the VScode terminal theme, and strip them out when providing text content for rustc diagnostics.

This adds the small [`anser`](https://www.npmjs.com/package/anser) library (MIT license, no dependencies) to parse the control codes, and it also supports HTML output so it should be fairly easy to switch to a rendered HTML/webview implementation in the future

I also updated the default `cargo check` command to use the rendered ANSI diagnostics, although I'm not sure if it makes sense to put this kind of thing behind a feature flag, or whether it might have any issues on Windows (as I believe ANSI codes are not used for colorization there)?
2023-01-09 17:07:35 +00:00
Ian Chamberlain
283dfc45dd
Add docs for colorDiagnosticOutput capability 2023-01-09 11:50:37 -05:00
Ian Chamberlain
65cf7abbe2
Use experimental capability to enable color codes 2023-01-09 11:50:35 -05:00
Ian Chamberlain
738ce83d85
Strip colors before matching preview diagnostics 2023-01-09 11:49:59 -05:00
Ian Chamberlain
c3e4bc3136
Update docs to include note about ANSI diagnostics 2023-01-09 11:49:58 -05:00
Ian Chamberlain
40207906f4
Default to use colored ANSI diagnostics 2023-01-09 11:46:29 -05:00
Ian Chamberlain
1b8141b54c
Parse + decorate rendered ANSI cargo output
Use ANSI control characters to display text decorations matching the
VScode terminal theme, and strip them out when providing text content
for rustc diagnostics.

This adds the small `anser` library to parse the control codes, and it
also supports HTML output so it should be fairly easy to switch to a
rendered HTML/webview implementation if desired.
2023-01-09 11:46:29 -05:00
lcnr
31099ee384 update test for inductive canonical cycles 2023-01-09 17:16:12 +01:00
bors
f32e20edb9 Auto merge of #13915 - Veykril:lsp-server-msg, r=Veykril
Make it clearer when the server expects an initialized notification
2023-01-09 16:04:04 +00:00
Lukas Wirth
9eb50d3cde Make it clearer when the server expects an initialized notification 2023-01-09 17:03:36 +01:00
bors
cb1592518e Auto merge of #2755 - RalfJung:dtors_in_dtors_in_dtors, r=RalfJung
add dtors_in_dtors_in_dtors

That's a pretty neat test from the standard library. Sadly not enough to check for https://github.com/rust-lang/miri/issues/2754, but still worth having here.
2023-01-09 15:36:18 +00:00
bors
fd300eebc9 Auto merge of #13799 - Veykril:flycheck, r=Veykril
Rename `checkOnSave` settings to `check`

Now that flychecks can be triggered without saving the setting name doesn't make that much sense anymore. This PR renames it to just `check`, but keeps `checkOnSave` as the enabling setting.
2023-01-09 15:35:38 +00:00
fee1-dead
77f529bb0a
Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomez
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-09 23:35:32 +08:00
fee1-dead
99529b0cd2
Rollup merge of #106549 - wcampbell0x2a:use-fmt-named-parameters-borrowck, r=estebank
Use fmt named parameters in rustc_borrowck
2023-01-09 23:35:31 +08:00
fee1-dead
357128ad23
Rollup merge of #106468 - compiler-errors:err-instability, r=lcnr
Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`

I have no idea how to test this reliably, but I've **manually** verified it fixes the instability in #106417 that isn't due to dtolnay/trybuild#212.

Fixes #106417
2023-01-09 23:35:31 +08:00
fee1-dead
f8319bb403
Rollup merge of #106389 - compiler-errors:no-canonicalized, r=lcnr
Simplify some canonical type alias names

* delete the `Canonicalized<'tcx>` type alias in favor for `Canonical<'tcx>`
* `CanonicalizedQueryResponse` -> `CanonicalQueryResponse`

I don't particularly care about the latter, but it should be consistent. We could alternatively delete the first alias and rename the struct to `Canonicalized`, and then keep the name of `CanonicalizedQueryResponse` untouched.
2023-01-09 23:35:30 +08:00
fee1-dead
37c1d6dc09
Rollup merge of #106291 - obeis:issue-106182, r=oli-obk
Fix incorrect suggestion for extra `&` in pattern

Closes #106182
2023-01-09 23:35:29 +08:00
fee1-dead
7779386a3a
Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obk
Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`

Makes sense for this function to live with its sibling `resolve_regions_and_report_errors`, around which it's basically just a wrapper.
2023-01-09 23:35:29 +08:00
fee1-dead
fd75cfef66
Rollup merge of #106061 - ilovepi:fuchsia-scs, r=oli-obk
Enable Shadow Call Stack for Fuchsia on AArch64

Fuchsia already uses SCS by default for C/C++ code on ARM hardware. This patch allows SCS to be used for Rust code as well.
2023-01-09 23:35:28 +08:00
fee1-dead
63f2a13855
Rollup merge of #106047 - uweigand:s390x-test-bigendian-ui, r=oli-obk
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-09 23:35:27 +08:00
fee1-dead
c1f8a3ffb2
Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obk
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-09 23:35:27 +08:00
fee1-dead
b7587f1867
Rollup merge of #105292 - JulianKnodt:no_eager_commit, r=BoxyUwU
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-09 23:35:26 +08:00
Ralf Jung
85e87a80fc add dtors_in_dtors_in_dtors 2023-01-09 16:35:16 +01:00
bors
af58fc8699 Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnr
Don't normalize in AstConv

See individual commits.

Fixes #101350
Fixes #54940
2023-01-09 15:29:59 +00:00