about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-25fix gce typing_mode mismatchlcnr-18/+89
2024-11-25Auto merge of #133247 - GuillaumeGomez:reduce-integer-display-impl, ↵bors-48/+32
r=workingjubilee Reduce integer `Display` implementation size I was thinking about #128204 and how we could reduce the size of the code and just realized that we didn't need the `_fmt` method to be implemented on signed integers, which in turns allow to simplify greatly the macro call. r? `@workingjubilee`
2024-11-25Auto merge of #133433 - matthiaskrgr:rollup-lfa3wp1, r=matthiaskrgrbors-198/+1655
Rollup of 8 pull requests Successful merges: - #131523 (Fix asm goto with outputs and move it to a separate feature gate) - #131664 (Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature)) - #132432 (Add a test to verify that libstd doesn't use protected symbols) - #132502 (Document possibility to set core features in example config.toml) - #132529 (ci(triagebot): add more top-level files to A-meta) - #132533 (Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime) - #132803 (Fix broken url) - #132982 (alloc: fix `Allocator` method names in `alloc` free function docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-25Rollup merge of #132982 - suaviloquence:2-doc-changed-alloc-methods, ↵Matthias Krüger-4/+4
r=Mark-Simulacrum alloc: fix `Allocator` method names in `alloc` free function docs It looks like these got renamed in https://github.com/rust-lang/rust/commit/9274b37d99f608e5fde569788ee79bd72fc3cf13 but the docs never updated. I couldn't find any history for `Allocator::realloc`. The `grow` API is not 1:1 (e.g., it returns a result), so this may not be the correct change - let me know and I can change the method or even remove this entirely.
2024-11-25Rollup merge of #132803 - wangjingcun:master, r=Mark-SimulacrumMatthias Krüger-1/+1
Fix broken url
2024-11-25Rollup merge of #132533 - SUPERCILEX:patch-4, r=Mark-SimulacrumMatthias Krüger-0/+20
Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime See https://github.com/rust-lang/libs-team/issues/473 and tracking issue https://github.com/rust-lang/rust/issues/117693.
2024-11-25Rollup merge of #132529 - ↵Matthias Krüger-0/+6
ismailarilik:ci/triagebot/fix-name-of-trigger-file-LICENSES, r=Mark-Simulacrum ci(triagebot): add more top-level files to A-meta It didn't exist so I changed it with its new versions: `COPYRIGHT`, `LICENSE-APACHE` and `LICENSE-MIT` I also added some other files I found appropriate under the related label.
2024-11-25Rollup merge of #132502 - ↵Matthias Krüger-0/+4
Voultapher:document-core-features-in-config-toml-example, r=Mark-Simulacrum Document possibility to set core features in example config.toml
2024-11-25Rollup merge of #132432 - davidlattimore:std-interposable, r=Mark-SimulacrumMatthias Krüger-0/+63
Add a test to verify that libstd doesn't use protected symbols
2024-11-25Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=AmanieuMatthias Krüger-143/+1379
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature) This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output. This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before. | Architecture | Register class | Target feature | Allowed types | | ------------ | -------------- | -------------- | -------------- | | s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` | This matches the list of types that are supported by the vector registers in LLVM: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313 In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable. Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869. cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm `@rustbot` label +O-SystemZ +A-inline-assembly
2024-11-25Rollup merge of #131523 - nbdd0121:asm, r=compiler-errorsMatthias Krüger-50/+178
Fix asm goto with outputs and move it to a separate feature gate Tracking issue: #119364 This PR addresses 3 aspects of asm goto with outputs: * Codegen is fixed. My initial implementation has an oversight which cause the output to be only stored in fallthrough path, but not in label blocks. * Outputs can now be used with `options(noreturn)` if a label block is given. * All of this is moved to a new feature gate, because we likely want to stabilise `asm_goto` before asm goto with outputs. `@rustbot` labels: +A-inline-assembly +F-asm
2024-11-25Auto merge of #133236 - dtolnay:unicodelicense, r=Mark-Simulacrumbors-67/+77
Synchronize Unicode license text from unicode.org The text of <https://unicode.org/license.txt> was swapped out from "UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE" to "UNICODE LICENSE V3" between the dates of [2023.06.03](https://web.archive.org/web/20230603182532/https://www.unicode.org/license.txt) and [2023.09.11](https://web.archive.org/web/20230911222703/https://www.unicode.org/license.txt), which means between Unicode 15.0.0 ([2022.09.13](https://unicode.org/versions/Unicode15.0.0/)) and Unicode 15.1.0 ([2023.09.12](https://unicode.org/versions/Unicode15.1.0/)). A license wording change is not mentioned in the 15.1.0 [release summary](https://www.unicode.org/versions/Unicode15.1.0/) or [announcement post](http://blog.unicode.org/2023/09/announcing-unicode-standard-version-151.html). But I guess we are intended to infer that data files from Unicode 15.1.0 should be specified as licensed [Unicode-3.0](https://spdx.org/licenses/Unicode-3.0.html) as opposed to [Unicode-DFS-2016](https://spdx.org/licenses/Unicode-DFS-2016.html). The Rust standard library has been using Unicode 15.1.0+ since https://github.com/rust-lang/rust/pull/120777.
2024-11-24fix `Allocator` method names in `alloc` free function docsm-4/+4
2024-11-24Auto merge of #133423 - jieyouxu:rollup-m3gyoz6, r=jieyouxubors-120/+269
Rollup of 6 pull requests Successful merges: - #132730 (std: allow after-main use of synchronization primitives) - #133105 (only store valid proc macro item for doc link) - #133260 (Constify the `Deref`/`DerefMut` traits, too) - #133297 (Remove legacy bitcode for iOS) - #133298 (Mention that std::fs::remove_dir_all fails on files) - #133384 (add a test for target-feature-ABI warnings in closures and when calling extern fn) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-25Rollup merge of #133384 - RalfJung:vector-abi-check-tests, r=jieyouxu许杰友 Jieyou Xu (Joe)-22/+95
add a test for target-feature-ABI warnings in closures and when calling extern fn Also update the comment regarding the inheritance of target features into closures, to make it more clear that we really shouldn't do this right now.
2024-11-25Rollup merge of #133298 - n0toose:remove-dir-all-but-not-paths, r=Noratrieb许杰友 Jieyou Xu (Joe)-1/+2
Mention that std::fs::remove_dir_all fails on files This is explicitly mentioned for std::fs::remove_file. It is more likely for a slightly lazy programmer to believe that removing a file would work and that they do not have to distinguish between directories (with contents) and files themself, because of the function's recursive nature and how it distinguishes between files and directories when removing them. Follow-up for #133183.
2024-11-25Rollup merge of #133297 - DianQK:embed-bitcode-ios, r=nikic许杰友 Jieyou Xu (Joe)-35/+8
Remove legacy bitcode for iOS Follow #117364.
2024-11-25Rollup merge of #133260 - compiler-errors:deref, r=fee1-dead许杰友 Jieyou Xu (Joe)-21/+60
Constify the `Deref`/`DerefMut` traits, too One more constification. Rebased on that one commit that makes it so we don't need to provide stability on const impls. r? fee1-dead
2024-11-25Rollup merge of #133105 - bvanjoi:issue-132743, r=petrochenkov许杰友 Jieyou Xu (Joe)-15/+45
only store valid proc macro item for doc link Fixes #132743 The definition item can be detected if it is exported in the doc, so store these items rather than skipping. r? `@petrochenkov`
2024-11-25Rollup merge of #132730 - joboet:after_main_sync, r=Noratrieb许杰友 Jieyou Xu (Joe)-26/+59
std: allow after-main use of synchronization primitives By creating an unnamed thread handle when the actual one has already been destroyed, synchronization primitives using thread parking can be used even outside the Rust runtime. This also fixes an inefficiency in the queue-based `RwLock`: if `thread::current` was not initialized yet, it will create a new handle on every parking attempt without initializing `thread::current`. The private `current_or_unnamed` function introduced here fixes this.
2024-11-24Auto merge of #133068 - jieyouxu:download-rustc-default-only-for-tools, ↵bors-13/+75
r=clubby789 Use `download-rustc=false` global default, `if-unchanged` for tools and library profiles, and make `rust.debug-assertions=true` inhibit downloading CI rustc - Use `download-rustc = false` as global default. - Use `download-rustc = 'if-unchanged'` for tools and library profiles. - Make `rust.debug-assertions = true` inhibit downloading CI rustc because alt rustc builds do not yet have rustc debug assertions enabled. Fixes #133132. cc discussions: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20breakage compiler contributors poll: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/.60download-rustc.20.3D.20'if-unchanged'.60.20for.20.60compiler.60.20profile.3F/near/481877253 library contributors poll: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/.60download-rustc.20.3D.20.22if-unchanged.22.60.20default.20for.20libs.20profile.3F/near/482607011 cc https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/When.20is.20rustc.20built.20with.20debug.20assertions.3F cc `@MarcoIeni` since you're working on improving CI job times, sorry, this will definitely regress some CI job times because we're probably lying to ourselves that CI rustc had debug assertions for some time 😅 cc `@onur-ozkan` for FYI, but since you're on vacation (sorry for the ping), r? `@Kobzol` (I *think* you have a bit more context than other bootstrap reviewers?)
2024-11-24Make asm_goto_with_outputs a separate feature gateGary Guo-11/+68
2024-11-24Support use of asm goto with outputs and `options(noreturn)`Gary Guo-5/+45
When labels are present, the `noreturn` option really means that asm block won't fallthrough -- if labels are present, then outputs can still be meaningfully used.
2024-11-24Fix asm goto with outputsGary Guo-37/+68
When outputs are used together with labels, they are considered to be written for all destinations, not only when falling through.
2024-11-24Make s390x non-clobber-only vector register support unstableTaiki Endo-145/+822
2024-11-24Auto merge of #133415 - matthiaskrgr:rollup-n1ivyd5, r=matthiaskrgrbors-111/+90
Rollup of 6 pull requests Successful merges: - #133300 (inject_panic_runtime(): Avoid double negation for 'any non rlib') - #133301 (Add code example for `wrapping_neg` method for signed integers) - #133371 (remove is_trivially_const_drop) - #133389 (Stabilize `const_float_methods`) - #133398 (rustdoc: do not call to_string, it's already impl Display) - #133405 (tidy: Distinguish between two different meanings of "style file") r? `@ghost` `@rustbot` modify labels: rollup
2024-11-24Rollup merge of #133405 - Zalathar:style-file, r=jieyouxuMatthias Krüger-9/+13
tidy: Distinguish between two different meanings of "style file" This file contains code that uses “style file” to mean “CSS file”, and other code that uses “style file” to mean “this file, which implements the style checker”. That's very confusing, so it's easier to just say *CSS file* or *this file* as appropriate. No functional change.
2024-11-24Rollup merge of #133398 - klensy:rd-to-string, r=aDotInTheVoidMatthias Krüger-1/+1
rustdoc: do not call to_string, it's already impl Display `anchor` returns impl Display, so no need to call to_string().
2024-11-24Rollup merge of #133389 - eduardosm:stabilize-const_float_methods, r=RalfJungMatthias Krüger-51/+70
Stabilize `const_float_methods` Tracking issue: https://github.com/rust-lang/rust/issues/130843 Relnotes: #133383 Stabilized const API: ```rust // in `core` impl f32/f64 { pub const fn recip(self) -> Self; pub const fn to_degrees(self) -> Self; pub const fn to_radians(self) -> Self; pub const fn max(self, other: Self) -> Self; pub const fn min(self, other: Self) -> Self; pub const fn clamp(self, min: Self, max: Self) -> Self; pub const fn abs(self) -> Self; pub const fn signum(self) -> Self; pub const fn copysign(self, sign: Self) -> Self; } ``` Closes https://github.com/rust-lang/rust/issues/130843 r? libs-api cc `@RalfJung` -- I think the way const-stability attributes work have change a bit since the last time a wrote a const-stabilization PR, please make sure I got them right.
2024-11-24Rollup merge of #133371 - RalfJung:is_trivially_const_drop, r=compiler-errorsMatthias Krüger-48/+3
remove is_trivially_const_drop I'm not sure this still brings any perf benefits, so let's benchmark this. r? `@compiler-errors`
2024-11-24Rollup merge of #133301 - GuillaumeGomez:add-example-wrapping-neg, ↵Matthias Krüger-0/+1
r=workingjubilee Add code example for `wrapping_neg` method for signed integers With this example, we make it obvious that `wrapping_neg` works both ways (neg to pos and pos to neg). r? `@workingjubilee`
2024-11-24Rollup merge of #133300 - Enselic:build-std-instrument-coverage, r=jieyouxuMatthias Krüger-2/+2
inject_panic_runtime(): Avoid double negation for 'any non rlib' <details> <summary>This PR originally did more things .Click to expand to see.</summary> By not trying to inject a profiler runtime when only building an rlib. This logic already exists for the panic runtime. This makes RUSTFLAGS="-Cinstrument-coverage" cargo build -Zbuild-std=std,profiler_builtins work. Note that you probably also need `RUST_COMPILER_RT_FOR_PROFILER=$src/llvm-project/compiler-rt` in your environment. cc #79401 # Demonstration Before this fix you get these errors: ```console $ rm -rf target ; RUST_COMPILER_RT_FOR_PROFILER=/home/martin/src/llvm-project/compiler-rt RUSTFLAGS="-Cinstrument-coverage" cargo +nightly build --release -Zbuild-std=std,profiler_builtins error: `profiler_builtins` crate (required by compiler options) is not compatible with crate attribute `#![no_core]` error[E0152]: found duplicate lang item `manually_drop` = note: first definition in `core` loaded from /home/martin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-d453bab70303062c.rlib = note: second definition in the local crate (`core`) ``` With the fix the build succeeds: ```console $ rm -rf target ; RUST_COMPILER_RT_FOR_PROFILER=/home/martin/src/llvm-project/compiler-rt RUSTFLAGS="-Cinstrument-coverage" cargo +stage1 build --release -Zbuild-std=std,profiler_builtins Finished `release` profile [optimized] target(s) in 45.57s ``` And we can check code coverage. My example program looks like this: ```rs fn main() { if std::env::args_os().nth(1) == Some("write-file".into()) { std::fs::write("hello.txt", "Hello, world!").unwrap(); } else { println!("Hello, world!"); } } ``` when the program prints to stdout: ``` $ LLVM_PROFILE_FILE=stdout.profraw ./target/release/hello-world Hello, world! ``` we can see that `fs::write()` is not being used (note the `0`'s): ```console $ /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -sparse stdout.profraw -o stdout.profdata $ /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov show target/release/hello-world --sources /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std/src/fs.rs --instr-profile stdout.profdata --color | grep -A 3 'pub fn write(&mut self, write: b ool) -> &mut Self {' 1357| 0| pub fn write(&mut self, write: bool) -> &mut Self { 1358| 0| self.0.write(write); 1359| 0| self 1360| 0| } ``` but when we print to a file: ```console $ LLVM_PROFILE_FILE=file.profraw ./target/release/hello-world write-file ``` the code coverage shows `fs::write()` as being used (note the `1`'s): ```console $ /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -sparse file.profraw -o file.profdata $ /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov show target/release/hello-world --sources /home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std/src/fs.rs --instr-profile file.profdata --color | grep -A 3 'pub fn write(&mut self, write: bool) -> &mut Self {' 1357| 1| pub fn write(&mut self, write: bool) -> &mut Self { 1358| 1| self.0.write(write); 1359| 1| self 1360| 1| } ``` </summary>
2024-11-24add vector ABI check test for calling extern fnRalf Jung-11/+61
2024-11-24add a test for target-feature-ABI warnings in closuresRalf Jung-13/+36
2024-11-24Remove forces_embed_bitcodeDianQK-9/+2
2024-11-24embed-bitcode is no longer used in iOSDianQK-26/+6
2024-11-24Auto merge of #132791 - tyilo:big-file-fail-fast, r=compiler-errorsbors-1/+15
rustc: Fail fast when compiling a source file larger than 4 GiB Currently if you try to compile a file that is larger than 4 GiB, `rustc` will first read the whole into memory before failing. If we can read the metadata of the file, we can fail before reading the file.
2024-11-24Auto merge of #132611 - compiler-errors:async-prelude, r=ibraheemdevbors-0/+3
Add `AsyncFn*` to the prelude in all editions The general vibe is that we will most likely stabilize the `feature(async_closure)` *without* the `async Fn()` trait bound modifier. Without `async Fn()` bound syntax, this necessitates users to spell the bound like `AsyncFn()`. Since `core::ops::AsyncFn` is not in the prelude, users will need to import these any time they actually want to use the trait. This seems annoying, so let's add these traits to the prelude unstably. We're trying to work on the general vision of `async` trait bound modifier in general in: https://github.com/rust-lang/rfcs/pull/3710, however that RFC still needs more time for consensus to converge, and we've decided that the value that users get from calling the bound `async Fn()` is *not really* worth blocking landing async closures in general.
2024-11-24tidy: Distinguish between two different meanings of "style file"Zalathar-9/+13
2024-11-24Auto merge of #132597 - lukas-code:btree-plug-leak, r=jhprattbors-2/+64
btree: don't leak value if destructor of key panics This PR fixes a regression from https://github.com/rust-lang/rust/pull/84904. The `BTreeMap` already attempts to handle panicking destructors of the key-value pairs by continuing to execute the remaining destructors after one destructor panicked. However, after #84904 the destructor of a value in a key-value pair gets skipped if the destructor of the key panics, only continuing with the next key-value pair. This PR reverts to the behavior before #84904 to also drop the corresponding value if the destructor of a key panics. This avoids potential memory leaks and can fix the soundness of programs that rely on the destructors being executed (even though this should not be relied upon, because the std collections currently do not guarantee that the remaining elements are dropped after a panic in a destructor). cc `@Amanieu` because you had opinions on panicking destructors
2024-11-24Constify Deref and DerefMutMichael Goulet-21/+60
2024-11-23Auto merge of #131859 - chriskrycho:update-trpl, r=onur-ozkanbors-147/+236
Update TRPL to add new Chapter 17: Async and Await - Add support to `rustbook` to pass through the `-L`/`--library-path` flag to `mdbook` so that references to the `trpl` crate - Build the `trpl` crate as part of the book tests. Make it straightforward to add other such book dependencies in the future if needed by implementing that in a fairly general way. - Update the submodule for the book to pull in the new chapter on async and await, as well as a number of other fixes. This will happen organically/automatically in a week, too, but this lets me group this change with the next one: - Update the compiler messages which reference the existing chapters 17–20, which are now chapters 18-21. There are only two, both previously referencing chapter 18. - Update the UI tests which reference the compiler message outputs.
2024-11-23Auto merge of #133379 - jieyouxu:rollup-00jxo71, r=jieyouxubors-90/+922
Rollup of 4 pull requests Successful merges: - #133217 ([AIX] Add option -X32_64 to the "strip" command) - #133237 (Minimally constify `Add`) - #133355 (Add language tests for aggregate types) - #133374 (show abi_unsupported_vector_types lint in future breakage reports) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-23do not to_string, use displayklensy-1/+1
2024-11-23Auto merge of #133242 - lcnr:questionable-uwu, r=compiler-errors,BoxyUwUbors-531/+346
finish `Reveal` removal After #133212 changed the `TypingMode` to be the only source of truth, this entirely rips out `Reveal`. cc #132279 r? `@compiler-errors`
2024-11-23Stabilize `const_float_methods`Eduardo Sánchez Muñoz-51/+70
2024-11-23Vendor `trpl` crate so The Book tests work offlineChris Krycho-0/+1
Without this change: $ ./x test --set build.vendor=true src/doc/book # (lots of output) error: failed to select a version for the requirement `futures = "^0.3"` (locked to 0.3.30) candidate versions found which didn't match: 0.3.31, 0.3.27 location searched: directory source `/Users/chris/dev/rust-lang/rust/vendor` (which is replacing registry `crates-io`) required by package `trpl v0.2.0 (/Users/chris/dev/rust-lang/rust/src/doc/book/packages/trpl)` perhaps a crate was updated and forgotten to be re-vendored? Build completed unsuccessfully in 0:01:19 With this change: $ ./x test --set build.vendor=true src/doc/book # (lots of build output) Testing stage1 mdbook src/doc/book (aarch64-apple-darwin) finished in 86.949 seconds Build completed successfully in 0:04:05 # Conflicts: # src/bootstrap/src/core/build_steps/vendor.rs
2024-11-23ci: don't force CI rustc for `x86_64-gnu-tools`Jieyou Xu-1/+4
CI alt rustc builds do not have rustc debug assertions currently.
2024-11-23bootstrap: add change tracker entryJieyou Xu-0/+5
2024-11-23Update tests for new TRPL chapter orderChris Krycho-139/+139