Commit Graph

311759 Commits

Author SHA1 Message Date
Lukas Wirth ac118f93ff Merge pull request #21146 from Veykril/push-kwupvlsnstrx
proc-macro-srv: Fix `<TokenStream as Display>::fmt` impl rendering puncts as u8
2025-11-27 15:59:08 +00:00
Lukas Wirth 6bbdb1f6ae proc-macro-srv: Fix <TokenStream as Display>::fmt impl rendering puncts as u8 2025-11-27 16:49:38 +01:00
Lukas Wirth 7f93ba5612 Merge pull request #21145 from Veykril/push-prwwrlwmoxzx
proc-macro-srv: Fix `<TokenStream as Display>::fmt` impl producing trailing whitespace
2025-11-27 13:01:10 +00:00
Lukas Wirth 2578d40f34 proc-macro-srv: Fix <TokenStream as Display>::fmt impl producing trailing whitespace 2025-11-27 13:51:20 +01:00
Lukas Wirth 41a2df5b38 Merge pull request #21095 from A4-Tacks/autoderef-skipiter
Fix skipiter not applicable in autoderef
2025-11-27 08:31:19 +00:00
Shoyu Vanilla (Flint) 32555af6a2 Merge pull request #20976 from A4-Tacks/comp-after-top-inner-attr
Fix not complete after inner-attr in source-file
2025-11-27 06:36:13 +00:00
Shoyu Vanilla (Flint) e958534bfe Merge pull request #21028 from A4-Tacks/comp-pattern-alias
Fix not complete type alias in pattern
2025-11-27 06:06:53 +00:00
Shoyu Vanilla (Flint) b8191e675f Merge pull request #20685 from A4-Tacks/enum-multi-gen-is-as
Add multiple generate for enum generate is, as, try_into
2025-11-27 06:05:55 +00:00
Laurențiu Nicola a60d5fa0c1 Merge pull request #21143 from rust-lang/rustc-pull
minor: sync from downstream
2025-11-27 05:34:29 +00:00
The rustc-josh-sync Cronjob Bot fc4db45047 Merge ref '1be6b13be73d' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 1be6b13be7
Filtered ref: 53d2132341f509072e83b49d4d82f17465ab164c
Upstream diff: https://github.com/rust-lang/rust/compare/6159a44067ebce42b38f062cc7df267a1348e092...1be6b13be73dc12e98e51b403add4c41a0b77759

This merge was created using https://github.com/rust-lang/josh-sync.
2025-11-27 04:08:49 +00:00
The rustc-josh-sync Cronjob Bot 8c5f7a3b7e Prepare for merging from rust-lang/rust
This updates the rust-version file to 1be6b13be7.
2025-11-27 04:08:44 +00:00
bors 1be6b13be7 Auto merge of #149079 - zachs18:clone_from_ref, r=Mark-Simulacrum
Add `Box::clone_from_ref` and similar under `feature(clone_from_ref)`

Tracking issue: https://github.com/rust-lang/rust/issues/149075

Accepted ACP: https://github.com/rust-lang/libs-team/issues/483

This PR implements `clone_from_ref` (and `try_*` and `_*in` variants), to get a `Box<T>`, `Arc<T>`, or `Rc<T>` by cloning from a `&T` where `T: CloneToUninit`.

The "Implement..." commits replace some ad-hoc conversions with `clone_from_ref` variants, which can be split out to a separate PR if desired.

This PR will conflict with https://github.com/rust-lang/rust/pull/148769 due to usage of `Layout::dangling` (which that PR is renaming to `dangling_ptr`), so they should not be rolled up together, and the one which merges later will need to be amended.
2025-11-26 18:21:00 +00:00
Lukas Wirth f7970fddcf Merge pull request #21139 from Veykril/push-wmxmrovmrrxx
internal: Gate spawning proc-macro-srv with --format on toolchain version
2025-11-26 16:43:06 +00:00
Lukas Wirth c18ec026c7 Gate spawning proc-macro-srv with --format on toolchain version 2025-11-26 17:30:45 +01:00
bors 99ca3fc4ec Auto merge of #149351 - Zalathar:rollup-ee06zha, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#147936 (Offload intrinsic)
 - rust-lang/rust#148358 (Fix some issues around `rustc_public`)
 - rust-lang/rust#148452 (Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors)
 - rust-lang/rust#148751 (Build gnullvm toolchains on Windows natively)
 - rust-lang/rust#148951 (rustc_target: aarch64: Remove deprecated FEAT_TME)
 - rust-lang/rust#149149 ([rustdoc] misc search index cleanups)
 - rust-lang/rust#149173 (Use rust rather than LLVM target features in the target spec)
 - rust-lang/rust#149307 (Deny const auto traits)
 - rust-lang/rust#149312 (Mark riscv64gc-unknown-linux-musl as tier 2 target)
 - rust-lang/rust#149317 (Handle inline asm in has_ffi_unwind_calls)
 - rust-lang/rust#149326 (Remove unused `Clone` derive on `DelayedLint`)
 - rust-lang/rust#149341 (Add `Copy` to some AST enums.)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-26 15:10:08 +00:00
Stuart Cook 4a05348377 Rollup merge of #149341 - Jarcho:ast_copy, r=chenyukang
Add `Copy` to some AST enums.

It's a minor annoyance they aren't `Copy` and there doesn't seem to be any reason for them not to be.
2025-11-26 23:32:11 +11:00
Stuart Cook 25a861a21a Rollup merge of #149326 - JonathanBrouwer:remove_clone, r=lcnr
Remove unused `Clone` derive on `DelayedLint`
2025-11-26 23:32:10 +11:00
Stuart Cook a57d7539cb Rollup merge of #149317 - bjorn3:has_ffi_unwind_calls_inline_asm, r=petrochenkov
Handle inline asm in has_ffi_unwind_calls

This is required for the soundness of `options(may_unwind)`.

Extracted from https://github.com/rust-lang/rust/pull/149141.
2025-11-26 23:32:10 +11:00
Stuart Cook 3d404d0e9e Rollup merge of #149312 - mati865:push-uxlynzmxzswo, r=wesleywiser
Mark riscv64gc-unknown-linux-musl as tier 2 target

According to https://github.com/rust-lang/rust/blob/cdb4236e654a49c3035269588fe22dfafc0cfa3a/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md?plain=1#L3 it's tier 2 target.

In case you are wondering how I noticed it:
Dockerfiles at Wild linker repo started to fail building recently due to missing `riscv64gc-unknown-linux-musl` std. I had hoped the problem would go away by itself, but it did not (it never does...).
https://github.com/rust-lang/rust/pull/148983 happened recently, so I checked https://rust-lang.github.io/rustup-components-history/riscv64gc-unknown-linux-musl.html and yeah, the date matches.
Given this condition: https://github.com/rust-lang/rust/blob/cdb4236e654a49c3035269588fe22dfafc0cfa3a/src/tools/build-manifest/build.rs#L35 I'm certain PR will fix the problem.
2025-11-26 23:32:09 +11:00
Stuart Cook aa98135ace Rollup merge of #149307 - lapla-cogito:deny_const_auto_trait, r=fmease
Deny const auto traits

close rust-lang/rust#149285

The AST validation now detects and rejects const auto traits. Additionally, I updated an existing test that was using `const unsafe auto trait`.

r? fmease
2025-11-26 23:32:08 +11:00
Stuart Cook 3b531a18b5 Rollup merge of #149173 - bjorn3:target_spec_rust_features, r=RalfJung
Use rust rather than LLVM target features in the target spec

This works better with non-LLVM codegen backends.
2025-11-26 23:32:08 +11:00
Stuart Cook eb7e317e05 Rollup merge of #149149 - yotamofek:wip/rustdoc/search_index/misc-cleanups, r=GuillaumeGomez
[rustdoc] misc search index cleanups

Bunch of misc cleanups to search index generation (on the rustdoc side). Perf isn't improved unfortunately, but I do think most of these changes are improvements to readability/style.

Probably easier to review commit by commit.
2025-11-26 23:32:07 +11:00
Stuart Cook da2d7583b2 Rollup merge of #148951 - maurer:remove-tme, r=folkertdev
rustc_target: aarch64: Remove deprecated FEAT_TME

fixes https://github.com/rust-lang/rust/issues/149308

ARM has withdrawn FEAT_TME

https://developer.arm.com/documentation/102105/lb-05/

LLVM has dropped support for generating it
llvm/llvm-project#167687

```@rustbot``` label llvm-main

r? ```@durin42```
2025-11-26 23:32:06 +11:00
Stuart Cook e636017e7b Rollup merge of #148751 - mati865:gnullvm-windows-host, r=marcoieni
Build gnullvm toolchains on Windows natively

Fixes https://github.com/rust-lang/rust/issues/144656
2025-11-26 23:32:06 +11:00
Stuart Cook d1b9331a76 Rollup merge of #148452 - Fulgen301:pdb-large-symbols-v0, r=jackh726
Mangle symbols with a mangled name close to PDB limits with v0 instead of legacy mangling to avoid linker errors

This is rust-lang/compiler-team#934

As PDB debuginfo has a 64KiB limit for symbol names, we use v0 mangling instead of legacy mangling for symbol names >= 65000 bytes if PDB is used. The cutoff number was chosen to leave some room for potential errors in the empirical measurement of the limit of 65521 bytes, as well as potential symbol prefixes and suffixes that are applied later, plus some generous extra space.

Tracking issue: rust-lang/rust#148429
2025-11-26 23:32:05 +11:00
Stuart Cook 2ddaf4219e Rollup merge of #148358 - makai410:rpub-test-fix, r=celinval
Fix some issues around `rustc_public`

cc rust-lang/rust#148266 .
follow-up of rust-lang/rust#148341 .

This fixes the issues that can be reproduced by `x test compiler/rustc_public`:

```
error: function `run` is never used
   --> compiler/rustc_public/src/compiler_interface.rs:838:15
    |
838 | pub(crate) fn run<'tcx, F, T>(interface: &CompilerInterface<'tcx>, f: F) -> Result<T, Error>
    |               ^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`

error: unreachable `pub` item
  --> compiler/rustc_public/src/unstable/mod.rs:25:1
   |
25 | pub trait InternalCx<'tcx>: Copy + Clone {
   | ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates
   = note: `-D unreachable-pub` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unreachable_pub)]`

error: unreachable `pub` item
  --> compiler/rustc_public/src/unstable/mod.rs:62:1
   |
62 | pub trait Stable<'tcx>: PointeeSized {
   | ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: unreachable `pub` item
  --> compiler/rustc_public/src/unstable/mod.rs:81:1
   |
81 | pub trait RustcInternal {
   | ---^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

error: could not compile `rustc_public` (lib) due to 4 previous errors
```
2025-11-26 23:32:04 +11:00
Stuart Cook 2b150f2c65 Rollup merge of #147936 - Sa4dUs:offload-intrinsic, r=ZuseZ4
Offload intrinsic

This PR implements the minimal mechanisms required to run a small subset of arbitrary offload kernels without relying on hardcoded names or metadata.

- `offload(kernel, (..args))`: an intrinsic that generates the necessary host-side LLVM-IR code.
- `rustc_offload_kernel`: a builtin attribute that marks device kernels to be handled appropriately.

Example usage (pseudocode):
```rust
fn kernel(x: *mut [f64; 128]) {
    core::intrinsics::offload(kernel_1, (x,))
}

#[cfg(target_os = "linux")]
extern "C" {
    pub fn kernel_1(array_b: *mut [f64; 128]);
}

#[cfg(not(target_os = "linux"))]
#[rustc_offload_kernel]
extern "gpu-kernel" fn kernel_1(x: *mut [f64; 128]) {
    unsafe { (*x)[0] = 21.0 };
}
```
2025-11-26 23:32:03 +11:00
bors c797096598 Auto merge of #149140 - oli-obk:more-encoder-minimization, r=jdonszelmann
More encoder minimizations

follow-up to https://github.com/rust-lang/rust/pull/149054
2025-11-26 11:57:29 +00:00
Yotam Ofek 2a34631ab6 simplify_fn_type can only ever return 0 or 1 types, doesn't need to take &mut Vec 2025-11-26 12:24:20 +02:00
Yotam Ofek b976f64768 collect into vectors 2025-11-26 12:24:12 +02:00
Yotam Ofek 25b720755e Extract common functionality into closure
Also, use `Vec::resize` instead of individual `push`es
2025-11-26 12:21:31 +02:00
Yotam Ofek 51866db456 Pre-ensure size of vectors when performing union, instead of pushing default elements one by one 2025-11-26 12:21:31 +02:00
Yotam Ofek 87b5802ef5 Small cleanups 2025-11-26 12:21:31 +02:00
Yotam Ofek ab87304310 map_fn_sig_item doesn't need a mutable reference 2025-11-26 12:21:31 +02:00
Lukas Wirth 98fffb4fa4 Merge pull request #21135 from Shourya742/2025-11-26-default-json
fix: Fix proc-macro-srv protocol read implementation
2025-11-26 10:20:54 +00:00
Lukas Wirth c460a725dc Merge pull request #21133 from Veykril/push-olvztmtwzmvv
fix: Do not try to connect via postcard to proc-macro-srv
2025-11-26 10:16:43 +00:00
Lukas Wirth c076ef3c3b Revert to spawning proc-macro-srv without format flag 2025-11-26 11:06:58 +01:00
bit-aloo 6eb6936b5b return Some(T) and not T in read method Message trait 2025-11-26 14:56:46 +05:30
Lukas Wirth c414fc5bee fix: Do not try to connect via postcard to proc-macro-srv 2025-11-26 09:03:00 +01:00
Lukas Wirth e5058c437f minor: Rename proc-macro-srv protocol flags 2025-11-26 09:03:00 +01:00
Lukas Wirth 20fa8ab327 Merge pull request #21131 from Veykril/push-rxrmsylwoowm
completions: Fix completions disregarding snippet capabilities
2025-11-26 07:18:43 +00:00
Lukas Wirth b0d1c9a7e7 completions: Fix completions disregarding snippet capabilities 2025-11-26 08:01:52 +01:00
bors 6840234806 Auto merge of #147799 - Enselic:slash-slash-at-debuginfo-tests, r=saethlin
compiletest: Use `//@` prefixes also for debuginfo test directives

So that when we later add support for revisions we can use the same syntax for revisions as elsewhere (for https://github.com/rust-lang/rust/pull/147426).

This also prevents people from making typos for commands since `src/tools/compiletest/src/directives/directive_names.rs` will catch such typos now.

Note that we add one FIXME for a non-trivial change for later:
```
// FIXME(#148097): Change `// cdb-checksimple_closure` to `//@ cdb-check:simple_closure`
```

### TODO
- [x] Triple-check that all tests still run and all directives are still applied. Done: https://github.com/rust-lang/rust/pull/147799#issuecomment-3478986910

### Zulip discussion

https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/.2F.2F.40.20syntax.20for.20debuginfo.20tests/with/545015582
2025-11-26 06:51:20 +00:00
Jason Newcomb c87bebd553 Add Copy to some AST enums. 2025-11-25 23:10:02 -05:00
bors d8a7534127 Auto merge of #149330 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

7 commits in 9fa462fe3a81e07e0bfdcc75c29d312c55113ebb..2a7c4960677971f88458b0f8b461a866836dff59
2025-11-21 20:49:51 +0000 to 2025-11-25 19:58:07 +0000
- docs(config-include): prepare for doc stabilization  (rust-lang/cargo#16301)
- fix(config-include): remove support of single string shorthand (rust-lang/cargo#16298)
- Revert "feat: Do not lock the artifact-dir for check builds" (rust-lang/cargo#16299)
- clean: Add --workspace support (rust-lang/cargo#16263)
- feat(tree): Add more native completions (rust-lang/cargo#16296)
- fix(package): exclude target/package from backups (rust-lang/cargo#16272)
- test: re-enable test since not flaky anymore (rust-lang/cargo#16287)
2025-11-26 03:37:04 +00:00
Weihang Lo c2bbd6be1e Update cargo submodule 2025-11-25 15:31:45 -05:00
Jonathan Brouwer 7693c0a3d1 Remove unused Clone derive on DelayedLint 2025-11-25 21:16:31 +01:00
Laurențiu Nicola 5c82106f5a Merge pull request #21027 from ColinFinck/msvc-crt-static
Build releases with static CRT for `-windows-msvc` targets.
2025-11-25 19:29:10 +00:00
Marcelo Domínguez f39ec4756f Update rustc-dev-guide 2025-11-25 20:06:30 +01:00
Marcelo Domínguez 5128ce10a0 Implement offload intrinsic 2025-11-25 20:04:27 +01:00