Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ rust-analyzer #101497

Merged
merged 64 commits into from
Sep 7, 2022
Merged

⬆️ rust-analyzer #101497

merged 64 commits into from
Sep 7, 2022

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Sep 6, 2022

r? @ghost

kartva and others added 30 commits August 7, 2022 17:09
Feel free to close if this is too minor.
internal: Migrate to using format arg captures in `syntax::make`
…jonas-schievink

feat: Add a "Unmerge match arm" assist to split or-patterns inside match expressions

Fixes rust-lang#13072.

The way I implemented it it leaves the `OrPat` in place even if there is only one pattern now but I don't think something will break because of that, and when more code will be typed we'll parse it again anyway. Removing it (but keeping the child pattern) is hard, I don't know how to do that.
…h with explicit type", even when it is not exactly the same as the turbofish type

I implemented that by checking the expressions' type.
This could probably be implemented better by taking the function's return type and substituting the generic parameter with the provided turbofish, but this is more complicated.
Now that we use type information this is easy.
…er-type, r=Veykril

Use correct type in "Replace turbofish with type"

And support `?` and `.await` expressions.

Fixes rust-lang#13148.

The assist can still show up even if the turbofish's type is not used at all, e.g.:
```rust
fn foo<T>() {}
let v = foo::<i32>();
```
The change in rust-lang/rust-analyzer#13123
actually re-uses the RefMut borrow instead of dropping it so we need to
drop it manually where required.
Drop the expander borrow in all control flow paths

The change in rust-lang/rust-analyzer#13123
actually re-uses the RefMut borrow instead of dropping it so we need to
drop it manually where required.

Fixes rust-lang/rust-analyzer#13153
…th, r=Veykril

fix: unescape all occurrences of module name in module resolution

Fixes rust-lang#13141
fix: sort and deduplicate auto traits in trait object types

Fixes rust-lang#12739

Chalk solver doesn't sort and deduplicate auto traits in trait object types, so we need to handle them ourselves in the lowering phase, just like [`rustc`](https:/rust-lang/rust/blob/880416180b0a9ee1141c07d4d17667edb77daebd/compiler/rustc_typeck/src/astconv/mod.rs#L1487-L1488) and [`chalk-integration`](https:/rust-lang/chalk/blob/master/chalk-integration/src/lowering.rs#L575) do.

Quoting from [the Chalk book](https://rust-lang.github.io/chalk/book/types/rust_types.html#dyn-types):

> Note that -- for this purpose -- ordering of bounds is significant. That means that if you create a `dyn Foo + Send` and a `dyn Send + Foo`, chalk would consider them distinct types. The assumption is that bounds are ordered in some canonical fashion somewhere else.

Also, trait object types with more than one non-auto traits were previously allowed, but are now disallowed with this patch.
…rcegen, r=Veykril

clippy: make generated code nice to read

Feel free to close if this is too minor.

(For context, I _have_ read the clippy policy in `dev/style.md`)
Veykril and others added 21 commits September 1, 2022 14:54
Properly handle break resolution inside non-breakable expressions

We now diagnose invalid `continue` expressions and properly handle things like `async` blocks which prevent labels from resolving further. Cleaned this up since `label_break_value` is on the way to stabilization in rust (🎉 finally) and we weren't handling breaks for blocks properly yet.
…chievink

fix: Lower float literals with underscores

Fixes rust-lang#13155 (the problem was the `PI` is defined with `_f64` suffix). `PI` is still truncated, though, because `f64` cannot represent the value with full precision.
…ype-path-with-coloncolon, r=jonas-schievink

fix: Parse TypePathFn with preceding `::`

e.g. `impl Fn::() -> ()`.

Fixes rust-lang#13157. This was the problem, not that the path was not at the end.

I could unify the parsing of `::` of TypePathFn with that of generic arg list, but some code relies on the `::` of generic arg list to be inside it.
feat: Implement `feature(exhaustive_patterns)` from unstable Rust

Closes rust-lang#12753

Recognize Rust's unstable `#![feature(exhaustive_patterns)]` (RFC 1872). Allow omitting visibly uninhabited variants from `match` expressions when the feature is on.

This adjusts match checking to the current implementation of the postponed RFC 1872 in rustc.
They are ZSTs which we can just create on missing access instead.
Don't store SyntheticSyntax in the reverse maps in BodySourceMap

They are ZSTs which we can just create on missing access instead.
A Resolver *always* has a module scope at the end of its scope stack,
instead of encoding this as an invariant we can just lift this scope
out into a field, allowing us to skip going through the scope vec
indirection entirely.
Lift out the module scope into a field in the Resolver

A Resolver *always* has a module scope at the end of its scope stack,
instead of encoding this as an invariant we can just lift this scope
out into a field, allowing us to skip going through the scope vec
indirection entirely.
Clarify the state of (extern) preludes for block def maps
Fix nested break expressions, expecting unknown types
It seems that we've accidentally deleted the tests here couple of years
ago, and then fairly recently made a typo during refactor as well.

Reinstall tests, with coverage marks this time :-)
fix: correct broken logic for return complition

It seems that we've accidentally deleted the tests here couple of years
ago, and then fairly recently made a typo during refactor as well.

Reinstall tests, with coverage marks this time :-)
@lnicola
Copy link
Member Author

lnicola commented Sep 6, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 6, 2022

📌 Commit d058800 has been approved by lnicola

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 6, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 7, 2022
Rollup of 8 pull requests

Successful merges:

 - rust-lang#101451 (Add incremental test for changing struct name in assoc type.)
 - rust-lang#101468 (fix RPIT ICE for implicit HRTB when missing dyn)
 - rust-lang#101481 (Fix compile errors for uwp-windows-msvc targets)
 - rust-lang#101484 (Remove dead broken code from const zst handling in backends)
 - rust-lang#101486 (Add list of recognized repr attributes to the unrecognized repr error)
 - rust-lang#101488 (rustdoc: remove unused CSS `#results > table`)
 - rust-lang#101491 (rustdoc: remove outdated CSS `.sub-variant > div > .item-info`)
 - rust-lang#101497 (:arrow_up: rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6903a84 into rust-lang:master Sep 7, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 7, 2022
@lnicola lnicola deleted the rust-analyzer-2022-09-06 branch September 7, 2022 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.