33596 Commits

Author SHA1 Message Date
Lukas Wirth
e2c281aaae
Merge pull request #19219 from Veykril/push-rvosplwpwqqt
Vendor `always-assert` into `stdx`
2025-02-24 13:15:39 +00:00
Lukas Wirth
b0380dbfbc
Merge pull request #19211 from Timmmm/user/timh/import_private
Include private items in completions for local crates
2025-02-24 13:13:31 +00:00
Lukas Wirth
f63f845783
Merge pull request #19197 from andylokandy/insta
feat: update insta inline snapshot when clicking 'Update Test' runnable
2025-02-24 13:11:45 +00:00
Lukas Wirth
b7e7893bf6
Merge pull request #19218 from Veykril/push-vqsronpuvrnx
Disable incremental on release builds
2025-02-24 13:08:20 +00:00
Lukas Wirth
9a462b7c36 Vendor always-assert 2025-02-24 14:00:34 +01:00
Lukas Wirth
bd8a601ab3 Disable incremental on release builds 2025-02-24 13:52:46 +01:00
Laurențiu Nicola
b3ee3a96a2
Merge pull request #19217 from lnicola/event-name
Fix `event_name` check is workflows
2025-02-24 12:41:58 +00:00
Laurențiu Nicola
e41d21e221
Merge pull request #19216 from lnicola/ubuntu-22.04
internal: Downgrade to ubuntu-22.04 for aarch64 and arm builds
2025-02-24 12:27:45 +00:00
Laurențiu Nicola
604c4a989e Fix event_name check in workflows 2025-02-24 14:27:11 +02:00
Laurențiu Nicola
74e77188b6 Downgrade to ubuntu-22.04 for aarch64-unknown-linux-gnu and arm-unknown-linux-gnueabihf builds 2025-02-24 14:11:12 +02:00
Laurențiu Nicola
b7665066c9
Merge pull request #19212 from lnicola/sync-from-rust
minor: sync from downstream
2025-02-24 08:45:06 +00:00
Laurențiu Nicola
c96554a622 Update assist docs 2025-02-24 10:28:52 +02:00
Laurențiu Nicola
f641813e07 Format code 2025-02-24 10:28:46 +02:00
Laurențiu Nicola
a5bf2d5604 Add rustc_hashes and bump the others 2025-02-24 10:10:51 +02:00
Laurențiu Nicola
807aa45e0a Merge from rust-lang/rust 2025-02-24 09:42:57 +02:00
Laurențiu Nicola
6f2bd412e3 Preparing for merge from rust-lang/rust 2025-02-24 09:42:28 +02:00
bors
f73bcd16a7 Auto merge of #137271 - nikic:gep-nuw-2, r=scottmcm
Emit getelementptr inbounds nuw for pointer::add()

Lower pointer::add (via intrinsic::offset with unsigned offset) to getelementptr inbounds nuw on LLVM versions that support it. This lets LLVM make use of the pre-condition that the offset addition does not wrap in an unsigned sense. Together with inbounds, this also implies that the offset is non-negative.

Fixes https://github.com/rust-lang/rust/issues/137217.
2025-02-24 03:06:16 +00:00
bors
b2be990003 Auto merge of #137476 - onur-ozkan:137469, r=jieyouxu
avoid `compiler_for` for dist tools and force the current compiler

Using `compiler_for` in dist steps was causing to install stage1 tools into the dist tarballs, which doesn't match with the stage2 compiler.

Fixes https://github.com/rust-lang/rust/issues/137469
2025-02-23 20:32:32 +00:00
Lukas Wirth
6d68c475c7
Merge pull request #19191 from Veykril/push-yzzlosskwrxs
Remove `limit` crate in favor `usize`
2025-02-24
2025-02-23 16:50:32 +00:00
Lukas Wirth
0b2e8166a1 Remove limit crate in favor usize 2025-02-23 17:35:09 +01:00
bors
264d948652 Auto merge of #137225 - RalfJung:vectorcall, r=nnethercote
vectorcall ABI: require SSE2

According to the official docs at https://learn.microsoft.com/en-us/cpp/cpp/vectorcall, SSE2 is required for this ABI. Add a check that enforces this.

I put this together with the other checks ensuring the target features required for a function are present... however, since the ABI is known pre-monomorphization, it would be possible to do this check earlier, which would have the advantage of checking even in `cargo check`. It would have the disadvantage of spreading this code in yet more places.

The first commit just does a little refactoring of the mono-time ABI check to make it easier to add the new check.

Cc `@workingjubilee`

try-job: dist-i586-gnu-i586-i686-musl
2025-02-23 14:12:38 +00:00
Tim Hutt
8d91f1cc17 Include private items in completions for local crates
Don't filter out private items when completing paths in the same crate. Instead respect the `privateEditable` setting.

Fixes #9850
2025-02-23 13:25:53 +00:00
Lukas Wirth
83ff2c91fa
Merge pull request #19209 from niller-g/master
Parser inline test codegen panics and/or does not run
2025-02-23 11:33:21 +00:00
bors
4306c48ef4 Auto merge of #137237 - cuviper:stage0, r=Mark-Simulacrum
Master bootstrap update

https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday

r? `@Mark-Simulacrum`
2025-02-23 11:12:56 +00:00
niller-g
18d6e281b3 Fix codegen of parser inline tests runner
When running `cargo codegen` the `crates/parser/test_data/generated/runner.rs` file is only updated when some file in `crates/parser/test_data/inline` changes. However this is not sufficient in all cases
2025-02-23 11:41:34 +01:00
niller-g
7236109f56 Fix parser inline tests codegen panics
When running `cargo codegen` the cwd="rust-analyzer" however when running `cargo test` the cwd="rust-analyzer/xtask" which makes the codegen panic
2025-02-23 11:34:44 +01:00
bors
40487ec8ee Auto merge of #137466 - jhpratt:rollup-spyi02y, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 - #135354 ([Debuginfo] Add MSVC Synthetic and Summary providers to LLDB)
 - #136826 (Replace mem::zeroed with mem::MaybeUninit::uninit for large struct in Unix)
 - #137194 (More const {} init in thread_local)
 - #137334 (Greatly simplify lifetime captures in edition 2024)
 - #137382 (bootstrap: add doc for vendor build step)
 - #137423 (Improve a bit HIR pretty printer)
 - #137435 (Fix "missing match arm body" suggestion involving `!`)
 - #137448 (Fix bugs due to unhandled `ControlFlow` in compiler)
 - #137458 (Fix missing self subst when rendering `impl Fn*<T>` with no output type)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-23 08:06:25 +00:00
Jacob Pratt
6a6a4956b0
Rollup merge of #137458 - compiler-errors:render-fn, r=fmease
Fix missing self subst when rendering `impl Fn*<T>` with no output type

r? `@fmease` or reassign

Fixes #133597
cc #137456
2025-02-23 02:44:20 -05:00
Jacob Pratt
a79da7fc23
Rollup merge of #137448 - compiler-errors:control-flow-oops, r=scottmcm
Fix bugs due to unhandled `ControlFlow` in compiler

Well, one bug and one nit.
2025-02-23 02:44:20 -05:00
Jacob Pratt
21c185e2b0
Rollup merge of #137435 - estebank:match-arm-2, r=compiler-errors
Fix "missing match arm body" suggestion involving `!`

Include the match arm guard in the gated span, so that the suggestion to add a body is correct instead of inserting the body before the guard.

Make the suggestion verbose.

```
error: `match` arm with no body
  --> $DIR/feature-gate-never_patterns.rs:43:9
   |
LL |         Some(_) if false,
   |         ^^^^^^^^^^^^^^^^
   |
help: add a body after the pattern
   |
LL |         Some(_) if false => { todo!() },
   |                          ++++++++++++++
```

r? `@compiler-errors`
2025-02-23 02:44:19 -05:00
Jacob Pratt
a9c884f9db
Rollup merge of #137423 - Urgau:imprv-pretty-hir, r=compiler-errors
Improve a bit HIR pretty printer

This PR improve (a bit) the HIR pretty printer.

It does so by:
 - Not printing elided lifetimes (those are not expressible in surface Rust anyway)
 - And by rendering implicit self with the shorthand syntax

I also tried fixing some indentation and other things but gave up for now.

Best reviewed commit by commit.
2025-02-23 02:44:19 -05:00
Jacob Pratt
fd3848306d
Rollup merge of #137382 - Shourya742:2025-02-21-add-vendor-step-doc, r=Kobzol
bootstrap: add doc for vendor build step

This PR adds docs for vendor build step.
2025-02-23 02:44:18 -05:00
Jacob Pratt
001a4019df
Rollup merge of #137334 - compiler-errors:edition-2024-fresh-2, r=saethlin,traviscross
Greatly simplify lifetime captures in edition 2024

Remove most of the `+ Captures` and `+ '_` from the compiler, since they are now unnecessary with the new edition 2021 lifetime capture rules. Use some `+ 'tcx` and `+ 'static` rather than being overly verbose with precise capturing syntax.
2025-02-23 02:44:18 -05:00
Jacob Pratt
ea923f9bd0
Rollup merge of #137194 - kornelski:ftls, r=tgross35
More const {} init in thread_local

`const {}` in `thread_local!` gets an optimization just based on the syntax, rather than the expression being const-compatible. This is easy to miss, so I've added more examples to the docs.

I've also added `const {}` in a couple of places in std where this optimization has been missed.
2025-02-23 02:44:17 -05:00
Jacob Pratt
757faeec75
Rollup merge of #136826 - xizheyin:issue-136737, r=thomcc
Replace mem::zeroed with mem::MaybeUninit::uninit for large struct in Unix

As discussion in #136737.

- Replace `mem::zeroed()` with `MaybeUninit::uninit()` for `sockaddr_storage` in `accept()` and `recvfrom()` since these functions fill in the address structure
- Replace `mem::zeroed()` with `MaybeUninit::uninit()` for `pthread_attr_t` in thread-related functions since `pthread_attr_init()` initializes the structure
- Add references to man pages to document this behavior
2025-02-23 02:44:16 -05:00
Jacob Pratt
0e1ca0c32f
Rollup merge of #135354 - Walnut356:msvc_lldb, r=wesleywiser
[Debuginfo] Add MSVC Synthetic and Summary providers to LLDB

Adds handling for `tuple$<>`, `ref$<slice$2<>`, `ref$<str$>` and `enum2$<>`.

Also fixes a bug in MSVC vec/string handling where the script was unable to determine the element's type due to LLDB ignoring template arg debug information

<details>
<summary>Sample code</summary>

```rust
pub enum Number {
    One = 57,
    Two = 99,
}

#[repr(u8)]
pub enum Container {
    First(u32),
    Second { val: u64, val2: i8 },
    Third,
}

...
    let u8_val = b'a';
    let float = 42.78000000000001;

    let tuple = (u8_val, float);

    let str_val = "eef";
    let mut string = "freef".to_owned();
    let mut_str = string.as_mut_str();
    let array: [u8; 4] = [1, 2, 3, 4];
    let ref_array = array.as_slice();
    let mut array2: [u32; 4] = [1, 2, 3, 4];
    let mut_array = array2.as_mut_slice();
    let enum_val = Number::One;
    let mut enum_val2 = Number::Two;
    let sum_val = Container::First(15);
    let sum_val_2 = Container::Second { val: 0, val2: 0 };
    let sum_val_3 = Container::Third;
    let non_zero = NonZeroU128::new(100).unwrap();
    let large_discr = NonZeroU128::new(255);
```
</details>

Before:

![image](https://github.com/user-attachments/assets/19fd0881-a4c3-4c68-b28f-769a67d95e35)

After:

![image](https://github.com/user-attachments/assets/d0479035-17ed-4584-8eb4-71d1314f8f7c)

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: i686-mingw
try-job: aarch64-gnu
2025-02-23 02:44:16 -05:00
bors
70135113d1 Auto merge of #137215 - onur-ozkan:rustc-tool-build-stages, r=jieyouxu,Kobzol
stabilize stage management for rustc tools

https://github.com/rust-lang/rust/pull/135990 got out of control due to excessive complexity. This PR aims to achieve the same goal with a simpler approach, likely through multiple smaller PRs. I will keep the other one read-only and open as a reference for future work.

This work stabilizes the staging logic for `ToolRustc` programs, so you no longer need to handle build and target compilers separately in steps. Previously, most tools didn't do this correctly, which was causing the compiler to be built twice (e.g., `x test cargo --stage 1` would compile the stage 2 compiler before, but now it only compiles the stage 1 compiler).

I also tried to document how we should write `ToolRustc` steps as they are quite different and require more attention than other tools.

Next goal is to stabilize how stages are handled for the rustc itself. Currently, `x build --stage 1` builds the stage 1 compiler which is fine, but `x build compiler --stage 1` builds stage 2 compiler.

~~for now, r? ghost~~
2025-02-23 05:03:26 +00:00
bors
998f241ee8 Auto merge of #137446 - matthiaskrgr:rollup-16moy6v, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private)
 - #137121 (stabilize `(const_)ptr_sub_ptr`)
 - #137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes)
 - #137256 (compiler: untangle SIMD alignment assumptions)
 - #137383 (stabilize `unsigned_is_multiple_of`)
 - #137415 (Remove invalid suggestion of into_iter for extern macro)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-23 02:05:13 +00:00
Matthias Krüger
65ec253f45
Rollup merge of #137415 - chenyukang:yukang-fix-137345-invalid-sugg, r=estebank
Remove invalid suggestion of into_iter for extern macro

Fixes #137345

#109082 is closed due to performance issue, do we have any other solution for this kind of issue?
2025-02-23 00:16:21 +01:00
Matthias Krüger
e27656cbe7
Rollup merge of #137383 - folkertdev:stabilize-unsigned-is-multiple-of, r=Noratrieb
stabilize `unsigned_is_multiple_of`

tracking issue: https://github.com/rust-lang/rust/issues/128101
fcp completed in: https://github.com/rust-lang/rust/issues/128101#issuecomment-2674880635

### Public API

A version of this for all the unsigned types

```rust
fn is_multiple_of(lhs: u64, rhs: u64) -> bool {
    match rhs {
        // prevent division by zero
        0 => lhs == 0,
        _ => lhs % rhs == 0,
    }
}
```
2025-02-23 00:16:20 +01:00
Matthias Krüger
4821471a58
Rollup merge of #137256 - workingjubilee:untangle-vector-abi-assumptions, r=bjorn3,RalfJung
compiler: untangle SIMD alignment assumptions

There were a number of puzzling assumptions being made about SIMD types and their layout that I have corrected in this diff. These are mostly no-op edits in actual fact, but they do subtly alter a pair of checks in our invariant-checking and union layout computation that rested on those peculiar assumptions. Those unfortunately stand in the way of any further actual fixes. I submit this for review, even though it's not clearly motivated without its followups, because it should still be possible to independently conclude whether this is correct.
2025-02-23 00:16:19 +01:00
Matthias Krüger
f4b4a9d356
Rollup merge of #137121 - bend-n:master, r=Noratrieb
stabilize `(const_)ptr_sub_ptr`

Tracking issue: #95892
Closes #95892
FCP Completed: https://github.com/rust-lang/rust/issues/95892#issuecomment-2561139730

r? ````@Noratrieb````
2025-02-23 00:16:18 +01:00
Matthias Krüger
52cab28edc
Rollup merge of #135501 - tgross35:stdlib-dependencies-private, r=bjorn3
Inject `compiler_builtins` during postprocessing and ensure it is made private

Follow up of https://github.com/rust-lang/rust/pull/135278

Do the following:

* Inject `compiler_builtins` during postprocessing, rather than injecting `extern crate compiler_builtins as _` into the AST
* Do not make dependencies of `std` private by default (this was added in #135278)
* Make sure sysroot crates correctly mark their dependencies private/public
* Ensure that marking a dependency private makes its dependents private by default as well, unless otherwise specified
* Do the `compiler_builtins` update that has been blocked on this

There is more detail in the commit messages. This includes the changes I was working on in https://github.com/rust-lang/rust/pull/136226.

try-job: test-various
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: i686-mingw-1
try-job: i686-mingw-2
2025-02-23 00:16:18 +01:00
bors
b6d9664d20 Auto merge of #137189 - Kobzol:update-host-llvm, r=nikic
Update host LLVM to 20.1 on CI

r? `@ghost`
2025-02-22 22:58:17 +00:00
Michael Goulet
fb3a49ed55 Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
Chayim Refael Friedman
9df88ff0f6
Merge pull request #19182 from ShoyuVanilla/issue-19177
fix: Binding wrong associated type when lowering bounds like `T: Trait<Assoc = U>`
2025-02-22 21:32:46 +00:00
Shirayama Kazatsuyu
64a869c714 Allow "package/feature" format feature flag 2025-02-22 22:27:30 +09:00
Laurențiu Nicola
865583bbbd
Merge pull request #19203 from lnicola/rust-src-path
minor: Switch back to RUST_SRC_PATH
2025-02-22 07:23:21 +00:00
Laurențiu Nicola
13d761b8a9
Merge pull request #19201 from joshrotenberg/other-editors-toc
doc: toc for other editors
2025-02-22 07:16:54 +00:00
Laurențiu Nicola
a7547a473b Switch back to RUST_SRC_PATH 2025-02-22 09:07:52 +02:00