Rollup of 35 pull requests#158342
Conversation
This is a follow-up to rust-lang#155431
Implement a rust-analyzer VS Code command for creating new Cargo projects from the editor. Add command registration, UI entry points, configuration for post-create behavior, focused validation, and tests for the command flow. AI tools were used to research comparable editor behaviors and help refine the implementation plan; the resulting changes were reviewed before submission.
When an index expression with an ambiguous type (e.g. `arr[idx.into()]`) appears inside a cast or binary operation, the type inference error was incorrectly attributed to the outer expression instead of the `.into()` call. Resolve the index sub-expression type first so the error points at the actual ambiguous site.
Point the new project failure flow at the extension logs and make the log-opening command available when the language server is not running. Also add tests for the env-aware cargo path resolution path introduced for project creation.
Run the VS Code formatter to fix the remaining Prettier issue in the launch config test before updating rust-lang/rust-analyzer#22103. AI-assisted: OpenAI Codex was used to identify and apply this change.
Handle Windows executable suffixes when the VS Code extension probes for cargo through PATH or CARGO_HOME, and preserve case-insensitive environment variable lookup for supplied env objects so copied Windows `Path` entries still resolve cargo. Normalize and document the Windows CARGO_HOME test comparison as well, because VS Code path resolution can lowercase the drive letter in `fsPath` without changing which executable was found. This keeps the extension-side lookup aligned with the Rust-side toolchain helper behavior and avoids breaking create-project on common Windows setups. AI-assisted: OpenAI Codex was used to identify and apply this change.
fix: rename schema subItems with sub_items
…as_adt_def Make assist `inline_type_alias` work on ADT definitions
Example
---
```json
{
"rust-analyzer.completion.autoimport.exclude": [
{"path": "xxx_crate::Foo", "type": "variants"},
]
}
```
```rust
enum Foo {
Variant1,
Variant2,
}
fn main() {
V$0
}
```
**Before this PR**
```
ev TupleV(…) TupleV(u32)
ev Variant1 (use Foo::Variant1) Variant1
ev Variant2 (use Foo::Variant2) Variant2
bt u32 u32
```
**After this PR**
```
ev TupleV(…) TupleV(u32)
bt u32 u32
```
feat: support flyimport exclude variants
Example
---
```rust
macro_rules! m { ($i:expr) => { $i } }
fn f() {
let xyz = 0;
m!(xyz$0);
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
macro_rules! m { ($i:expr) => { $i } }
fn f() {
m!(0);
}
```
Example
---
```rust
macro_rules! i { ($($t:tt)*) => { $($t)* } }
fn f() {
i!(let xyz = 0;);
_ = xyz$0;
_ = xyz;
}
```
**Before this PR**
```
request handler panicked: can't resolve SyntaxNodePtr { kind: LET_STMT, range: 0..9 } with SOURCE_FILE@0..108
```
**After this PR**
```rust
macro_rules! i { ($($t:tt)*) => { $($t)* } }
fn f() {
i!(let xyz = 0;);
_ = 0;
_ = xyz;
}
```
This command as removed in 797185e.
…lysis-bench-removed Remove docs about removed `analysis-bench` command
internal: git ignore .vim/coc-settings.json
In c0f428d55b425c8ba18039a3687cdcdc47e111d1 this code was adjusted to handle a change in `load_workspace`. The change assumed that the `ra-rustc-test` folder existed in the `std::env::temp_dir`, but this assumption is not always correct.
This updates the rust-version file to 485ec3f.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@485ec3f Filtered ref: rust-lang/rust-analyzer@1541b9b Upstream diff: rust-lang/rust@029c9e1...485ec3f This merge was created using https://github.com/rust-lang/josh-sync.
…ate-dir-for-cargo-xtask-metrics-rustc_tests Create directory for `cargo xtask metrics rustc_tests`
Rustc pull update
…ypqwmmp Fix destructuring assignments not introducing moves
The region-constraint machinery for `-Zassumptions-on-binders` is region-outlives-only. A non-lifetime binder (`for<T>`) introduces a placeholder type in the binder's universe `u`. The rewrite that pulls constraints out of `u` only folds regions (`PlaceholderReplacer` just implements `fold_region`), so an alias-outlives constraint such as `<!T as Trait>::Assoc: 'r` reaches `pull_region_outlives_constraints_out_of_universe` still in `u` and trips `assert!(max_universe < u)`. Report ambiguity for those constraints instead of asserting, matching the existing `None => Ambiguity` bail-outs in this module. The goal then surfaces as an ordinary ambiguity error rather than an ICE.
|
Well past the point where things have died for network errors before. Re-opening the tree so that things can continue if and when this is merged. If it fails, I have prioritized a @bors treeclosed- |
|
Tree is now open for merging. |
|
Stuck |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #158342. |
This comment has been minimized.
This comment has been minimized.
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #158342. |
This comment has been minimized.
This comment has been minimized.
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
|
Oh lmao, right, changed the priority of the other PR |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #156742. |
This comment has been minimized.
This comment has been minimized.
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
|
The other PR had conflicts apparently so let's just do this one again... |
|
💔 Test for ce4b23f failed: CI. Failed job:
|
|
@bors retry |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors p=5 |
|
⌛ Testing commit 81526af with merge f27207b... Workflow: https://github.com/rust-lang/rust/actions/runs/28124883481 |
Rollup of 35 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #158336 (Stop excluding `stdarch` test crates from `rust-src`) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157419 (move rustc_type_ir Term things to term_kind.rs) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #157939 (Reorganize `tests/ui/issues` [8/N]) - #157946 (Make `char::is_private_use` and `char::is_assigned` unstably public) - #158003 (Reorganize `tests/ui/issues` [9/N]) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158060 (Reorganize `tests/ui/issues` [10/N]) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158272 (Reorganize `tests/ui/issues` [13/N]) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) - #158314 (Fix incorrect unsafe debug assertion in unchecked_div_exact) - #158326 (Add `io::ErrorKind::TooManyOpenFiles`)
View all comments
Successful merges:
rust-analyzersubtree update #158315 (rust-analyzersubtree update)stdarchtest crates fromrust-src#158336 (Stop excludingstdarchtest crates fromrust-src)proc_macrothings #157271 (simplify someproc_macrothings)extern "tail"#157983 (Lift the same-signature restriction forextern "tail")ShimKindenum #158105 (Extract all instance shim variants into newShimKindenum)resolve_ident_in_module_non_globs_unadjusted#158207 (Resolver: local/external split ofresolve_ident_in_module_non_globs_unadjusted)-Zassumptions-on-binders#157807 (don't ice on non-lifetime binders under-Zassumptions-on-binders)tests/ui/issues[8/N] #157939 (Reorganizetests/ui/issues[8/N])char::is_private_useandchar::is_assignedunstably public #157946 (Makechar::is_private_useandchar::is_assignedunstably public)tests/ui/issues[9/N] #158003 (Reorganizetests/ui/issues[9/N])tests/ui/issues[10/N] #158060 (Reorganizetests/ui/issues[10/N])cfg_selectinstd::os#158252 (Usecfg_selectinstd::os)tests/ui/issues[13/N] #158272 (Reorganizetests/ui/issues[13/N])rustc-literal-escaperversion to0.0.8#158309 (Updaterustc-literal-escaperversion to0.0.8)io::ErrorKind::TooManyOpenFiles#158326 (Addio::ErrorKind::TooManyOpenFiles)r? @ghost
Create a similar rollup