rust-analyzer subtree update - #162045
Conversation
It turns out they should be treated as bare idents, not patterns, but only if they have no body. Also allow macro patterns for both them and extern fns, because rustc allows that.
We accidentally skipped one level more than needed.
That also deletes the file when the process exits without being dropped; this is important especially for the proc macro server since it is killed and does not exit normally. Linux and the BSDs unlink the file then access it via `/proc/self/fd` or `/dev/fd`; Windows has a dedicated API for that; and macOS unfortunately does not support that (the file is not removed after being unlinked, but you cannot access it anymore via `/dev/fd`, or at least that's what the AI said - I don't have a macOS machine to check).
Example
---
```rust
fn foo() {$0
45
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
fn foo() -> i32 {
45
}
```
Example
---
```rust
macro_rules! identity { ($($t:tt)*) => {$($t)*}; }
identity! {
fn foo() u$0
}
```
**Before this PR**
```rust
macro_r-> ules! identity { ($($t:tt)*) => {$($t)*}; }
identity! {
fn foo() u32
}
```
**After this PR**
```rust
macro_rules! identity { ($($t:tt)*) => {$($t)*}; }
identity! {
fn foo() -> u32
}
```
minor: offer 'add_return_type' after l_curly
…ents minor: fix outdated comments
fix: adds-arrow unmap ranges when fn inside macro
minor: Remove non-longer-needed remnants from previous versions of the tt encoding
When writing `foo.0` where `foo` is a union, we'd end up panicking with:
Failed to make ast node `syntax::ast::generated::nodes::Name` from text mod 0;
This is because `make::name()` requires a legal ident. In
480db310b60fb4ec20deecdd26a066e026c0b522 we added checks for numeric
fields (i.e. `.0` instead of `.foo`) in several code paths but missed
the union case.
Rather than adding another check, just change the fix to never be
offered when the field name isn't a valid identifier.
Add a unit test for the union case too.
AI disclosure: Code partly written by GPT-5.6, review and commit
message by me.
Add backticks so it's easier to see exactly what the input was.
…-panic fix: Panic on accessing numeric fields in unions
internal: Improve panic messages on invalid AST nodes
Previously, code like `let &(x, y) = unknown_var;` would produce a
panic of the form:
deref projection of non-dereferenceable ty PlaceTy { ... }
Fix MIR lowering so we only project out of references if the type is a
reference, and treat it as a MIR lowering error otherwise.
AI disclosure: Code partly written by GPT-5.6, commit message and
review entirely done by a human.
…panic fix: panic on deref of unresolved aliases
… expressions.
This change allows a “mistake” I make very often to succeed: putting
the cursor on “foo” in `Struct { foo: bar() }` when I want to
extract `let foo = bar();`.
It is also groundwork for being able to extract multiple field
expressions at once.
…-twice fix: Fix unsafeck of `&raw *`
fix: Fix HIR lowering of params of trait assoc fns
fix: Switch from `temp-dir` to a homemade `NamedTempFile` implementation
…-owner fix: Push a generic params scope for consts
…d by" We've diverged quite a bit by now.
internal: Require rustc citation for analysis changes when using AI
…-never fix: reinfer never type in array repeat expressions
fix: Panic when hovering a dyn trait with a binder
fix: issue 22826
|
cc @rust-lang/rust-analyzer |
This comment has been minimized.
This comment has been minimized.
|
Hmm, I can't reproduce this with EDIT: oh, it's Windows only. |
minor: Also proc-macro-srv tests on Windows
…rets fix `overprovisioned-secrets` zizmor finding
|
@bors r+ p=1 |
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@f899669. Created using https://github.com/rust-lang/josh-sync. r? @ghost
…uwer Rollup of 12 pull requests Successful merges: - #162045 (`rust-analyzer` subtree update) - #162077 (compiler-builtins subtree update) - #137720 (support `#[target_feature(enable = ...)]` on `#[naked]` functions) - #160534 (stabilize smart pointer map functions) - #160551 (mir_build: Clearly distinguish or/refutable/irrefutable patterns during match lowering) - #161929 (explicitly track inherent const generic args kind) - #162063 (Switch dist-aarch64-linux to EC2 and update dist-x86_64-linux) - #161937 (A series of Polonius Alpha refactors) - #162014 (Move more `rustdoc-html` tests using `--test` into the right folder) - #162051 (`rustc_feature` cleanups) - #162055 (remove `_{style}` recovery for diagnostic structs) - #162075 (Move track_caller on closures gating to attribute parsing)
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 0dfb098 (parent) -> 7022271 (this PR) Test differencesShow 42 test diffsStage 0
Stage 1
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 70222712809cd5cc1718ed8995914a1cbacb6b92 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (7022271): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -7.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 480.061s -> 475.539s (-0.94%) |
Subtree update of
rust-analyzerto rust-lang/rust-analyzer@f899669.Created using https://github.com/rust-lang/josh-sync.
r? @ghost