Commit Graph

196871 Commits

Author SHA1 Message Date
Yiming Lei
9815667b8b implement #98982
when loop as tail expression for miss match type E0308 error, recursively get
the return statement and add diagnostic information on it
use rustc_hir::intravisit to collect the return expression
	modified:   compiler/rustc_typeck/src/check/coercion.rs
	new file:   src/test/ui/typeck/issue-98982.rs
	new file:   src/test/ui/typeck/issue-98982.stderr
2022-08-05 10:28:00 -07:00
Josh Stone
99793d97e1
Update RELEASES.md
Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
2022-08-05 10:02:46 -07:00
Josh Stone
5247a33f83
Update RELEASES.md
Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
2022-08-05 10:02:38 -07:00
Xavier Noria
64d1c91a31
ascii -> ASCII in code comment 2022-08-05 18:45:42 +02:00
Michael Goulet
694a010a5c move DiagnosticArgFromDisplay into rustc_errors 2022-08-05 16:44:01 +00:00
Michael Goulet
0ad57d8502 Delay formatting trimmed path until lint/error is emitted 2022-08-05 16:44:01 +00:00
bors
affe0d3a00 Auto merge of #100174 - Dylan-DPC:rollup-wnskbk6, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #99835 (Suggest adding/removing `ref` for binding patterns)
 - #100155 (Use `node_type_opt` to skip over generics that were not expected)
 - #100157 (rustdoc: use `collect()` instead of repeatedly pushing)
 - #100158 (kmc-solid: Add a stub implementation of #98246 (`File::set_times`))
 - #100166 (Remove more Clean trait implementations)
 - #100168 (Improve diagnostics for `const a: = expr;`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-05 16:35:15 +00:00
Dylan DPC
e7ed8443ea
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_const_item, r=compiler-errors
Improve diagnostics for `const a: = expr;`

Adds a suggestion to write a type when there is a colon, but the type is not present.
I've also shrunk spans a little, so the suggestions are a little nicer.

Resolves #100146

r? `@compiler-errors`
2022-08-05 21:54:37 +05:30
Dylan DPC
404782dffe
Rollup merge of #100166 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`
2022-08-05 21:54:36 +05:30
Dylan DPC
823ef905ed
Rollup merge of #100158 - solid-rs:patch/kmc-solid/follow-up-98246, r=joshtriplett
kmc-solid: Add a stub implementation of #98246 (`File::set_times`)

 Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after #98246.

This target does not support setting a modification time and access time separately, hence stubbing out the implementation.
2022-08-05 21:54:35 +05:30
Dylan DPC
97440b5899
Rollup merge of #100157 - rust-lang:notriddle/use-map-instead-of-repeated-push, r=Dylan-DPC
rustdoc: use `collect()` instead of repeatedly pushing
2022-08-05 21:54:34 +05:30
Dylan DPC
721af40dcb
Rollup merge of #100155 - compiler-errors:issue-100154, r=jackh726
Use `node_type_opt` to skip over generics that were not expected

Fixes #100154
2022-08-05 21:54:33 +05:30
Dylan DPC
9e4feff46a
Rollup merge of #99835 - TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern, r=estebank
Suggest adding/removing `ref` for binding patterns

This fixes what a fixme comment says.

r? `@estebank`
2022-08-05 21:54:32 +05:30
Michael Howell
dddc2fd6de rustdoc: reduce the number of intermediate Strings allocated 2022-08-05 08:56:09 -07:00
Mark Rousskov
b560dd64d7 Bump to 1.65.0 2022-08-05 11:32:46 -04:00
Maybe Waffle
95bf0fb917 Move stability lookup after cross-crate check 2022-08-05 18:13:22 +04:00
Maybe Waffle
c195f7c0a4 Optimize pointer::as_aligned_to 2022-08-05 17:14:32 +04:00
bors
3792720086 Auto merge of #12947 - Veykril:switch-workspace, r=Veykril
Don't switch workspace on vfs file changes from libraries

When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.
2022-08-05 13:13:44 +00:00
bors
97038e55cf Auto merge of #12949 - Veykril:token-pick, r=Veykril
fix: Fix incorrect token pick rankings
2022-08-05 13:06:10 +00:00
bors
d77da9da84 Auto merge of #100073 - dpaoliello:externvar, r=michaelwoerister
Add test for raw-dylib with an external variable

All existing tests of link kind `raw-dylib` only validate the ability to link against functions, but it is also possible to link against variables.

This adds tests for linking against a variable using `raw-dylib` both by-name and by-ordinal.
2022-08-05 13:05:34 +00:00
Lukas Wirth
6bf674c8e4 fix: Fix incorrect token pick rankings 2022-08-05 14:59:26 +02:00
bors
2364788c3b Auto merge of #12948 - Veykril:classify-ops, r=Veykril
feat: Handle operators like their trait functions in the IDE

Allows hover and goto implementation to work on `?`, indexing brackets, binary operators, prefix operators and `await`. Regarding `await`, hover will continue to show the keyword docs while goto implementation will bring the user to the `poll` function of the `Future` implementation.
![Code_CJmZ3FGFVn](https://user-images.githubusercontent.com/3757771/183076683-c9899bd6-60d3-461b-965f-0c0f9745e2e8.gif)

Fixes https://github.com/rust-lang/rust-analyzer/issues/12810
2022-08-05 12:55:36 +00:00
Lukas Wirth
8aa50e08af Simplify 2022-08-05 14:54:14 +02:00
Lukas Wirth
352d3c6e50 Fix visibilities 2022-08-05 14:28:36 +02:00
Maybe Waffle
743ad07c4b Improve diagnostics for const a: = expr; 2022-08-05 16:19:28 +04:00
Lukas Wirth
d6e78b04d0 feat: Handle operators like their trait functions in the IDE 2022-08-05 14:16:36 +02:00
yukang
2b15fc6d9a recover require,include instead of use in item 2022-08-05 19:20:03 +08:00
Guillaume Gomez
46d17d6aaa remove Clean trait implementation for hir::TraitItem 2022-08-05 12:08:32 +02:00
Lukas Wirth
6a1737242b Don't switch workspace on vfs file changes from libraries
When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.
2022-08-05 12:06:42 +02:00
Guillaume Gomez
38083acde2 remove Clean trait implementation for hir::PolyTraitRef 2022-08-05 12:01:30 +02:00
bors
9bbbf60b04 Auto merge of #95977 - FabianWolff:issue-92790-dead-tuple, r=estebank
Warn about dead tuple struct fields

Continuation of #92972. Fixes #92790.

The language team has already commented on this in https://github.com/rust-lang/rust/pull/92972#issuecomment-1021511970; I have incorporated their requests here. Specifically, there is now a new allow-by-default `unused_tuple_struct_fields` lint (name bikesheddable), and fields of unit type are ignored (https://github.com/rust-lang/rust/pull/92972#issuecomment-1021815408), so error messages look like this:
```
error: field is never read: `1`
  --> $DIR/tuple-struct-field.rs:6:21
   |
LL | struct Wrapper(i32, [u8; LEN], String);
   |                     ^^^^^^^^^
   |
help: change the field to unit type to suppress this warning while preserving the field numbering
   |
LL | struct Wrapper(i32, (), String);
   |                     ~~
```
r? `@joshtriplett`
2022-08-05 09:32:26 +00:00
Takayuki Maeda
f6d42aa336 remove an unnecessary str::rfind 2022-08-05 18:14:15 +09:00
bors
cb52271701 Auto merge of #12946 - rust-lang:issue-template, r=lnicola
Update bug_report.md

Closes https://github.com/rust-lang/rust-analyzer/issues/12944
2022-08-05 07:09:34 +00:00
Lukas Wirth
d94a42d652
Update bug_report.md 2022-08-05 09:04:27 +02:00
Lukas Wirth
30c4f9fa7d
Update bug_report.md 2022-08-05 08:42:13 +02:00
bors
cdfd675a63 Auto merge of #99867 - spastorino:refactor-remap-lifetimes, r=nikomatsakis
Split create_def and lowering of lifetimes for opaque types and bare async fns

r? `@cjgillot`

This work is kind of half-way, but I think it could be merged anyway.
I think we should be able to remove all the vacant arms in `new_named_lifetime_with_res`, if I'm not wrong that requires visiting more nodes. We can do that as a follow up.
In follow-up PRs, besides the thing mentioned previously, I'll be trying to remove `LifetimeCaptureContext`, `captured_lifetimes` as a global data structure, global `binders_to_ignore` and all their friends :).

Also try to remap in a more general way based on def-ids.
2022-08-05 06:35:12 +00:00
bors
6bcf01afdb Auto merge of #97085 - rylev:test-issue-33172, r=wesleywiser
Add a test for issue #33172

Adds a test confirming that #33172 has been fixed.

CDB has some surprising results as it looks like the supposedly unmangled static's symbol name is prefixed when it shouldn't be.

r? `@wesleywiser`

Closes #33172
2022-08-05 03:26:47 +00:00
Michael Howell
70a6ae6709 rustdoc: use collect() instead of repeatedly pushing to bounds 2022-08-04 18:13:53 -07:00
Michael Howell
7ba51fa05b rustdoc: use collect() instead of repeatedly pushing to bindings 2022-08-04 18:13:46 -07:00
bors
2da8820470 Auto merge of #95026 - cuviper:bump-linux-min, r=Mark-Simulacrum
Increase the minimum linux-gnu versions

This is implementing the MCP from rust-lang/compiler-team#493. It is
increasing the minimum requirements of a couple Tier 1 targets, and
others at lower tiers, so this should go through FCP sign-offs for both
`T-compiler` and `T-release`.

The new `linux-gnu` baseline is kernel 3.2 and glibc 2.17. We will also
take that kernel as the minimum floor for _all_ `*-linux-*` targets, so
it may be broadly assumed in the implementation of the standard library.
That does not preclude specific targets from having greater requirements
where it makes sense, like a new arch needing something newer, or a
platform like `linux-android` choosing a newer baseline.
2022-08-04 23:56:07 +00:00
Josh Stone
a8c12c7458 Link /rustroot/lib stuff for clang -m32 to see 2022-08-04 16:25:01 -07:00
Michael Goulet
5bb50ddc83 opt node type 2022-08-04 22:43:39 +00:00
bors
f6f9d5e73d Auto merge of #100151 - matthiaskrgr:rollup-irqwvj2, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #98796 (Do not exclusively suggest `;` when `,` is also a choice)
 - #99772 (Re-enable submodule archive downloads.)
 - #100058 (Suggest a positional formatting argument instead of a captured argument)
 - #100093 (Enable unused_parens for match arms)
 - #100095 (More EarlyBinder cleanups)
 - #100138 (Remove more Clean trait implementations)
 - #100148 (RustWrapper: update for TypedPointerType in LLVM)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-04 21:03:48 +00:00
Matthias Krüger
c2d7321a2d
Rollup merge of #100148 - durin42:llvm-16-pointertype, r=nikic
RustWrapper: update for TypedPointerType in LLVM

This is a result of https://reviews.llvm.org/D130592.

r? `@nikic`
2022-08-04 22:25:06 +02:00
Matthias Krüger
60d83e732b
Rollup merge of #100138 - GuillaumeGomez:rm-clean-impls, r=notriddle
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`
2022-08-04 22:25:05 +02:00
Matthias Krüger
01ccde5ec8
Rollup merge of #100095 - jackh726:early-binder, r=lcnr
More EarlyBinder cleanups

Each commit is independent

r? types
2022-08-04 22:25:04 +02:00
Matthias Krüger
6b938c8491
Rollup merge of #100093 - wcampbell0x2a:unused-parens-for-match-arms, r=petrochenkov
Enable unused_parens for match arms

Fixes: https://github.com/rust-lang/rust/issues/92751

Currently I can't get the `stderr` to work with `./x.py test`, but this should fix the issue. Help would be appreciated!
2022-08-04 22:25:02 +02:00
Matthias Krüger
d3aa757ff8
Rollup merge of #100058 - TaKO8Ki:suggest-positional-formatting-argument-instead-of-format-args-capture, r=estebank
Suggest a positional formatting argument instead of a captured argument

This patch fixes a part of #96999.

fixes #98241
fixes #97311

r? `@estebank`
2022-08-04 22:25:01 +02:00
Matthias Krüger
87dd56f3d6
Rollup merge of #99772 - ehuss:reenable-submodule-archive, r=Mark-Simulacrum
Re-enable submodule archive downloads.

This is effectively a revert of #98423 (though it keeps the `--depth 1` flag since that is still helpful).

GitHub has indicated that they have been working on the original issue, and my testing shows that the llvm-project archive download now succeeds 100% of the time.

This should save about a minute on every job.
2022-08-04 22:25:00 +02:00
Matthias Krüger
f6ea143f93
Rollup merge of #98796 - compiler-errors:no-semi-if-comma, r=estebank
Do not exclusively suggest `;` when `,` is also a choice

Fixes #96791
2022-08-04 22:24:59 +02:00