Open
Conversation
Co-authored-by: Amit Singhmar <abhay.singhmar2@gmail.com>
Example
---
```rust
fn foo() {
let mut arr = [1i32];
$0arr[0] = 3;$0
let _ = arr;
}
```
**Before this PR**
```rust
fn foo() {
let mut arr = [1i32];
fun_name(&mut arr);
let _ = arr;
}
fn $0fun_name(arr: &mut [i32; 1]) {
*arr[0] = 3;
}
```
**After this PR**
```rust
fn foo() {
let mut arr = [1i32];
fun_name(&mut arr);
let _ = arr;
}
fn $0fun_name(arr: &mut [i32; 1]) {
arr[0] = 3;
}
```
…ent-index fix: no deref index-expr for extract_function
I chose the order of mut restrictions to be `unsafe mut(...)` for unsafe fields, but it's undecided yet.
feat: Support `impl` and `mut` restrictions
GitHub actions are currently failing with:
error: unresolved link to `cfg_attr`
--> crates/ide-completion/src/context.rs:414:61
|
414 | /// Set if we are inside the predicate of a #[cfg] or #[cfg_attr].
| ^^^^^^^^ no item named `cfg_attr` in scope
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
= note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`
Documenting ide v0.0.0 (/home/runner/work/rust-analyzer/rust-analyzer/crates/ide)
error: could not document `ide-completion`
Use backticks to fix this.
AI disclosure: written with Claude Opus because it was marginally
faster.
internal: Fix rustdoc quoting
Previously, we didn't recurse in Evaluator::create_memory_map() or Evaluator::patch_addresses() when handling references with a known size. This caused problems for hover rendering on const values, which would build a memory map for evaluated allocations and then pretty-printed values by following references through that map. As a result, references in the map still pointed to the original addresses, meaning that the value pretty-printer would see the type parameters before substitution. This could cause stack overflows on well-formed Rust code using recursive const functions. Add a regression test for hovering on a recursive const fn that previously caused stack overflow. Fixes rust-lang/rust-analyzer#21503 AI disclosure: I used Codex with GPT 5.4 to investigate the issue and write the initial version of this commit.
We want to complain on PRs that generate rustdoc warnings, but only deploy the generate HTML on the master branch. Also fix the existing rustdoc warning. AI disclosure: Some Claude Opus usage.
internal: Ensure rustdoc GitHub action runs on PRs
Fixes rust-lang/rust-analyzer#21891. Previously, the completion engine would aggressively bail out if the parent enum was marked . This pushes the visibility check down to the individual variants so they can be properly completed when accessed via a public type alias.
…ocal_inherent_impl_on_render Demoting completion relevance when an inherent impl already exists
fix: MIR evaluation of sized &T with recursive const fn
fix: complete variants of hidden enums through public aliases
fix: enable vscode suggest in strings
Update generated lints
This is a quick fix, please review if there is a regression
Example
---
```rust
fn foo(data: &i32) {}
fn main() {
let indent = 2i32;
foo(in$0)
}
```
**Before this PR**
```rust
fn foo(data: &i32) {}
fn main() {
let indent = 2i32;
foo(in&dent)
}
```
```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@67",
..
```
**After this PR**
```rust
fn foo(data: &i32) {}
fn main() {
let indent = 2i32;
foo(&indent)
}
```
```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@65",
..
```
…uickfix fix: Fix ref_match position when keyword prefix
…tability-api feat: add is_mutable_raw_ptr and as_raw_ptr to hir::Type
minor: Minor simplification
Bumps [rand](https://github.com/rust-random/rand) from 0.9.2 to 0.9.3. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.9.3/CHANGELOG.md) - [Commits](rust-random/rand@rand_core-0.9.2...0.9.3) --- updated-dependencies: - dependency-name: rand dependency-version: 0.9.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…of the bindings inside Previously it was the closure, which is incorrect.
And not a DefWithBodyId.
This should help speed. Instead, we do it only when an `Interner` is constructed, since an interner cannot be held across revisions. There is a problem, though: an interner *can* be held across different databases. To solve that, we also reinit the cache when attaching databases, and take the assumption that everything significant (i.e. that can access the cache) will need to attach the db. This is somewhat risky, but we'll take it for the speed. Theoretically we could *only* reinit on db attach, but it's less risky this way, and with-crate interner construction is rare.
perf: Do not check solver's cache validity on every access
…-most-make-with-editor-specific-make Replace make with SyntaxFactory in few handlers
Signed-off-by: Jeremie Drouet <jeremie.drouet@gmail.com>
…ate-lints fix(21943): remove duplicate lints
This updates the rust-version file to e22c616.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@e22c616 Filtered ref: rust-lang/rust-analyzer@37dc6b7 Upstream diff: rust-lang/rust@e8e4541...e22c616 This merge was created using https://github.com/rust-lang/josh-sync.
minor: Sync from downstream
fix: Port call expr type checking and closure upvar inference from rustc
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
|
Member
Author
|
@bors r+ p=1 |
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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@cc5bc48.Created using https://github.com/rust-lang/josh-sync.
r? @ghost