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 #114576

Merged
merged 94 commits into from
Aug 7, 2023
Merged

⬆️ rust-analyzer #114576

merged 94 commits into from
Aug 7, 2023

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Aug 7, 2023

r? @ghost

alibektas and others added 30 commits July 4, 2023 19:27
Rendering of snippet edits is deferred to places using source change
This ensures that any assist using structured snippets won't
accidentally remove bits interpreted as snippet bits.
Also makes sure that stray placeholders get converted into tabstops
Structured snippets precisely track which text edits need to be marked
as snippet text edits, but the cases where structured snippets aren't
used but snippets are still present are for simple single text-edit
changes, so it's perfectly fine to mark all one of them as being a
snippet text edit
Had a missing ':' between the snippet index and placeholder text
…ode-to-1.75, r=lnicola

vscode: change minimum VS Code version to 1.75 from 1.78

I previously mentioned [in a comment](rust-lang/rust-analyzer#15265 (comment)) that folks at my employer are on 1.78, but I was incorrect: people are on 1.75. I know this is outside the standard version support policy, but I haven't seen any of the new features in VS Code be used in rust-analyzer. The most applicable feature in those three versions of VS Code that I can find [is lazily resolving code actions](https://code.visualstudio.com/updates/v1_78#_resolve-code-action-commands-in-resolvecodeaction), but it doesn't seem like rust-analyzer is making use of that feature.

(I'll be posting a PR that adds support for `$saved_file` within the next day, so feel free to bump the minimum VS Code version back to 1.78 if/when that PR lands. This just makes vendoring the _actual_ change I'm interested in a little bit easier.)
- use `str::parse()` rather than `FromStr::from_str()`
- use `iter::once()` instead of constructing `Vec` for a single element
…lbasi

Runnable env per platform

This PR adds an option to specify runnables `env` per platform (win32, linux, etc.):
```
{
    "rust-analyzer.runnables.extraEnv": [
            {
                "platform": "win32",
                "env": {
                    "SCITER_BIN_FOLDER": "C:\\Projects\\3rd\\sciter-js-sdk\\bin\\windows\\x64",
                }
            },
            {
                "platform":["linux","darwin"],
                "env": {
                    "SCITER_BIN_FOLDER": "/home/vit/Projects/sciter/sciter-js-sdk/bin/linux/x64",
                }
            }
        ]
}
```
Properly infer types with type casts

This PR reenables `Expectation::Castable` (previous attempt at rust-lang#14104, reverted by rust-lang#14120) and implements type cast checks, which enable us to infer a bit more.

Castable expectations are relatively weak -- they only influence the inference if we cannot infer the types by other means. Therefore, we need to defer possible type unification with the casted type until we type check all expressions of the body. This PR adds a struct and slots in `InferenceContext` for the deferred cast checks (c.f. [`CastCheck`] in `rustc_hir_typeck`).

I only implemented the bits that affect the inference result. It should be possible to return type adjustments for well-formed casts and report diagnostics for invalid casts, but I'm leaving them for future work for now.

Fixes rust-lang#11571
Fixes rust-lang#15246

[`CastCheck`]: https://github.com/rust-lang/rust/blob/da1d099f91ea387a2814a6244dd875a2048b486f/compiler/rustc_hir_typeck/src/cast.rs#L55
…r=lnicola

Show anonymous fn def type as a fn pointer in source code

Fixes rust-lang#15346

The second commit is an unrelated change. I can remove it if not desired.
HKalbasi and others added 16 commits August 4, 2023 16:05
Improve mir interpreter performance by caching
Previously, clicking 'rust-analyzer' would stop the server
entirely. This was easy to do accidentally, and then the user has to
wait for the server to start up again.
If the rust-analyzer server isn't running, we can't do much. Treat
this state as a warning color, so it's more obvious.
Set the default status bar action to openLogs

Previously, clicking 'rust-analyzer' would stop the server entirely. This was easy to do accidentally, and then the user has to wait for the server to start up again.
SCIP requires symbols to be unique, but multiple functions may have a
parameter with the same name. Qualify parameters according to the
containing function.
SCIP: Qualify parameters by the containing function

SCIP requires symbols to be unique, but multiple functions may have a parameter with the same name. Qualify parameters according to the containing function.
Use the warning color when rust-analyzer is stopped

If the rust-analyzer server isn't running, we can't do much. Treat this state as a warning color, so it's more obvious.
…ait, r=lnicola

fix: Remove unwraps from "Generate delegate trait"

Fixes rust-lang#15388

This is untested and purely mechanical, maybe some of those `unwrap`s actually made sense, but it probably doesn't hurt to avoid them.
internal: Turn unresolved proc macro expansions into missing expressions

Reduces the amount of type related errors one gets when proc macro expansion is disabled.
Also don't provide the assist when the `Default` trait can't be found.
…r=lnicola

Don't provide `generate_default_from_new` when impl self ty is missing

Also don't provide the assist when the `Default` trait can't be found.

Part of rust-lang#15398
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2023

Some changes occurred in src/tools/rust-analyzer

cc @rust-lang/rust-analyzer

@lnicola
Copy link
Member Author

lnicola commented Aug 7, 2023

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Aug 7, 2023

📌 Commit a42f832 has been approved by lnicola

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2023
@bors
Copy link
Contributor

bors commented Aug 7, 2023

⌛ Testing commit a42f832 with merge 139b49b...

@bors
Copy link
Contributor

bors commented Aug 7, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 139b49b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 7, 2023
@bors bors merged commit 139b49b into rust-lang:master Aug 7, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 7, 2023
@lnicola lnicola deleted the sync-from-ra branch August 7, 2023 12:13
falcucci added a commit to falcucci/changelog-it that referenced this pull request Aug 7, 2023
adds the list of contributors to the template. the contributors are: enselic, ralfjung, trolldemorted, matthiaskrgr, ttsugriy, kobzol, and lnicola.

this commit updates `example.md` by adding the contributors to the list. the changes can be seen in the diff:

```diff
diff --git a/templates/example.md b/templates/example.md
index a12803718a3e..da0ecc84c0c6 100644
--- a/templates/example.md
+++ b/templates/example.md
@@ -10,3 +10,16 @@
 - [ci: do not hide error logs in a group](rust-lang/rust#114573)
 - [:arrow_up: `rust-analyzer`](rust-lang/rust#114576)
 - [rollup of 9 pull requests](rust-lang/rust#114585)
+
+### contributors
+
+- [enselic](https://github.com/enselic)
+- [enselic](https://github.com/enselic)
+- [ralfjung](https://github.com/ralfjung)
+- [trolldemorted](https://github.com/trolldemorted)
+- [matthiaskrgr](https://github.com/matthiaskrgr)
+- [matthiaskrgr](https://github.com/matthiaskrgr)
+- [ttsugriy](https://github.com/ttsugriy)
+- [kobzol](https://github.com/kobzol)
+- [lnicola](https://github.com/lnicola)
+- [matthiaskrgr](https://github.com/matthiaskrgr)
```
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (139b49b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [1.5%, 2.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-3.9%, -3.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.9% [-3.9%, -3.9%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 652.069s -> 652.316s (0.04%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.