35033 Commits

Author SHA1 Message Date
Lukas Wirth
3ee81c7115 fix: Temporarily disable + typing handler as it moves the cursor position 2025-06-19 08:29:50 +02:00
Laurențiu Nicola
6807f60ccd
Merge pull request #20032 from lnicola/sync-from-rust
minor: Sync from downstream
2025-06-18 07:06:44 +00:00
Laurențiu Nicola
54fcca7cdd Merge from rust-lang/rust 2025-06-18 09:23:24 +03:00
Laurențiu Nicola
05d286019e Preparing for merge from rust-lang/rust 2025-06-18 09:23:00 +03:00
bors
b4d1f20159 Auto merge of #130887 - Soveu:repeatn, r=scottmcm
Safer implementation of RepeatN

I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs.

Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`.
This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
2025-06-18 03:18:10 +00:00
bors
f0a4d181c0 Auto merge of #142644 - jhpratt:rollup-f2jed9t, r=jhpratt
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#141574 (impl `Default` for `array::IntoIter`)
 - rust-lang/rust#141608 (Add support for repetition to `proc_macro::quote`)
 - rust-lang/rust#142100 (rustdoc: make srcIndex no longer a global variable)
 - rust-lang/rust#142371 (avoid `&mut P<T>` in `visit_expr` etc methods)
 - rust-lang/rust#142517 (Windows: Use anonymous pipes in Command)
 - rust-lang/rust#142520 (alloc: less static mut + some cleanup)
 - rust-lang/rust#142588 (Generic ctx imprv)
 - rust-lang/rust#142605 (Don't unwrap in enzyme builds in case of missing llvm-config)
 - rust-lang/rust#142608 (Refresh module-level docs for `rustc_target::spec`)
 - rust-lang/rust#142618 (Lint about `console` calls in rustdoc JS)
 - rust-lang/rust#142620 (Remove a panicking branch in `BorrowedCursor::advance`)
 - rust-lang/rust#142631 (Dont suggest remove semi inside macro expansion for redundant semi lint)
 - rust-lang/rust#142632 (Update cargo)
 - rust-lang/rust#142635 (Temporarily add back -Zwasm-c-abi=spec)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-18 00:17:48 +00:00
Jacob Pratt
4cfd658a6c
Rollup merge of #142618 - GuillaumeGomez:eslint-no-console, r=lolbinarycat
Lint about `console` calls in rustdoc JS

As discussed [here](https://github.com/rust-lang/rust/pull/142100#discussion_r2151764395), this PR enforces that `console` is not used in rustdoc JS by default.

cc `@lolbinarycat`
2025-06-17 23:19:38 +02:00
Jacob Pratt
db52a345ff
Rollup merge of #142588 - ZuseZ4:generic-ctx-imprv, r=oli-obk
Generic ctx imprv

Cleanup work for my gpu pr

r? `@oli-obk`
2025-06-17 23:19:36 +02:00
Jacob Pratt
7581d85b6f
Rollup merge of #142520 - hkBst:less-static-mut, r=tgross35
alloc: less static mut + some cleanup

I'm looking into https://github.com/rust-lang/rust/issues/125035 and would like some feedback on my approach.
2025-06-17 23:19:35 +02:00
Jacob Pratt
c09199703b
Rollup merge of #142517 - ChrisDenton:anon-pipe, r=Mark-Simulacrum
Windows: Use anonymous pipes in Command

When setting `Stdio::pipe` on `Command` we want to create an anonymous pipe that can be used asynchronously (at least on our end). Usually we'd use [`CreatePipe`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe) to open anonymous pipes but unfortunately it opens pipes for synchronous access. The alternative is to use [`CreateNamedPipeW`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createnamedpipew) which does allow asynchronous access but that requires giving a file name to the pipe. So we currently have this awful hack where we attempt to emulate anonymous pipes using `CreateNamedPipeW` by attempting to create a unique name and looping until we find one that doesn't already exist.

The better option is to use the lower level [`NtCreateNamedPipeFile`](https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file) (which is used internally by both `CreatePipe` and `CreateNamedPipeW`). This function wasn't documented until a few years ago but now that it is it's ok for us to use it.

try-job: *msvc*
try-job: *mingw*
2025-06-17 23:19:34 +02:00
Jacob Pratt
e84c22501b
Rollup merge of #142371 - fee1-dead-contrib:push-xqlkumzurkus, r=petrochenkov
avoid `&mut P<T>` in `visit_expr` etc methods

trying a different way than rust-lang/rust#141636
r? ghost
2025-06-17 23:19:34 +02:00
Jacob Pratt
8b318c3fe0
Rollup merge of #141608 - moatom:proc_macro-140238, r=dtolnay
Add support for repetition to `proc_macro::quote`

Progress toward: rust-lang/rust#140238
2025-06-17 23:19:32 +02:00
Jacob Pratt
920d4e83cc
Rollup merge of #141574 - fee1-dead-contrib:push-owzulzmzszzx, r=jhpratt
impl `Default` for `array::IntoIter`

cc rust-lang/rust#91583

my personal use of this feature comes from 092db5df63/src/cont.rs (L154-L170)

insta-stable, but I feel like this is small enough to _not_ require an ACP (but a FCP per https://forge.rust-lang.org/libs/maintaining-std.html#when-theres-new-trait-impls)? feel free to correct me if I am wrong.
2025-06-17 23:19:31 +02:00
bors
01ccbcf4a8 Auto merge of #142567 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-17 21:13:37 +00:00
Laurențiu Nicola
10ebd0e3c9 Try to downgrade object 2025-06-17 19:00:01 +03:00
Laurențiu Nicola
5d93e31067
Merge pull request #20025 from SoxPopuli/hide_private_imports_without_pe
Hide imported privates if private editable is disabled
2025-06-17 15:27:27 +00:00
bors
50a90e2920 Auto merge of #137944 - davidtwco:sized-hierarchy, r=oli-obk
Sized Hierarchy: Part I

This patch implements the non-const parts of rust-lang/rfcs#3729. It introduces two new traits to the standard library, `MetaSized` and `PointeeSized`. See the RFC for the rationale behind these traits and to discuss whether this change makes sense in the abstract.

These traits are unstable (as is their constness), so users cannot refer to them without opting-in to `feature(sized_hierarchy)`. These traits are not behind `cfg`s as this would make implementation unfeasible, there would simply be too many `cfg`s required to add the necessary bounds everywhere. So, like `Sized`, these traits are automatically implemented by the compiler.

RFC 3729 describes changes which are necessary to preserve backwards compatibility given the introduction of these traits, which are implemented and as follows:

- `?Sized` is rewritten as `MetaSized`
- `MetaSized` is added as a default supertrait for all traits w/out an explicit sizedness supertrait already.

There are no edition migrations implemented in this,  as these are primarily required for the constness parts of the RFC and prior to stabilisation of this (and so will come in follow-up PRs alongside the const parts). All diagnostic output should remain the same (showing `?Sized` even if the compiler sees `MetaSized`) unless the `sized_hierarchy` feature is enabled.

Due to the use of unstable extern types in the standard library and rustc, some bounds in both projects have had to be relaxed already - this is unfortunate but unavoidable so that these extern types can continue to be used where they were before. Performing these relaxations in the standard library and rustc are desirable longer-term anyway, but some bounds are not as relaxed as they ideally would be due to the inability to relax `Deref::Target` (this will be investigated separately).

It is hoped that this is implemented such that it could be merged and these traits could exist "under the hood" without that being observable to the user (other than in any performance impact this has on the compiler, etc). Some details might leak through due to the standard library relaxations, but this has not been observed in test output.

**Notes:**

- Any commits starting with "upstream:" can be ignored, as these correspond to other upstream PRs that this is based on which have yet to be merged.
- This best reviewed commit-by-commit. I've attempted to make the implementation easy to follow and keep similar changes and test output updates together.
  - Each commit has a short description describing its purpose.
  - This patch is large but it's primarily in the test suite.
- I've worked on the performance of this patch and a few optimisations are implemented so that the performance impact is neutral-to-minor.
- `PointeeSized` is a different name from the RFC just to make it more obvious that it is different from `std::ptr::Pointee` but all the names are yet to be bikeshed anyway.
- `@nikomatsakis` has confirmed [that this can proceed as an experiment from the t-lang side](https://rust-lang.zulipchat.com/#narrow/channel/435869-project-goals/topic/SVE.20and.20SME.20on.20AArch64.20.28goals.23270.29/near/506196491)
- FCP in https://github.com/rust-lang/rust/pull/137944#issuecomment-2912207485

Fixes rust-lang/rust#79409.

r? `@ghost` (I'll discuss this with relevant teams to find a reviewer)
2025-06-17 15:08:50 +00:00
Charlotte Smith
e6a4602209 Hide imported privates if private editable is disabled 2025-06-17 15:38:15 +01:00
Lukas Wirth
3bf8a77d13
Merge pull request #20023 from Veykril/push-vkqlnyttnqzl
Improve completions in if / while expression conditions
2025-06-17 12:01:43 +00:00
Lukas Wirth
7447db83ed Better completion test sorting 2025-06-17 13:50:58 +02:00
Lukas Wirth
4331688e3d Improve completions in if / while expression conditions 2025-06-17 13:50:58 +02:00
Lukas Wirth
630628f3c8
Merge pull request #20022 from ChayimFriedman2/type-mismatch-exp
fix: Never make type mismatch diagnostic stable, even when there is a fix
2025-06-17 09:59:50 +00:00
Chayim Refael Friedman
b46593ece2 Never make type mismatch diagnostic stable, even when there is a fix
We show fixes now even for experimental diagnostics anyway, and it has false positives.
2025-06-17 12:48:19 +03:00
Lukas Wirth
2b0c726e1b
Merge pull request #20020 from Veykril/push-yuqmorzsqumw
fix: Reload workspaces when cargo configs change
2025-06-17 09:24:13 +00:00
Lukas Wirth
24b0666d93 fix: Reload workspaces when cargo configs change 2025-06-17 11:13:56 +02:00
Lukas Wirth
c6b74f7e6f
Merge pull request #19495 from Veykril/push-woywmrxrtqqy
chore: Start infesting ide crates with 'db lifetime
2025-06-17 08:53:11 +00:00
Lukas Wirth
03f1003637 chore: Start infesting ide crates with 'db lifetime 2025-06-17 10:42:38 +02:00
Lukas Wirth
a31e10a2fd
Merge pull request #20018 from Veykril/push-pkowrtoturkr
fix: Copy lockfiles into target directory before invoking `cargo metadata`
2025-06-17 08:20:20 +00:00
Lukas Wirth
8661c59a7f
Merge pull request #19939 from ChayimFriedman2/fill-arms-self
feat: In "Fill match arms", allow users to prefer `Self` to the enum name when possible
2025-06-17 08:20:02 +00:00
Lukas Wirth
eb25f5e85b
Merge pull request #19945 from ChayimFriedman2/private-field-quickfix
feat: Add the quickfix for increasing visibility of a private field to the private-field diagnostic (previously it was only on no-such-field)
2025-06-17 08:19:09 +00:00
Lukas Wirth
c0f428d55b fix: Copy lockfiles into target directory before invoking cargo metadata 2025-06-17 10:09:04 +02:00
bors
dae444f3ce Auto merge of #142447 - dianqk:llvm-20.1.7, r=nikic
Update to LLVM 20.1.7

Closes rust-lang/rust#141306, closes rust-lang/rust#140686, closes rust-lang/rust#141737, closes rust-lang/rust#140933.
2025-06-16 22:33:38 +00:00
Lukas Wirth
2c25e436c7
Merge pull request #20015 from Veykril/push-wsxzsuurqwwr
feat: Insert required parentheses when typing `+` in dyn trait type
2025-06-16 17:13:16 +00:00
Lukas Wirth
b1824c3962 feat: Insert required parentheses when typing + in trait type 2025-06-16 19:02:18 +02:00
Lukas Wirth
a67e2ba115
Merge pull request #20014 from Veykril/push-lsqvxunvnrqw
feat: Show what cargo metadata is doing in status
2025-06-16 16:17:48 +00:00
Lukas Wirth
9dfbd56bb8 feat: Show what cargo metadata is doing in status 2025-06-16 18:05:44 +02:00
bors
bacb2554d8 Auto merge of #142574 - Kobzol:rollup-ldj386u, r=Kobzol
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#141639 (Expose discriminant values in stable_mir)
 - rust-lang/rust#142082 (Refactor `rustc_attr_data_structures` documentation)
 - rust-lang/rust#142125 (Stabilize "file_lock" feature)
 - rust-lang/rust#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - rust-lang/rust#142373 (Fix Debug for Location)
 - rust-lang/rust#142416 (Assorted bootstrap cleanups (step 2))
 - rust-lang/rust#142431 (Add initial version of snapshot tests to bootstrap)
 - rust-lang/rust#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - rust-lang/rust#142528 (clarify `rustc_do_not_const_check` comment)
 - rust-lang/rust#142530 (use `if let` guards where possible)
 - rust-lang/rust#142561 (Remove an `njn:` comment accidentaly left behind.)
 - rust-lang/rust#142566 (Fix `-nopt` CI jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-16 14:25:08 +00:00
Jakub Beránek
975e1172f3
Rollup merge of #142566 - Kobzol:ci-nopt-fix, r=jieyouxu
Fix `-nopt` CI jobs

They were using `--config` instead of `--set`, which overrides too much stuff after recent changes to config merging.

Should hopefully unblock https://github.com/rust-lang/rust/pull/142447.

r? `@jieyouxu`
2025-06-16 14:31:15 +02:00
Jakub Beránek
8991dc44f9
Rollup merge of #142561 - nnethercote:fix-njn-comment, r=chenyukang
Remove an `njn:` comment accidentaly left behind.

r? `@chenyukang`
2025-06-16 14:31:14 +02:00
Jakub Beránek
f4f130937e
Rollup merge of #142530 - fee1-dead-contrib:push-klusvwusyqvq, r=compiler-errors
use `if let` guards where possible

these crates already enable the feature
2025-06-16 14:31:14 +02:00
Jakub Beránek
cc6711b9f1
Rollup merge of #142528 - fee1-dead-contrib:push-rlxklunqkwmv, r=RalfJung
clarify `rustc_do_not_const_check` comment

~~Given that we have used this attribute for other reasons before it seems appropriate to make this a "usually".~~

Add function name as a pointer

cc ```@rust-lang/wg-const-eval```
2025-06-16 14:31:13 +02:00
Laurențiu Nicola
e2c3647c6a
Merge pull request #19994 from sourcefrog/book-links
Fix some links in the book
2025-06-16 07:02:59 +00:00
Chayim Refael Friedman
a207299344
Merge pull request #20000 from tadeokondrak/lifetime-repeat-macro
Allow lifetime repeats in macros: $($x)'a*
2025-06-16
2025-06-15 16:34:42 +00:00
Tadeo Kondrak
2070e9a8f3 Use is_any_identifier in pretty_print_macro_expansion 2025-06-15 18:23:18 +02:00
Tadeo Kondrak
12226b704a Fix spacing for LIFETIME_IDENT near keywords and literals in test output 2025-06-15 17:43:45 +02:00
Deadbeef
4ca88ff6a9 clarify rustc_do_not_const_check comment 2025-06-15 20:40:08 +08:00
Lukas Wirth
3d9daeec36
Merge pull request #20009 from Veykril/push-rvnnorzvpnqv
Optimize `pub(crate)` and `pub(self)` visibility resolution
2025-06-15 08:36:27 +00:00
Lukas Wirth
b3768cdc0e Optimize private visibility resolution 2025-06-15 10:25:45 +02:00
Lukas Wirth
e129cdc202 Optimize pub(crate) visibility resolution 2025-06-15 10:25:45 +02:00
Lukas Wirth
d822f6a0ed
Merge pull request #20008 from Veykril/push-rsnkrwyplmwr
More idiomatic salsa use
2025-06-15 08:12:11 +00:00