A4-Tacks
a068ef86e3
Fix parentheses for missing_unsafe
...
I seem unable to use `Expr::needs_parens*` to complete it
Example
---
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
STATIC_MUT$0 * 2
}
```
**Before this PR**:
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
unsafe { STATIC_MUT } * 2
}
```
**After this PR**:
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
(unsafe { STATIC_MUT }) * 2
}
```
2025-10-05 14:02:49 +08:00
Shoyu Vanilla (Flint)
a56e57752f
Merge pull request #20748 from A4-Tacks/migrate-arith-op-prec
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate `replace_arith_op` assist to use `SyntaxEditor`
2025-09-26 09:05:59 +00:00
Shoyu Vanilla (Flint)
62809824ad
Merge pull request #20599 from A4-Tacks/bang-de-morgan
...
Add applicable on bang `!` for apply_demorgan
2025-09-26 08:58:07 +00:00
A4-Tacks
918d3b8175
Migrate replace_arith_op assist to use SyntaxEditor
2025-09-26 16:54:47 +08:00
Shoyu Vanilla (Flint)
6135c07683
Merge pull request #20611 from A4-Tacks/replace-arith-op-prec
...
Fix precedence parenthesis for replace_arith_op
2025-09-26 08:30:46 +00:00
Shoyu Vanilla (Flint)
084c1e537d
Merge pull request #20604 from A4-Tacks/cfg-attr-comp
...
Add cfg_attr predicate completion
2025-09-26 08:10:25 +00:00
Shoyu Vanilla (Flint)
a55e2b578c
Merge pull request #20729 from A4-Tacks/const-param-kwd
...
Add const parameter keyword completion
2025-09-26 07:00:52 +00:00
Shoyu Vanilla (Flint)
e81202c919
Merge pull request #20731 from A4-Tacks/expand-rest-pat-in-tuple-slice-pat
...
Fix expand rest pattern in tuple and slice pattern
2025-09-26 06:54:30 +00:00
A4-Tacks
6d85fd739f
Fix expand rest pattern in tuple and slice pattern
...
Assist: expand_tuple_rest_pattern
Fills fields by replacing rest pattern in tuple patterns.
Example
---
```
fn foo(bar: (char, i32, i32)) {
let (ch, ..$0) = bar;
}
```
->
```
fn foo(bar: (char, i32, i32)) {
let (ch, _1, _2) = bar;
}
```
---
Assist: expand_slice_rest_pattern
Fills fields by replacing rest pattern in slice patterns.
Example
---
```
fn foo(bar: [i32; 3]) {
let [first, ..$0] = bar;
}
```
->
```
fn foo(bar: [i32; 3]) {
let [first, _1, _2] = bar;
}
```
2025-09-26 14:44:05 +08:00
Shoyu Vanilla (Flint)
997f3ec544
Merge pull request #20598 from A4-Tacks/let-chain-sup-conv-to-guarded-ret
...
Add let-chain support for convert_to_guarded_return
2025-09-26 06:42:10 +00:00
Shoyu Vanilla (Flint)
a96d92e9e9
Merge pull request #20736 from A4-Tacks/fix-invert-if-let-chain
...
Fix applicable on if-let-chain for invert_if
2025-09-26 05:36:52 +00:00
Shoyu Vanilla (Flint)
750d566106
Merge pull request #20742 from A4-Tacks/unused-raw-var
...
Fix fixes for unused raw variables
2025-09-26 05:25:09 +00:00
A4-Tacks
3964af7bf6
Add applicable in closure for convert_to_guarded_return
...
Example
---
```rust
fn main() {
let _f = || {
bar();
if$0 true {
foo();
// comment
bar();
}
}
}
```
->
```rust
fn main() {
let _f = || {
bar();
if false {
return;
}
foo();
// comment
bar();
}
}
```
2025-09-25 22:04:53 +08:00
A4-Tacks
4e3b6b38dd
Fix not applicable for if-expr in let-stmt
...
Example
---
```rust
fn main() {
let _x = loop {
if$0 let Ok(x) = Err(92) {
foo(x);
}
};
}
```
**Before**:
Assist not applicable
**After**:
```rust
fn main() {
let _x = loop {
let Ok(x) = Err(92) else { continue };
foo(x);
};
}
```
2025-09-25 22:00:56 +08:00
A4-Tacks
a98da9f795
Add let-chain support for convert_to_guarded_return
...
- And add early expression `None` in function `Option` return
Example
---
```rust
fn main() {
if$0 let Ok(x) = Err(92)
&& x < 30
&& let Some(y) = Some(8)
{
foo(x, y);
}
}
```
->
```rust
fn main() {
let Ok(x) = Err(92) else { return };
if x >= 30 {
return;
}
let Some(y) = Some(8) else { return };
foo(x, y);
}
```
2025-09-25 21:04:48 +08:00
A4-Tacks
4353624cc0
Fix fixes for unused raw variables
...
Example
---
```
fn main() {
let $0r#type = 2;
}
```
**Before this PR**:
```rust
fn main() {
let _r#type = 2;
}
```
**After this PR**:
```rust
fn main() {
let _type = 2;
}
```
2025-09-25 19:58:45 +08:00
Shoyu Vanilla (Flint)
84e87d5bba
Merge pull request #20738 from jackh726/next-trait-solver-next4
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Remove non-ns version of impl_self_ty and impl_trait
2025-09-25 10:30:54 +00:00
Shoyu Vanilla (Flint)
7ae5f2df12
Merge pull request #20735 from itsjunetime/fix_scip_salsa
...
fix SCIP panicking due to salsa not attaching
2025-09-25 10:30:12 +00:00
The rustc-josh-sync Cronjob Bot
f69f3a6e01
Merge ref 'caccb4d0368b' from rust-lang/rust
...
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: caccb4d0368bd918ef6668af8e13834d07040417
Filtered ref: 0f345ed05d
Upstream diff: 21a19c297d...caccb4d036
This merge was created using https://github.com/rust-lang/josh-sync .
2025-09-25 04:16:26 +00:00
itsjunetime
01b2eff275
fix SCIP panicking due to salsa not attaching
2025-09-24 18:47:36 -05:00
Chayim Refael Friedman
6b133c6b1b
Implement fallback properly
...
fallback.rs was ported straight from rustc (minus the lint parts).
This fixes the `!` regressions.
2025-09-24 20:42:06 +03:00
Chayim Refael Friedman
993db83afd
Merge pull request #20683 from regexident/inference-result-types-iter
...
Expose iterators over an inference result's types
2025-09-24 17:12:33 +00:00
Shoyu Vanilla
fbfb2617ad
Switch next-solver related rustc dependencies of r-a to crates.io ones
2025-09-24 21:28:50 +09:00
A4-Tacks
39ef6c28eb
Fix applicable on if-let-chain for invert_if
...
Example
---
```rust
fn f() { i$0f x && let Some(_) = Some(1) { 1 } else { 0 } }
```
**Before this PR**:
```rust
fn f() { if !(x && let Some(_) = Some(1)) { 0 } else { 1 } }
```
**After this PR**:
Assist not applicable
2025-09-24 14:36:09 +08:00
jackh726
6a458880fd
Remove non-ns version of impl_self_ty and impl_trait
2025-09-24 05:45:12 +00:00
Shoyu Vanilla (Flint)
4d4a1dd464
Merge pull request #20733 from jackh726/next-trait-solver-next3
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Convert more things from chalk to next solver
2025-09-24 04:52:28 +00:00
Jack Huey
7a6df720c4
Be sure to instantiate and pass up trait refs in named_associated_type_shorthand_candidates
2025-09-23 16:27:04 -04:00
Jack Huey
ea48563951
Remove all non-ns diagnostics queries, naming consistenly
2025-09-23 16:27:03 -04:00
Jack Huey
cc7c061e34
Use lower_nextsolver::callable_item_signature instead of lower::callable_item_signature
2025-09-23 16:26:46 -04:00
Shoyu Vanilla (Flint)
905641f352
Merge pull request #20543 from sgasho/fix/19443_replace_match_with_if_let
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix "Replace match with if let" not to trigger when invalid transformations occur
2025-09-23 09:46:37 +00:00
Vincent Esche
7e9abceee7
Expose iterators over an inference result's types
...
(This re-introduces a reduced access to a couple of previously public fields on `InferenceResult`)
2025-09-23 11:39:40 +02:00
Jack Huey
73a401301d
Remove lower::value_ty in favor of lower_nextsolver::value_ty
2025-09-23 03:58:51 -04:00
Jack Huey
3089d23710
Remove lower::ty in favor of lower_nextsolver::ty
2025-09-23 03:58:51 -04:00
Shoyu Vanilla (Flint)
f6cf3035c3
Merge pull request #20730 from A4-Tacks/migrate-expand-rest-pat
...
Migrate `expand_record_rest_pattern` assist to use `SyntaxEditor`
2025-09-23 07:05:22 +00:00
A4-Tacks
258776b63a
Migrate expand_record_rest_pattern assist to use SyntaxEditor
...
Because `add_field` uses `ted`
2025-09-23 12:14:14 +08:00
A4-Tacks
b39c7a892f
Add const parameter keyword completion
...
Example
---
```rust
fn foo<c$0>() {}
```
->
```rust
fn foo<const $1: $0>() {}
```
2025-09-23 11:26:52 +08:00
Jack Huey
34f773f596
Use ParamEnv in TraitEnvironment
2025-09-23 00:04:57 +00:00
Jack Huey
c2513538cd
Add 'db to TraitEnvironment
2025-09-23 00:04:57 +00:00
jackh726
7b9ad945ec
Make Field::ty return TypeNs
2025-09-23 00:04:56 +00:00
jackh726
839645b4de
Use ns versions of with_diagnostics queries
2025-09-22 21:50:12 +00:00
Shoyu Vanilla (Flint)
d05355db16
Merge pull request #20592 from A4-Tacks/add-braces-closure-in-match
...
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix closure in match not applicable for add_braces
2025-09-22 15:51:12 +00:00
Shoyu Vanilla (Flint)
c1499a2381
Merge pull request #20679 from A4-Tacks/no-comp-ty-in-nested-pat
...
Fix complete type in nested pattern
2025-09-22 15:37:39 +00:00
Shoyu Vanilla (Flint)
d6e14cc457
Merge pull request #20722 from A4-Tacks/pull-assign-up-inner-if
...
Fix apply in inner if for pull_assignment_up
2025-09-22 15:31:10 +00:00
Shoyu Vanilla (Flint)
b465ae054a
Merge pull request #20723 from A4-Tacks/fix-bind-unused-applicable-underscore
...
Fix applicable on underscore for bind_unused_param
2025-09-22 15:29:47 +00:00
Shoyu Vanilla (Flint)
3249fc76b2
Merge pull request #20725 from ChayimFriedman2/fix-missing-lifetime
...
fix: Fix lifetime elision handling for `Fn`-style trait bounds
2025-09-22 15:21:19 +00:00
Chayim Refael Friedman
7d9af9f6a5
Merge pull request #20717 from ShoyuVanilla/migrate-more
...
internal: Migrate more predicate things to next-solver
2025-09-22 14:55:32 +00:00
Shoyu Vanilla
0a5457a392
internal: Migrate more predicate things to next-solver
2025-09-22 23:44:50 +09:00
Chayim Refael Friedman
ad9422da1a
Fix lifetime elision handling for Fn-style trait bounds
...
Two fixes were needed:
1. Previously, we enabled elision for the generic args of `Fn` itself, instead of for generic args of paths within it.
2. In lowering in the new solver the `Output` parameter did not have elision set correctly, I don't know why. In the old lowering it was done correctly.
2025-09-22 16:53:20 +03:00
Chayim Refael Friedman
83981c14aa
Merge pull request #20724 from ChayimFriedman2/ns-cleanup3
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
minor: Another regression test for next solver fixed bug
2025-09-22 07:36:56 +00:00
Chayim Refael Friedman
d5f597e726
Another regression test for next solver fixed bug
2025-09-22 10:26:03 +03:00