Commit Graph

308340 Commits

Author SHA1 Message Date
Marijn Schouten 7c95768dbd btree: some cleanup with less unsafe 2025-10-17 16:43:01 +00:00
Camille Gillot 97f88f5603 Generalize the non-freeze and needs_drop handling. 2025-10-17 16:28:37 +00:00
Jakub Beránek ce320bb35a Do not error out for download-rustc if LTO is configured 2025-10-17 18:15:09 +02:00
LorrensP-2158466 8492b24424 use module_child index as disambiguator for external items 2025-10-17 18:04:28 +02:00
Connor Tsui 3a9c521285 move once module out of poison
Since `Once` will not have a non-poisoning variant, we remove it from
the `poison` module.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-10-17 11:43:39 -04:00
Connor Tsui 7b61403c50 reorganize library/std/src/sync/mod.rs file
Moves things around to make a bit more sense (plus prepare moving `once`
out of `poison`.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-10-17 11:43:38 -04:00
Connor Tsui 0758e191d5 clean up some documentation
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-10-17 11:43:15 -04:00
bors f46475914d Auto merge of #147660 - notriddle:stringdex-002, r=GuillaumeGomez
rustdoc-search: stringdex 0.0.2

Two index format tweaks that reduce the size of the standard library, compiler, and wordnet dictionary when I test it.

CC rust-lang/rust#146048

FF Profiler output: https://share.firefox.dev/4onH5xP

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-002/std/index.html
2025-10-17 15:42:33 +00:00
Connor Tsui a61c8be269 rename once::ExclusiveState to OnceExclusiveState
It is a bit confusing when reading code that uses this type since it is
not immediately obvious that it is specific to `Once`.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-10-17 10:57:39 -04:00
Ralf Jung 71d89c1cf4 use minicore for target-feature tests 2025-10-17 16:20:44 +02:00
Guillaume Gomez b3bb7500b6 Add regression tests for intra-doc links 2025-10-17 15:55:28 +02:00
Osama Abdelkader e67d502d4e Fix autodiff incorrectly applying fat-lto to proc-macro crates
When -Z autodiff=Enable is used, the compiler automatically enables
fat-lto for all crates. However, proc-macro crates cannot use fat-lto
without the -Zdylib-lto flag, causing compilation errors.

This commit modifies the lto() method in Session to exclude proc-macro
crates from fat-lto when autodiff is enabled, while preserving the
existing behavior for all other crate types.

The fix ensures that:
- Non-proc-macro crates still get fat-lto when autodiff is enabled
- Proc-macro crates are excluded from fat-lto when autodiff is enabled
- Existing autodiff functionality remains unchanged for regular crates

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
2025-10-17 16:52:55 +03:00
Cameron Steffen d9a53899db Fix clippy for impl_trait_header changes 2025-10-17 08:36:34 -05:00
Cameron Steffen b323f567d9 Remove Option from impl_trait_header 2025-10-17 08:36:34 -05:00
Cameron Steffen e60e9f0826 Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
Cameron Steffen ae8ff943c1 Remove some impl_opt_trait_header usages 2025-10-17 08:36:34 -05:00
Cameron Steffen ca5073759c Remove some impl_trait_ref usages 2025-10-17 08:36:34 -05:00
Cameron Steffen c17b2dc283 Split trait_id_of_impl into impl(_opt)_trait_id 2025-10-17 08:36:34 -05:00
Cameron Steffen dcf76b6811 Move some TyCtxt trait methods close together 2025-10-17 08:36:34 -05:00
Cameron Steffen 9b2c9a8c5b Refactor default_could_be_derived 2025-10-17 08:36:34 -05:00
Cameron Steffen 4d03de651d Optimize impl_trait_ref usage in sanitizer 2025-10-17 08:36:33 -05:00
Guillaume Gomez fcc47d07a3 rustdoc: Fix passes order so intra-doc links are collected after stripping passes 2025-10-17 14:44:59 +02:00
Waffle Lapkin 602959e409 bless ui tests 2025-10-17 11:46:25 +02:00
Waffle Lapkin 82b0cd8bee deny never type lints by default 2025-10-17 11:46:25 +02:00
bors a41214f9bd Auto merge of #147779 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

`Cargo.lock` update, because `clippy_utils` is now also using `itertools`
2025-10-17 07:57:20 +00:00
bors 28c4c7d7ab Auto merge of #147508 - nnethercote:TaskDeps-improvements, r=saethlin
`TaskDeps` improvements

Some cleanups and minor perf improvements relating to `TaskDeps`.

r? `@saethlin`
2025-10-17 04:47:43 +00:00
Philipp Krones 4b0cfb6a83 Update Cargo.lock 2025-10-16 20:38:32 +02:00
Philipp Krones 50561837de Merge commit 'd9fb15c4b1ebe9e7dc419e07f53af681d7860cbe' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
bors 53a741fc4b Auto merge of #147782 - matthiaskrgr:rollup-9728xqu, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`)
 - rust-lang/rust#147000 (std: Add Motor OS std library port)
 - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer)
 - rust-lang/rust#147732 (remove duplicate inline macro)
 - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages)
 - rust-lang/rust#147744 (miri subtree update)
 - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.)
 - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice)
 - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-16 18:35:29 +00:00
Augie Fackler 10a533417b bootstrap: migrate to object 0.37
I noticed we had a mix of 0.37 and 0.36 at work, and this was why. As
far as I can tell everything still works fine.
2025-10-16 14:07:50 -04:00
León Orell Valerian Liehr 65814c80e8 Guard us against degenerate default traits 2025-10-16 19:53:32 +02:00
León Orell Valerian Liehr 03dfb84ee1 More robustly reject relaxing non-default trait bounds 2025-10-16 19:53:32 +02:00
León Orell Valerian Liehr aee9d3b4c0 Don't permit ?Sized in more places just because more_maybe_bounds was enabled
The internal feature `more_maybe_bounds` doesn't influence sized elaboration in
HIR ty lowering and therefore doesn't get to dictate where `?Sized` is allowed.
2025-10-16 19:53:31 +02:00
León Orell Valerian Liehr ce68cd3762 Reject relaxed bounds inside trait alias bounds 2025-10-16 19:53:31 +02:00
León Orell Valerian Liehr 690a8a6dfd Tweak diagnostics for relaxed bounds in invalid positions 2025-10-16 19:53:29 +02:00
Matthias Krüger f337e28bd9 Rollup merge of #147773 - timvisee:docs-empty-is-ascii, r=Noratrieb
`is_ascii` on an empty string or slice returns true

Update the description of the [`is_ascii`](https://doc.rust-lang.org/std/primitive.str.html#method.is_ascii) functions - an empty string or slice also returns `true`.

This follows the pattern of [`all()`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.all). Clippy currently suggests to change `string.chars().all(|c| c.is_ascii())` into `string.is_ascii()`. This suggestion therefore seems fitting.

I've already questioned the behavior for this multiple times. I've always had to check the internals to conclude how it works. That's why I'm opening this PR to add it directly in the documentation.
2025-10-16 19:35:28 +02:00
Matthias Krüger 3a993f7458 Rollup merge of #147752 - fee1-dead-contrib:sgtypo, r=chenyukang
style-guide: fix typo for empty struct advice

the advice appears to apply to empty structs with braces (parens/blocks), and a unit struct in the comment does not make sense. Fix the typo.
2025-10-16 19:35:28 +02:00
Matthias Krüger 7604d12e05 Rollup merge of #147751 - nnethercote:bit_set-Word, r=Zalathar
Use `bit_set::Word` in a couple more places.

It's a synonym for `u64` and there are a couple of places where we use `u64` where we should use `Word`, which this commit fixes.

I found this when I tried changing `Word` to `u128` (which made performance worse).

r? `````@Zalathar`````
2025-10-16 19:35:27 +02:00
Matthias Krüger 6f66f3baf5 Rollup merge of #147744 - RalfJung:miri, r=RalfJung
miri subtree update

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

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

r? ``````@ghost``````
2025-10-16 19:35:26 +02:00
Matthias Krüger d8dd468ff1 Rollup merge of #147738 - pommicket:issue-147665, r=madsmtm
Don't highlight `let` expressions as having type `bool` in let-chain error messages

Fixes rust-lang/rust#147665.
2025-10-16 19:35:25 +02:00
Matthias Krüger 42cf0bd006 Rollup merge of #147732 - h3nryc0ding:master, r=chenyukang
remove duplicate inline macro
2025-10-16 19:35:25 +02:00
Matthias Krüger 5408ec3069 Rollup merge of #147576 - Mark-Simulacrum:fix-offset-zst, r=nnethercote,RalfJung
Fix ICE on offsetted ZST pointer

I'm not sure this is the *right* fix, but it's simple enough and does roughly what I'd expect. Like with the previous optimization to codegen usize rather than a zero-sized static, there's no guarantee that we continue returning a particular value from the offsetting.

A grep for `const_usize.*align` found the same code copied to rustc_codegen_gcc and cranelift but a quick skim didn't find other cases of similar 'optimization'. That said, I'm not convinced I caught everything, it's not trivial to search for this.

Closes rust-lang/rust#147516
2025-10-16 19:35:24 +02:00
Matthias Krüger 91f48d8ba7 Rollup merge of #147000 - moturus:motor-os_stdlib_pr, r=tgross35
std: Add Motor OS std library port

Motor OS was added as a no-std Tier-3 target in
[PR 146848](https://github.com/rust-lang/rust/pull/146848) as x86_64-unknown-motor.

This PR adds the std library for Motor OS.

While the PR may seem large, all it does is proxy
std pal calls to [moto-rt](https://crates.io/crates/moto-rt). Where there is some non-trivial
code (e.g. thread::spawn), it is quite similar, often
identical, to what other platforms do.
2025-10-16 19:35:23 +02:00
Matthias Krüger 334b3af42c Rollup merge of #144438 - dawidl022:contracts/guarded-lowering, r=oli-obk
Guard HIR lowered contracts with `contract_checks`

Refactor contract HIR lowering to ensure no contract code is executed when contract-checks are disabled.

The call to `contract_checks` is moved to inside the lowered fn body, and contract closures are built conditionally, ensuring no side-effects present in contracts occur when those are disabled. This partially addresses rust-lang/rust#139548, i.e. the bad behavior no longer happens with contract checks disabled (`-Zcontract-checks=no`).

The change is made in preparation for adding contract variable declarations - variables declared before the `requires` assertion, and accessible from both `requires` and `ensures`, but not in the function body (PR rust-lang/rust#144444). As those declarations may also have side-effects, it's good to guard them with `contract_checks` - the new lowering approach allows for this to be done easily.

Contracts tracking issue: rust-lang/rust#128044

**Known limiatations**:

- It is still possible to early return from the *function* from within a contract, e.g.

  ```rust
  #[ensures({if x > 0 { return 0 }; |_| true})]
  fn foo(x: u32) -> i32 {
      42
  }
  ```

  When `foo` is called with an argument greater than 0, instead of `42`, `0` will be returned.

  As this is not a regression, it is not addressed in this PR. However, it may be worth revisiting later down the line, as users may expect a form of early return from *contract specifications*, and so returning from the entire *function* could cause confusion.

- ~Contracts are still not optimised out when disabled. Currently, even when contracts are disabled, the code generated causes existing optimisations to fail, meaning even disabled contracts could impact runtime performance. This issue is blocking rust-lang/rust#136578, and has not been addressed in this PR, i.e. the `mir-opt` and `codegen` tests that fail in rust-lang/rust#136578 still fail with these new HIR lowering changes.~ Contracts should now be optimised out when disabled, however some regressions tests still need to be added to be sure that is indeed the case.
2025-10-16 19:35:22 +02:00
dianqk 7af577570e Bless collect-in-promoted-const.rs 2025-10-16 23:03:05 +08:00
dianqk afff0502a6 GVN: Preserve derefs at terminators that cannot write to memory 2025-10-16 23:03:05 +08:00
bors 779e19d8ba Auto merge of #147644 - cjgillot:bitsetvec, r=jackh726
Use regular Vec in BitSet.

That code is hot enough for the branch in all accesses to `SmallVec` to appear in profiles.
2025-10-16 14:06:35 +00:00
Philipp Krones d9fb15c4b1 Rustup (#15892)
r? @ghost

changelog: none
2025-10-16 14:03:44 +00:00
Philipp Krones 9aa70f2bdd Bump nightly version -> 2025-10-16 2025-10-16 15:57:16 +02:00
Philipp Krones cf7aaa5ecf Merge remote-tracking branch 'upstream/master' into rustup 2025-10-16 15:57:00 +02:00