Commit Graph

321633 Commits

Author SHA1 Message Date
Jonathan Brouwer 08ff97ab2d Rollup merge of #154241 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/b42b63f390a4dab14e6efa34a70e67f5b087cc62.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-23 12:00:56 +01:00
bors bbe8536158 Auto merge of #154217 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/ef444b33426c326cdb216da335ca9224b77f19e9.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-23 04:12:57 +00:00
Chayim Refael Friedman c9a65cffad Merge pull request #21795 from Wilfred/fix_unit_test_rust_project
internal: Fix test_loading_rust_analyzer when rust-project.json is present
2026-03-22 23:15:25 +00:00
Chayim Refael Friedman a022c19665 Merge pull request #21851 from rust-lang/dependabot/npm_and_yarn/editors/code/flatted-3.4.2
Bump flatted from 3.3.3 to 3.4.2 in /editors/code
2026-03-22 22:54:43 +00:00
Chayim Refael Friedman 7606287b37 Merge pull request #21809 from A4-Tacks/extract-const-like-path-expr
fix: offer on const like path-expr for 'extract_variable'
2026-03-22 22:53:51 +00:00
Chayim Refael Friedman 0087e3e289 Merge pull request #21473 from A4-Tacks/unwrap-let-else-block
Add applicable on let-else branch for unwrap_block
2026-03-22 21:40:50 +00:00
Chayim Refael Friedman c070408539 Merge pull request #21424 from cormacrelf/support-more-runnable-kinds
Support more runnable kinds in project JSON
2026-03-22 21:38:17 +00:00
Chayim Refael Friedman 470b72523d Merge pull request #21423 from cormacrelf/project-json-compatibility
Project json compatibility improvements
2026-03-22 21:27:49 +00:00
Chayim Refael Friedman 9e22fa42f2 Merge pull request #21395 from dfireBird/push-sqrmpnzrzwpt
feat: change test_name placeholder to executable_arg
2026-03-22 21:24:07 +00:00
Chayim Refael Friedman a7f691e694 Merge pull request #21324 from A4-Tacks/dedent-dot-comp-snippet
Fix postfix completion indentation compensation
2026-03-22 21:09:53 +00:00
Chayim Refael Friedman 9d74e3c135 Merge pull request #20984 from A4-Tacks/add-label-while-for
Support WhileExpr and ForExpr for add_label_to_loop
2026-03-22 19:12:52 +00:00
Chayim Refael Friedman bbec9ac9c0 Merge pull request #20762 from A4-Tacks/non-exhaustive-let-fixes
Add fixes for non_exhaustive_let diagnostic
2026-03-22 18:57:15 +00:00
Chayim Refael Friedman 6eb75b7498 Merge pull request #20628 from A4-Tacks/add-lifetime-for-infer
Add nested lifetime support for add_lifetime_to_type
2026-03-22 18:49:50 +00:00
Ralf Jung b584d4d668 update lockfile 2026-03-22 17:17:56 +01:00
Ralf Jung cdca978e23 Merge pull request #4892 from WhySoBad/network-socket-io-polling
Handle blocking I/O using Mio, add `accept` and `connect` network socket shims
2026-03-22 12:57:54 +00:00
WhySoBad d7706e59a8 Add blocking I/O manager, socket accept and connect shims
Integrates mio into the scheduler to block threads for external I/O
events (like blocking socket operations)
2026-03-22 13:19:51 +01:00
A4-Tacks bde4008d7f Merge pull request #21854 from Amit5601/remove-mut-tree-demorgan
internal: Remove clone_for_update from apply_demorgan
2026-03-22 11:21:41 +00:00
Ralf Jung f3d49c8d1d Merge pull request #4914 from RalfJung/uname
Add a shim for uname systemcall
2026-03-22 11:13:02 +00:00
Amit5601 f1c710b4ce internal: Remove clone_for_update from apply_demorgan.rs 2026-03-22 16:24:02 +05:30
Ralf Jung 067558dc5c check size field on freebsd and other tweaks 2026-03-22 11:29:32 +01:00
Thomas de Zeeuw 9a021da8db Add a shim for uname systemcall 2026-03-22 11:27:51 +01:00
bors 562dee4820 Auto merge of #154122 - Zalathar:no-anon, r=nnethercote
Remove the `anon` query modifier



Prior experiments:
- https://github.com/rust-lang/rust/pull/152268
- https://github.com/rust-lang/rust/pull/153996

[Zulip thread: *Removing the `anon` query modifier*](https://rust-lang.zulipchat.com/#narrow/channel/582699-t-compiler.2Fquery-system/topic/Removing.20the.20.60anon.60.20query.20modifier/with/580760962)

---

There are currently three queries that use the `anon` modifier:
- `check_representability`
- `check_representability_adt_ty`
- `erase_and_anonymize_regions_ty`

It seems that none of them are using `anon` in an essential way.

According to comments and tests, the *representability* queries mainly care about not being eligible for forcing (despite having a recoverable key type), so that if a cycle does occur then the entire cycle will be on the query stack. Replacing `anon` with a new `no_force` modifier gives a modest perf improvement.

The `erase_and_anonymize_regions_ty` query appears to be using `anon` to reduce the dep-graph overhead of a query that is expected to not call any other queries (and thus have no dependencies). Replacing `anon` with either `no_hash` or nothing appears to give only a very small perf hit on `cargo` benchmarks, which is justified by the fact that it lets us remove a lot of machinery for anonymous queries.

We still need to retain some of the machinery for anonymous *tasks*, because the non-query task `DepKind::TraitSelect` still uses it.

---

I have some ideas for a follow-up that will reduce dep-graph overhead by replacing *all* zero-dependency nodes with a singleton node, but I want to keep that separate in case it causes unexpected issues and needs to be bisected or reverted.
2026-03-21 21:53:47 +00:00
bors 20f19f4615 Auto merge of #154176 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? Manishearth 

2 days late as I didn't get to it during the week.
2026-03-21 13:42:07 +00:00
Philipp Krones 36e06ebb21 Merge commit '256c21c543ca422b3ab8810a0d081d722408e896' into clippy-subtree-update 2026-03-21 14:13:09 +01:00
A4-Tacks 77aac00fc8 Merge pull request #21817 from A4-Tacks/conv-struct-to-tuple-uses-self
fix: Fix overlap edit on record to tuple assist uses self
2026-03-21 12:47:18 +00:00
Philipp Krones 256c21c543 Rustup (#16740)
r? @ghost

changelog: none
2026-03-21 12:45:54 +00:00
Philipp Krones e191c9429e Bump nightly version -> 2026-03-21 2026-03-21 13:40:35 +01:00
Philipp Krones 1e283ba0ce Merge remote-tracking branch 'upstream/master' into rustup 2026-03-21 13:40:20 +01:00
bors 7218b7fa17 Auto merge of #153768 - zetanumbers:consistent-par-slice, r=JohnTitor,Zoxc
Make `par_slice` consistent with single-threaded execution



rust-lang/rust#152375 removed this consistency by switching from order preserving join to scope, which does not preserve order as stated in `par_fns` as well. This also makes `par_slice` behavior consistent with `par_fns`.
2026-03-21 10:31:17 +00:00
dependabot[bot] 1a05c119c2 Bump flatted from 3.3.3 to 3.4.2 in /editors/code
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2.
- [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-21 10:29:56 +00:00
A4-Tacks 734914e8a0 Merge pull request #21850 from A4-Tacks/add-braces-bin-expr
feat: offer 'add_braces' on bin-expr assignment
2026-03-21 10:10:11 +00:00
A4-Tacks dc8d64dbd4 feat: offer 'add_braces' on bin-expr assignment
Example
---
```rust
fn foo() {
    let x;
    x =$0 n + 100;
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn foo() {
    let x;
    x = {
        n + 100
    };
}
```
2026-03-21 16:36:07 +08:00
A4-Tacks 9bff35bd80 add tests for let-expr in add_braces 2026-03-21 16:35:47 +08:00
Amit Singhmar c1a24b4a9c ide-assists: add tests for const, static in add_braces 2026-03-21 16:27:50 +08:00
A4-Tacks ed0a99f476 Merge pull request #21832 from Shourya742/2026-03-04-add-mapping-to-constructor-method
Add mapping to syntax factory constructor methods
2026-03-21 08:11:38 +00:00
bors e52f547ed4 Auto merge of #154160 - JonathanBrouwer:rollup-4jbkEbt, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#154154 (Emit fewer errors for incorrect rtn and `=` -> `:` typos in bindings)
 - rust-lang/rust#154155 (tests/ui/async-await/drop-option-future.rs: New regression test)
 - rust-lang/rust#146961 (Allow passing `expr` metavariable as `cfg` predicate)
 - rust-lang/rust#154118 (don't suggest non-deriveable traits for unions)
 - rust-lang/rust#154120 (Start migrating `DecorateDiagCompat::Builtin` items to `DecorateDiagCompat::Dynamic`)
 - rust-lang/rust#154156 (Moving issue-52049 to borrowck)
2026-03-21 07:20:47 +00:00
Daria Sukhonina 50c564e679 Make par_slice consistent with single-threaded execution 2026-03-21 08:23:42 +03:00
bors 44e662074f Auto merge of #154148 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

14 commits in cbb9bb8bd0fb272b1be0d63a010701ecb3d1d6d3..e84cb639edfea2c42efd563b72a9be0cc5de6523
2026-03-13 14:34:16 +0000 to 2026-03-21 01:27:07 +0000
- Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16775)
- cargo clean: Validate that target_dir is not a file  (rust-lang/cargo#16765)
- fix: fetching non-standard git refspecs on non-github repos (rust-lang/cargo#16768)
- Update tar to 0.4.45 (rust-lang/cargo#16771)
- chore: Remove edition_lint_opts from Lint (rust-lang/cargo#16762)
- refactor: split out several smaller changes to prepare for async http (rust-lang/cargo#16763)
- fix(compile): Make build.warnings ignore non-local deps (rust-lang/cargo#16760)
- fix: detect circular publish dependency cycle in workspace publish (rust-lang/cargo#16722)
- refactor(shell): Pull out term integration into `anstyle-progress` (rust-lang/cargo#16757)
- test: reproduce rustfix panic on overlapping suggestions (rust-lang/cargo#16705)
- fix: Avoid panic for package specs with an empty fragment (rust-lang/cargo#16754)
- refactor(registry): avoid dynamic dispatch for Registry trait (rust-lang/cargo#16752)
- refactor(shell): Pull out hyperlink logic into anstyle-hyperlink (rust-lang/cargo#16749)
- refactor(install): Remove dead code (rust-lang/cargo#16718)
2026-03-21 04:11:42 +00:00
Zalathar 3a62e89822 Remove the anon query modifier
We still have some anon-task machinery for `DepKind::TraitSelect` tasks, but
there are no longer any queries that use the `anon` modifier.
2026-03-21 14:22:10 +11:00
Zalathar 0dfce4d268 Don't use anon for query erase_and_anonymize_regions_ty
According to its comment, this query was only using `anon` to save a little bit
of work for a dep graph node that is expected to have no dependencies.

Benchmarks indicate that the perf loss, if any, is small enough to be justified
by the fact that we can now remove support for `anon` queries.

Adding `no_hash` appears to give marginally better perf results.
2026-03-21 14:22:10 +11:00
Zalathar 70f3e09225 Always call check_representability with tcx.ensure_ok()
This was previously not possible because `check_representability` was `anon`.
2026-03-21 14:22:10 +11:00
Zalathar dbdbf09586 Use a new no_force query modifier for check_representability
These queries appear to have been using `anon` for its side-effect of making
them ineligible for forcing.

According to their comments and also `tests/incremental/issue-61323.rs`, these
queries want to avoid forcing so that if a cycle does occur, the whole cycle
will be on the query stack for the cycle handler to find.
2026-03-21 14:22:10 +11:00
Zalathar 193309e1c3 Sort query modifier names in doc_link! 2026-03-21 14:11:24 +11:00
Weihang Lo 01ea06bfd3 Update cargo submodule 2026-03-20 23:05:00 -04:00
Jonathan Brouwer 6d2a545c09 Rollup merge of #154156 - aryannrd:move-issue-52049-to-borrowck, r=Kivooeo
Moving issue-52049 to borrowck
2026-03-21 00:42:49 +01:00
Jonathan Brouwer 84cb74ad9a Rollup merge of #154120 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Start migrating `DecorateDiagCompat::Builtin` items to `DecorateDiagCompat::Dynamic`

Part of https://github.com/rust-lang/rust/issues/153099.

End goal being to completely remove the two steps currently required by `DecorateDiagCompat::Builtin` and remove duplicated types.

r? @JonathanBrouwer
2026-03-21 00:42:48 +01:00
Jonathan Brouwer 70d1c586ce Rollup merge of #154118 - malezjaa:dont-suggest-some-traits-for-unions, r=JonathanBrouwer
don't suggest non-deriveable traits for unions

Fixes rust-lang/rust#137587

Before, the compiler suggested adding `#[derive(Debug)]` (other traits too) for unions,
which is misleading because some traits can't be automatically derived.

Only traits that are still suggested are Copy and Clone.

I noticed the error label changed after removing the suggestion. I hope this isn't a big deal, but let me know if that's an issue.

original example:
```rs
union Union {
    member: usize,
}

impl PartialEq<u8> for Union {
    fn eq(&self, rhs: &u8) -> bool {
        unsafe { self.member == (*rhs).into() }
    }
}

fn main() {
    assert_eq!(Union { member: 0 }, 0);
}
```

before:
```
error[E0277]: `Union` doesn't implement `Debug`
  --> src\main.rs:13:5
   |
13 |     assert_eq!(Union { member: 0 }, 0);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for `Union`
   |
   = note: add `#[derive(Debug)]` to `Union` or manually `impl Debug for Union`
   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Union` with `#[derive(Debug)]`
   |
 2 + #[derive(Debug)]
 3 | union Union {
   |
```

after (the message doesn't suggest adding #[derive(Debug)] to unions)
```
error[E0277]: `Union` doesn't implement `Debug`
  --> src\main.rs:13:5
   |
13 |     assert_eq!(Union { member: 0 }, 0);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the trait `Debug` is not implemented for `Union`
  --> src\main.rs:2:1
   |
 2 | union Union {
   | ^^^^^^^^^^^
   = note: manually `impl Debug for Union`
```
2026-03-21 00:42:48 +01:00
Jonathan Brouwer b9f8e25f6e Rollup merge of #146961 - Jules-Bertholet:expr-cfg, r=JonathanBrouwer
Allow passing `expr` metavariable as `cfg` predicate

This PR allows expanding `expr` metavariables inside the configuration predicates of `cfg` and `cfg_attr` invocations.
For example, the following code will now compile:

```rust
macro_rules! mac {
    ($e:expr) => {
        #[cfg_attr($e, inline)]
        #[cfg($e)]
        fn func() {}

        #[cfg(not($e))]
        fn func() {
            panic!()
        }
    }
}

mac!(any(unix, feature = "foo"));
```

There is currently no `macro_rules` fragment specifier that can represent all valid `cfg` predicates. `meta` comes closest, but excludes `true` and `false`. By fixing that, this change makes it easier to write declarative macros that parse `cfg` or `cfg_attr` invocations, for example https://github.com/rust-lang/rust/pull/146281/.

@rustbot label T-lang needs-fcp A-attributes A-cfg A-macros
2026-03-21 00:42:47 +01:00
Jonathan Brouwer 6a7aaf97b5 Rollup merge of #154155 - Enselic:async-test, r=mati865
tests/ui/async-await/drop-option-future.rs: New regression test

The test began compiling with `nightly-2022-11-25`. I bisected it further, and the commit that made it compile was 9f36f988ad (rust-lang/rust#104321). The test fails to compile with `nightly-2022-11-24`:

    $ rustc +nightly-2022-11-24 --edition 2018 tests/ui/async-await/drop-option-future.rs
    error[E0597]: `value` does not live long enough
      --> tests/ui/async-await/drop-option-future.rs:12:22
       |
    12 |     f = Some(async { value });
       |                    --^^^^^--
       |                    | |
       |                    | borrowed value does not live long enough
       |                    value captured here by generator
    13 |     core::mem::drop(f);
    14 | }
       | -
       | |
       | `value` dropped here while still borrowed
       | borrow might be used here, when `f` is dropped and runs the destructor for type `Option<impl Future<Output = i32>>`

The fix 9f36f988ad does not appear to affect or include a regression test for the rust-lang/rust#98077 case, so let's add that test.

Closes rust-lang/rust#98077 since we add the test from that issue.
2026-03-21 00:42:47 +01:00
Jonathan Brouwer edf808b524 Rollup merge of #154154 - estebank:issue-134087, r=mati865
Emit fewer errors for incorrect rtn and `=` -> `:` typos in bindings

Make all existing `:` -> `=` typo suggestions verbose and tweak the suggested code.

Stash parse errors when pasing rtn that doesn't use `(..)`.

Emit single error on `Foo::bar(qux)` that looks like rtn in incorrect position and suggest `Foo::bar(..)`.
```
error: return type notation not allowed in this position yet
  --> $DIR/let-binding-init-expr-as-ty.rs:18:10
   |
LL | struct K(S::new(()));
   |          ^^^^^^^^^^
   |
help: furthermore, argument types not allowed with return type notation
   |
LL - struct K(S::new(()));
LL + struct K(S::new(..));
   |
```
On incorrect rtn in let binding type for an existing inherent associated function, suggest `:` -> `=` to turn the "type" into a call expression. (Fix rust-lang/rust#134087)
```
error: expected type, found associated function call
  --> $DIR/let-binding-init-expr-as-ty.rs:29:12
   |
LL |     let x: S::new(());
   |            ^^^^^^^^^^
   |
help: use `=` if you meant to assign
   |
LL -     let x: S::new(());
LL +     let x = S::new(());
   |
```
2026-03-21 00:42:46 +01:00