-
Notifications
You must be signed in to change notification settings - Fork 14k
rust-analyzer subtree update
#149265
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
Open
lnicola
wants to merge
146
commits into
rust-lang:main
Choose a base branch
from
lnicola:sync-from-ra
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
rust-analyzer subtree update
#149265
+13,259
−7,128
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Supports:
- and <-> and_then
- then_some <-> then
Example
---
```rust
fn foo() {
let foo = Some("foo");
return foo.and$0(Some("bar"));
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
fn foo() {
let foo = Some("foo");
return foo.and_then(|| Some("bar"));
}
```
It cannot be exactly the same, because we have needs rustc doesn't have (namely, accurate enumeration of all methods, not just with a specific name, for completions etc., while rustc also needs a best-effort implementation for diagnostics) but it is closer than the previous impl. In addition we rewrite the closely related handling of operator inference and impl collection. This in turn necessitate changing some other parts of inference in order to retain behavior. As a result, the behavior more closely matches rustc and is also more correct. This fixes 2 type mismatches on self (1 remains) and 4 diagnostics (1 remains), plus some unknown types.
This is required now that we send this clause to the solver.
Example
---
```rust
enum A { $0Foo(u32), Bar$0(i32) }
```
**Before this PR**
```rust
enum A { Foo(u32), Bar(i32) }
impl From<u32> for A {
fn from(v: u32) -> Self {
Self::Foo(v)
}
}
```
**After this PR**
```rust
enum A { Foo(u32), Bar(i32) }
impl From<u32> for A {
fn from(v: u32) -> Self {
Self::Foo(v)
}
}
impl From<i32> for A {
fn from(v: i32) -> Self {
Self::Bar(v)
}
}
```
Example
---
```rust
mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
$0std::fmt::Debug;
let x: std::fmt::Debug = std::fmt::Debug;
}
```
**Before this PR**
```rust
use std::fmt;
mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
fmt::Debug;
let x: fmt::Debug = fmt::Debug;
}
```
**After this PR**
```rust
use std::fmt::Debug;
mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
Debug;
let x: Debug = Debug;
}
```
Like `unsafe(no_mangle)`
Rowan's green nodes are super drop heavy and as lru eviction happens on cancellation this can block for quite some time, especially after cache priming
Example --- ```rust #[no_mangle] static lower_case: () = (); ``` **Before this PR** ```text non_upper_case_globals ``` **After this PR** No diagnostics
perf: Improve start up time
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@3.14.1...3.14.2) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [glob](https://github.com/isaacs/node-glob) from 11.0.1 to 11.1.0. - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v11.0.1...v11.1.0) --- updated-dependencies: - dependency-name: glob dependency-version: 11.1.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…incorrect-case Fix hit incorrect_case on no_mangle static items
fix: make visibility diagnostics for fields to correct location
Example
---
viewHir
```rust
fn main() {
let r = &2;
let _ = &mut (*r as i32)
}
```
**Before this PR**
```rust
fn main() {
let r = &2;
let _ = &mut *r as i32;
}
```
**After this PR**
```rust
fn main() {
let r = &2;
let _ = &mut (*r as i32);
}
```
minor: format T_
Implement precedence for print_hir
…yarn/editors/code/glob-11.1.0 Bump glob from 11.0.1 to 11.1.0 in /editors/code
…yarn/editors/code/js-yaml-3.14.2 Bump js-yaml from 3.14.1 to 3.14.2 in /editors/code
Add `unsafe(…)` attribute completion
feat: add assist to convert char literal
feat: Completion ` = $0` after keyval cfg predicate
…enum-disc Add pretty number for add_explicit_enum_discriminant
Fix always irrefutable in RecordPatField
…vtyr minor: Use `const_eval_static` query for statics
- Discussed in rust-lang/rust-analyzer#21107 - Avoids activating an `attributes` feature to crates that do not use it - Updates the 6 crates that use attributes feature to specify it in their Cargo.toml: {hir,hir-def,hir-ty,ide-assists,ide-db,project-model}
Auto-loaded via the debugger_visualizer attribute. Tested on smolstr's unittest: $ RUSTFLAGS="-C debuginfo=2 -C opt-level=0" cargo test -p smol_str --no-run $ rust-gdb target/debug/deps/test-a806b111557a7133 (gdb) break test::conversions (gdb) run (gdb) next (gdb) print s (and other locations in that file, to test the three cases: Inline, Static and Heap)
…utes-feat fix: no unused `tracing/attributes` feature
…r_pretty_printer Provide a gdb pretty printer for smol_str::SmolStr
Major changes: - `GoalSource::InstantiateHigherRanked` was removed. - `Interner::UnevaluatedConstId` was introduced, allowing further simplifications due to better typing. Generally we don't represent unevaluated consts like we should, but it's still better. - `PatternKind::NotNull` was introduced.
add semantic tokens for deprecated items
…targets-outside-pkg-root fix: include all target types with paths outside package root
internal: Upgrade rustc crates
…nd-then Fix not applicable on `and` for replace_method_eager_lazy
Example
---
```rust
fn main() { let _ = &raw $0 }
```
**Before this PR**
```text
fn main() fn()
bt u32 u32
kw const
kw const
kw crate::
...
```
**After this PR**
```text
fn main() fn()
bt u32 u32
kw const
kw crate::
...
```
Fix duplicate `const` complete after `raw`
add deprecated semantic token for extern crate shorthand
proc-macro-srv: Reimplement token trees via immutable trees
Collaborator
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
Collaborator
|
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-rust-analyzer
Relevant to the rust-analyzer team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Subtree update of
rust-analyzerto rust-lang/rust-analyzer@cf4b1fa.Created using https://github.com/rust-lang/josh-sync.
r? @ghost