304366 Commits

Author SHA1 Message Date
Stuart Cook
0671b2fe49
Rollup merge of #142871 - chenyukang:yukang-fix-doc-for-transpose, r=ibraheemdev
Trivial improve doc for transpose

When I saw old doc, I felt a little confused.
Seems it would be clearer this way.
2025-08-19 14:18:17 +10:00
Stuart Cook
633cc0cc6c
Rollup merge of #142681 - 1c3t3a:sanitize-off-on, r=rcvalle
Remove the `#[no_sanitize]` attribute in favor of `#[sanitize(xyz = "on|off")]`

This came up during the sanitizer stabilization (rust-lang/rust#123617). Instead of a `#[no_sanitize(xyz)]` attribute, we would like to have a `#[sanitize(xyz = "on|off")]` attribute, which is more powerful and allows to be extended in the future (instead
of just focusing on turning sanitizers off). The implementation is done according to what was [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/343119-project-exploit-mitigations/topic/Stabilize.20the.20.60no_sanitize.60.20attribute/with/495377292)).

The new attribute also works on modules, traits and impl items and thus enables usage as the following:
```rust
#[sanitize(address = "off")]
mod foo {
    fn unsanitized(..) {}

    #[sanitize(address = "on")]
    fn sanitized(..) {}
}

trait MyTrait {
  #[sanitize(address = "off")]
  fn unsanitized_default(..) {}
}

#[sanitize(thread = "off")]
impl MyTrait for () {
    ...
}
```

r? ```@rcvalle```
2025-08-19 14:18:16 +10:00
Stuart Cook
027c7a5d85
Rollup merge of #141744 - GrigorenkoPV:ip_from, r=Amanieu
Stabilize `ip_from`

Tracking issue: rust-lang/rust#131360

Stabilizes and const-stabilizes the following APIs:
```rust
// core::net
impl Ipv4Addr {
    pub const fn from_octets(octets: [u8; 4]) -> Ipv4Addr;
}
impl Ipv6Addr {
    pub const fn from_octets(octets: [u8; 16]) -> Ipv6Addr;
    pub const fn from_segments(segments: [u16; 8]) -> Ipv6Addr;
}
```

Closes rust-lang/rust#131360

```@rustbot``` label +needs-fcp
2025-08-19 14:18:15 +10:00
Stuart Cook
2beb54c451
Rollup merge of #140956 - Kixunil:impl-partialeq-str-for-path, r=Amanieu
`impl PartialEq<{str,String}> for {Path,PathBuf}`

This is a revival of #105877

Comparison of paths and strings is expected to be possible and needed e.g. in tests. This change adds the impls os `PartialEq` between strings and paths, both owned and unsized, in both directions.

ACP: https://github.com/rust-lang/libs-team/issues/151
2025-08-19 14:18:14 +10:00
Zhongyao Chen
45ea228c42 completely remove rva23s64 2025-08-19 10:33:54 +08:00
Tsukasa OI
ee7627ee40 std_detect: RISC-V: implement implication to "C"
Just like we implemented relatively complex rules to imply other extensions
**from** "C" (and some others), this commit implements implication
**to** the "C" extension from others, complying the following text
in the ISA Manual (although there's no direct imply/depend references).

> The C extension is the superset of the following extensions:
>
> - Zca
> - Zcf if F is specified (RV32 only)
> - Zcd if D is specified

This is formally verified so that no other extension combinations
(*not* in this implementation) can (currently) imply the "C" extension.
2025-08-19 01:38:27 +00:00
Zhongyao Chen
ce07b5d3fc remove rva23s64 from riscv64a23-unknown-linux-gnu target 2025-08-19 08:58:48 +08:00
bors
b96868fa2e Auto merge of #145559 - marcoieni:free-disk-timeout, r=Kobzol
ci: add timeout to windows disk cleanup wait
2025-08-18 23:20:09 +00:00
Alejandra González
9a2076ed87
Cut needless mut (#15512)
changelog:none
2025-08-18 20:46:49 +00:00
Jakub Beránek
533ecdbc1c
Assume UTF-8 in sysroot paths 2025-08-18 22:12:48 +02:00
Jakub Beránek
4c212513cf
Fix uplifting in Assemble step 2025-08-18 22:09:30 +02:00
Stypox
dc72692591
Add tracing to various miscellaneous functions
Also use tracing macro syntax instead of format()
2025-08-18 21:43:27 +02:00
bors
9eb4a26520 Auto merge of #145489 - joshtriplett:cfg-if-not, r=Amanieu
library: Migrate from `cfg_if` to `cfg_select`

Migrate the standard library from using the external `cfg_if` crate to using the now-built-in `cfg_select` macro.

This does not yet eliminate the dependency from `library/std/Cargo.toml`, because while the standard library itself no longer uses `cfg_if`, it also incorporates the `backtrace` crate, which does.

Migration assisted by the following vim command (after selecting the full `cfg_if!` invocation):

```
'<,'>s/\(cfg_if::\)\?cfg_if/cfg_select/ | '<,'>s/^\( *\)} else {/\1}\r\1_ => {/c | '<,'>s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 => /e | '<,'>s/if #\[cfg(\(.*\))\] {/\1 => {/e
```

This is imperfect, but substantially accelerated the process. This prompts for confirmation on the `} else {` since that can also appear inside one of the arms. This also requires manual intervention to handle any multi-line conditions.
2025-08-18 19:37:33 +00:00
Caiweiran
9d08596a2e tests: fix RISC-V failures and adjust transmute-scalar.rs target
Resolve several ./x test failures on RISC-V caused by ABI and codegen
differences. Update multiple codegen-llvm tests for compatibility, and
explicitly set the target for transmute-scalar.rs to x86_64 to ensure
consistent behavior across hosts.
2025-08-18 19:37:13 +00:00
Augie Fackler
79d30067f3 cleanup: make run-make test use run_in_tmpdir
We had an issue on our LLVM-head Rust builder where it got stuck with
this test failing because it was reusing the tmpdir between runs and
something broke the incremental compile. Everything seems to work fine
with run_in_tmpdir in this test. tests/run-make/uefi-qemu also uses the
same tmpdir across runs, but I don't have the right environment to test
that so I didn't try fixing it. That is the only use of
std::env::temp_dir left in run-make tests after this fix.
2025-08-18 15:28:48 -04:00
Nick Drozd
64d6f82825 Cut needless mut 2025-08-18 15:16:04 -04:00
bit-aloo
f960e368a9
remove downstream new method 2025-08-18 23:51:35 +05:30
Ralf Jung
ece1397e3f interpret: fix in-place return place semantics when the return place expression is a local variable 2025-08-18 19:45:29 +02:00
Ralf Jung
704cb8f189 interpret: avoid forcing all integer newtypes into memory during clear_provenance 2025-08-18 19:18:27 +02:00
binarycat
aa3008d52e implement std::fs::set_permissions_nofollow on unix 2025-08-18 11:37:19 -05:00
dswij
0e4ce7ffff
msrv: replace nested ifs with guard clauses (#15490)
reads a bit more natural imo

changelog: none
2025-08-18 16:23:22 +00:00
Lewis McClelland
0e47f19ffc
Specify linker scripts after user link args 2025-08-18 11:50:20 -04:00
bors
aaf87a6d28 Auto merge of #145478 - weihanglo:update-cargo, r=weihanglo
Update cargo

28 commits in 840b83a10fb0e039a83f4d70ad032892c287570a..71eb84f21aef43c07580c6aed6f806a6299f5042
2025-07-30 13:59:19 +0000 to 2025-08-17 17:18:56 +0000
- update tests to match lint message changes from rust-lang/rust#140794 (rust-lang/cargo#15849)
- chore: downgrade to libc@0.2.174 (rust-lang/cargo#15851)
- Reorder `lto` options in profiles.md (rust-lang/cargo#15841)
- feat(unstable): add -Zbuild-analysis unstable feature (rust-lang/cargo#15845)
- refactor(unstable): group stabilized features (rust-lang/cargo#15846)
- Fixes error while running the cargo clippy --all-targets -- -D warning (rust-lang/cargo#15843)
- Clarify that `cargo doc --no-deps` is cumulative and won’t delete prev (rust-lang/cargo#15800)
- docs: Formatting and cross-linking to build-dir/target-dir docs (rust-lang/cargo#15840)
- Stabilize `build.build-dir` (rust-lang/cargo#15833)
- make resolve features public for cargo-as-a-library (rust-lang/cargo#15835)
- chore(deps): bump slab from 0.4.10 to 0.4.11 (rust-lang/cargo#15832)
- chore: remove x86_64-apple-darwin from CI and tests (rust-lang/cargo#15831)
- chore(deps): update msrv (3 versions) to v1.87 (rust-lang/cargo#15819)
- perf(package): Always reuse the workspace's target-dir (rust-lang/cargo#15783)
- More helpful error for invalid cargo-features = [] (rust-lang/cargo#15781)
- Add initial integration for `--json=timings` behing `-Zsection-timings` (rust-lang/cargo#15780)
- add is_inherited methods to InheritableDependency and InheritableField (rust-lang/cargo#15828)
- chore(deps): update compatible (rust-lang/cargo#15804)
- docs(unstable): Link out to the Plumbing commands effort (rust-lang/cargo#15821)
- chore(deps): update cargo-semver-checks to v0.43.0 (rust-lang/cargo#15825)
- test(build-std): relax the thread name assertion (rust-lang/cargo#15822)
- chore(deps): update msrv (1 version) to v1.89 (rust-lang/cargo#15815)
- Update semver tests for 1.89 (rust-lang/cargo#15816)
- Accessing each build script's `OUT_DIR` and in the correct order (rust-lang/cargo#15776)
- chore: bump to 0.92.0; update changelog (rust-lang/cargo#15807)
- docs: `-Zpackage-workspace` has been stabilized (rust-lang/cargo#15808)
- chore(deps): update rust crate cargo_metadata to 0.21.0 (rust-lang/cargo#15795)
- docs(build-rs): Fix broken intra-doc links (rust-lang/cargo#15810)
2025-08-18 15:48:44 +00:00
Michael Howell
79a40c9469 rustdoc: add rustdoc top bar web component 2025-08-18 08:40:01 -07:00
Lewis McClelland
dbb8190b9c
Add VEXos "linked files" support to armv7a-vex-v5
Third-party programs running on the VEX V5
platform need a linker script to ensure code and
data are always placed in the allowed range
`0x3800000-0x8000000` which is read/write/execute.
However, users can also configure the operating
system to preload a separate file at any location
between these two addresses before the program
starts (as a sort of basic linking system).
Programs have to know about this at
compile time - in the linker script - to avoid
placing data in a spot that overlaps where the
file will be loaded. This is a very popular
feature with existing V5 runtimes because it can be
used to modify a program's behavior without
re-uploading the entire binary to the robot
controller. Also, while VEXos's user-exposed
file system APIs may only read data from an external
SD card, linked files have the advantage of being
able to load data directly from the device's
onboard storage.

This PR adds the `__linked_file_start` symbol
to the existing VEX V5 linker script which can be
used to shrink the stack and heap so that they
do not overlap with the memory region containing a
linked file.

With these changes, a developer targeting VEX V5
might add a second linker script to their project
by specifying `-Clink-arg=-Tcustom.ld` and creating
the file `custom.ld` to configure their custom
memory layout:

```ld
/* Reserve 10MiB for a linked file. */
/* (0x7600000-0x8000000) */
__linked_file_start = __linked_file_end - 10M;

/* Optional: specify one or more sections that */
/* represent the developer's custom format. */
SECTIONS {
    .linked_file_metadata (NOLOAD) : {
        __linked_file_metadata_start = .
        . += 1M;
        __linked_file_metadata_end = .
    }
    .linked_file_data (NOLOAD) : {
        __linked_file_data_start = .
        . += 9M;
        __linked_file_data_end = .
    }
} INSERT AFTER .stack;
```

Then, using an external tool like the `vex-v5-serial`
crate, they would configure the metadata of their
uploaded program to specify the path of their linked file
and the address where it should be loaded into memory
(in this example, 0x7600000).
2025-08-18 11:35:51 -04:00
Deadbeef
c6db6f20ff comment style changes 2025-08-18 23:33:27 +08:00
Alejandra González
73b5a59c22
Do not suggest to use implicit DerefMut on ManuallyDrop reached through unions (#14387)
This requires making the `deref_addrof` lint a late lint instead of an
early lint to check for types.

changelog: [`deref_addrof`]: do not suggest implicit `DerefMut` on
`ManuallyDrop` union fields

Fix rust-lang/rust-clippy#14386
2025-08-18 15:10:31 +00:00
Jieyou Xu
d2e126435a
Add change tracker entry for --timings 2025-08-18 22:50:13 +08:00
Ralf Jung
3248d8658b
Merge pull request #4529 from RalfJung/triagebot-range-diff-awesomeness
triagebot: Show range-diff links on force pushes
2025-08-18 14:45:47 +00:00
Ralf Jung
ba85edf16b triagebot: Show range-diff links on force pushes 2025-08-18 16:19:08 +02:00
Deadbeef
c335d5781d ignore frontmatters in TokenStream::new 2025-08-18 20:28:29 +08:00
Ralf Jung
70fe61fa07
Merge pull request #4523 from Stypox/data-race-tracing
Add tracing to data race functions
2025-08-18 11:38:24 +00:00
github-actions
21e9889306 cargo update
compiler & tools dependencies:
     Locking 28 packages to latest compatible versions
    Updating anyhow v1.0.98 -> v1.0.99
    Updating bitflags v2.9.1 -> v2.9.2
    Updating clap v4.5.43 -> v4.5.45
    Updating clap_builder v4.5.43 -> v4.5.44
    Updating clap_derive v4.5.41 -> v4.5.45
    Updating curl v0.4.48 -> v0.4.49
    Updating curl-sys v0.4.82+curl-8.14.1 -> v0.4.83+curl-8.15.0
    Updating cxx v1.0.166 -> v1.0.168
    Updating cxx-build v1.0.166 -> v1.0.168
    Updating cxxbridge-cmd v1.0.166 -> v1.0.168
    Updating cxxbridge-flags v1.0.166 -> v1.0.168
    Updating cxxbridge-macro v1.0.166 -> v1.0.168
    Updating glob v0.3.2 -> v0.3.3
    Updating object v0.37.2 -> v0.37.3
    Updating proc-macro2 v1.0.95 -> v1.0.101
    Updating rayon v1.10.0 -> v1.11.0
    Updating rayon-core v1.12.1 -> v1.13.0
    Updating serde-untagged v0.1.7 -> v0.1.8
    Updating socket2 v0.5.10 -> v0.6.0
    Updating syn v2.0.104 -> v2.0.106
    Updating thiserror v2.0.12 -> v2.0.15
    Updating thiserror-impl v2.0.12 -> v2.0.15
    Updating uuid v1.17.0 -> v1.18.0
    Updating wasm-encoder v0.236.0 -> v0.236.1
    Updating wasmparser v0.236.0 -> v0.236.1
    Updating wast v236.0.0 -> v236.0.1
    Updating wat v1.236.0 -> v1.236.1
note: pass `--verbose` to see 35 unchanged dependencies behind latest

library dependencies:
     Locking 2 packages to latest compatible versions
    Updating libc v0.2.174 -> v0.2.175
    Updating object v0.37.2 -> v0.37.3
note: pass `--verbose` to see 2 unchanged dependencies behind latest

rustbook dependencies:
     Locking 13 packages to latest compatible versions
    Updating anyhow v1.0.98 -> v1.0.99
    Updating bitflags v2.9.1 -> v2.9.2
    Updating cc v1.2.32 -> v1.2.33
    Updating clap v4.5.43 -> v4.5.45
    Updating clap_builder v4.5.43 -> v4.5.44
    Updating clap_complete v4.5.56 -> v4.5.57
    Updating clap_derive v4.5.41 -> v4.5.45
    Updating proc-macro2 v1.0.95 -> v1.0.101
    Updating syn v2.0.104 -> v2.0.106
    Updating terminal_size v0.4.2 -> v0.4.3
    Updating thiserror v2.0.12 -> v2.0.15
    Updating thiserror-impl v2.0.12 -> v2.0.15
2025-08-18 11:28:41 +00:00
Jakub Beránek
a6a760edaf
Remove the From derive macro from prelude
To avoid backwards compatibility problems.
2025-08-18 13:12:19 +02:00
bors
239e8b1b47 Auto merge of #145551 - Zalathar:rollup-eo75r94, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#144838 (Fix outdated doc comment)
 - rust-lang/rust#145206 (Port `#[custom_mir(..)]` to the new attribute system)
 - rust-lang/rust#145208 (Implement declarative (`macro_rules!`) derive macros (RFC 3698))
 - rust-lang/rust#145309 (Fix `-Zregparm` for LLVM builtins)
 - rust-lang/rust#145355 (Add codegen test for issue 122734)
 - rust-lang/rust#145420 (cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind`)
 - rust-lang/rust#145451 (Add static glibc to the nix dev shell)
 - rust-lang/rust#145460 (Speedup `copy_src_dirs` in bootstrap)
 - rust-lang/rust#145476 (Fix typo in doc for library/std/src/fs.rs#set_permissions)
 - rust-lang/rust#145485 (Fix deprecation attributes on foreign statics)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-18 10:58:17 +00:00
Jakub Beránek
a1f5bbeed8
Provide more useful command creation spans 2025-08-18 12:41:12 +02:00
Jakub Beránek
4668751e52
Print what bootstrap invocation failed when an error happens in CI 2025-08-18 12:35:20 +02:00
Alexandre Courbot
73d3d28bed Implement feature int_lowest_highest_one for integer and NonZero types
Implement the accepted ACP for methods that find the index of the least
significant (lowest) and most significant (highest) set bit in an
integer for signed, unsigned, and NonZero types.

Also add unit tests for all these types.
2025-08-18 18:59:44 +09:00
Jakub Beránek
e31aea8903
Remove unused PartialOrd/Ord from bootstrap 2025-08-18 10:56:51 +02:00
MarcoIeni
4f7248207c
ci: add timeout to windows disk cleanup wait 2025-08-18 10:47:22 +02:00
Jakub Beránek
22519d3c2d
Do not overwrite the value of RUSTC_ADDITIONAL_SYSROOT_PATHS 2025-08-18 10:46:33 +02:00
Bastian Kersting
95bdb34494 Remove the no_sanitize attribute in favor of sanitize
This removes the #[no_sanitize] attribute, which was behind an unstable
feature named no_sanitize. Instead, we introduce the sanitize attribute
which is more powerful and allows to be extended in the future (instead
of just focusing on turning sanitizers off).

This also makes sanitize(kernel_address = ..) attribute work with
-Zsanitize=address

To do it the same as how clang disables address sanitizer, we now
disable ASAN on sanitize(kernel_address = "off") and KASAN on
sanitize(address = "off").

The same was added to clang in https://reviews.llvm.org/D44981.
2025-08-18 08:45:28 +00:00
Bastian Kersting
3ef065bf87 Implement the #[sanitize(..)] attribute
This change implements the #[sanitize(..)] attribute, which opts to
replace the currently unstable #[no_sanitize]. Essentially the new
attribute works similar as #[no_sanitize], just with more flexible
options regarding where it is applied. E.g. it is possible to turn
a certain sanitizer either on or off:
`#[sanitize(address = "on|off")]`

This attribute now also applies to more places, e.g. it is possible
to turn off a sanitizer for an entire module or impl block:
```rust
\#[sanitize(address = "off")]
mod foo {
    fn unsanitized(..) {}

    #[sanitize(address = "on")]
    fn sanitized(..) {}
}

\#[sanitize(thread = "off")]
impl MyTrait for () {
    ...
}
```

This attribute is enabled behind the unstable `sanitize` feature.
2025-08-18 08:30:00 +00:00
Jonathan Brouwer
d4175033f0
Allow stability attributes on extern crates 2025-08-18 10:05:11 +02:00
Ralf Jung
909d3297af
Merge pull request #4528 from rust-lang/rustup-2025-08-18
Automatic Rustup
2025-08-18 07:19:57 +00:00
lcnr
f5e43d5ee3 nll-relate: improve hr opaque types support 2025-08-18 09:09:42 +02:00
David Wood
abcfa4390d
remove myself from some adhoc-groups and pings 2025-08-18 06:36:42 +00:00
Tshepang Mbambo
2787e9ebf9
Merge pull request #2547 from rust-lang/rustc-pull
Rustc pull update
2025-08-18 08:31:49 +02:00
Jakub Beránek
abecf68112
Trace some basic I/O operations in bootstrap 2025-08-18 08:05:56 +02:00
Stuart Cook
ab57f43bc8
Rollup merge of #145485 - JonathanBrouwer:fix-deprecation-targets, r=jdonszelmann
Fix deprecation attributes on foreign statics

r? ````````@jdonszelmann````````

Fixes https://github.com/rust-lang/rust/issues/145437
2025-08-18 15:31:15 +10:00