about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-07-04Test building custom targets and resolve an issue probing `rustc`Trevor Gross-6/+63
The `rustc` probe done in our build scripts needs to pass `--target` to get the correct configuration, which usually comes from the `TARGET` environment variable. However, for targets specified via a `target.json` file, `TARGET` gets set to the file name without an extension or path. `rustc` will check a search path to attempt to locate the file, but this is likely to fail since the directory where Cargo invokes build scripts (and hence where those scripts invoke `rustc`) might not have any relation to the JSON spec file. Resolve this for now by leaving `f16` and `f128` disabled if the `rustc` command fails. Result of the discussion at CARGO-14208 may eventually provide a better solution. A CI test is also added since custom JSON files are an edge case that could fail in other ways. I verified this fails without the fix here. The JSON file is the output for `thumbv7em-none-eabi`, just renamed so `rustc` doesn't identify it.
2025-07-04Remove unused custom target JSON filesTrevor Gross-110/+0
8521530f4938 ("Fix __divsi3 and __udivsi3 on thumbv6m targets") removed tests that use these `thumb*-linux` target files in favor of tests that use the `thumb*-none` targets, which are available via Rustup. The JSON files haven't been used since then and are outdated, so remove them.
2025-07-04Make Rem const for floatsKurt Heiritz (pseudo)-1/+1
2025-07-04symcheck: Improve diagnostics from spawned CargoTrevor Gross-7/+22
Rather than printing the entire JSON dump, use the rendered version.
2025-07-04symcheck: Make `target` a positional argumentTrevor Gross-29/+35
This makes it more obvious what we intend to check rather than looking for `--target`.
2025-07-05Rollup merge of #141532 - Ayush1325:uefi-tcp4-send, r=tgross35Matthias Krüger-6/+53
std: sys: net: uefi: tcp4: Implement write A blocking implementation of tcp4 write.
2025-07-04Remove the `let_chains` feature now that it is stableTrevor Gross-2/+0
2025-07-04std: sys: net: uefi: tcp4: Implement writeAyush Singh-6/+53
A blocking implementation of tcp4 write. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-07-04Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3Matthias Krüger-4/+4
Make __rust_alloc_error_handler_should_panic a function Fixes rust-lang/rust#143253 `__rust_alloc_error_handler_should_panic` is a static but was being exported as a function. For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled. We've had issues in the past with statics like this (see rust-lang/rust#141061) but the tldr; is that Arm64EC needs symbols correctly exported as either a function or data, and data MUST and MUST ONLY be marked `dllimport` when the symbol is being imported from another binary, which is non-trivial to calculate for these compiler-generated statics. So, instead, the easiest thing to do is to make `__rust_alloc_error_handler_should_panic` a function instead. Since `__rust_alloc_error_handler_should_panic` isn't involved in any linking shenanigans, I've marked it as `AlwaysInline` with the hopes that the various backends will see that it is just returning a constant and perform the same optimizations as the previous implementation. r? `@bjorn3`
2025-07-04Rollup merge of #143308 - compiler-errors:no-pointer-like, r=oli-obkMatthias Krüger-54/+3
Remove `PointerLike` trait r? oli-obk
2025-07-04clippy fix: indentationMarijn Schouten-46/+47
2025-07-04clippy fix: rely on autoderefMarijn Schouten-7/+7
2025-07-04Rollup merge of #143395 - Urgau:llvm-fallback-minimum-maximum, r=tgross35Jacob Pratt-2/+2
Always use the pure Rust fallback instead of `llvm.{maximum,minimum}` While https://github.com/llvm/llvm-project/pull/142170 was merged, it was reverted and next attempt (https://github.com/llvm/llvm-project/pull/140193) at fixing the LLVM implementation seems to have stall, so let's reverted back to pure Rust with the LLVM codegen. cc [#t-compiler/llvm > &#96;llvm.minimum&#96;/&#96;llvm.maximum&#96; issues @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fllvm/topic/.60llvm.2Eminimum.60.2F.60llvm.2Emaximum.60.20issues/near/527044712) Fixes https://github.com/rust-lang/rust/issues/141087 r? `@tgross35`
2025-07-04Rollup merge of #143378 - hkBst:clippy-fix-6, r=tgross35Jacob Pratt-4/+4
simplify receivers for some array method calls
2025-07-04Rollup merge of #143370 - hkBst:clippy-fix-4, r=tgross35Jacob Pratt-4/+0
remove redundant #[must_use] Fixes these clippy warnings: ``` warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` --> library/core/src/cmp.rs:1456:5 | 1456 | fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: either add some descriptive message or remove the attribute = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use = note: `-D clippy::double-must-use` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]` warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` --> library/core/src/cmp.rs:1465:5 | 1465 | fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: either add some descriptive message or remove the attribute = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` --> library/core/src/cmp.rs:1474:5 | 1474 | fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: either add some descriptive message or remove the attribute = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` --> library/core/src/cmp.rs:1483:5 | 1483 | fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: either add some descriptive message or remove the attribute = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use ```
2025-07-04Rollup merge of #143356 - hkBst:clippy-fix-2, r=scottmcmJacob Pratt-1/+1
use unsigned_abs instead of `abs` on signed int to silence clippy Use `unsigned_abs` instead of `abs` on signed int to silence clippy. Alternatively we could allow the lint, but if codegen is not affected, then this seems preferable.
2025-07-04Rollup merge of #142749 - LimpSquid:bool_to_result, r=scottmcmJacob Pratt-0/+76
Add methods for converting bool to `Result<(), E>` ## Tracking Issue https://github.com/rust-lang/rust/issues/142748 ## ACP https://github.com/rust-lang/libs-team/issues/606
2025-07-03Remove PointerLike traitMichael Goulet-54/+3
2025-07-03Always use the pure Rust fallback instead of `llvm.{maximum,minimum}`Urgau-2/+2
2025-07-03Make __rust_alloc_error_handler_should_panic a functionDaniel Paoliello-4/+4
2025-07-03Use `slice_buffer_to_str` in `GenericRadix::fmt_int`Guillaume Gomez-18/+8
2025-07-03Add test for `int_format_into` featureGuillaume Gomez-20/+27
2025-07-03Implement `int_format_into` featureGuillaume Gomez-44/+290
2025-07-03stabilize `const_array_each_ref`Deadbeef-4/+4
2025-07-03stabilize `const_slice_reverse`Deadbeef-1/+2
2025-07-03simplify receivers for some array method callsMarijn Schouten-4/+4
2025-07-03remove redundant #[must_use]Marijn Schouten-4/+0
2025-07-03Rollup merge of #143329 - folkertdev:minicore-diagnostic-on-unimplemented, ↵Jana Dönszelmann-0/+3
r=jieyouxu minicore: use core's `diagnostic::on_unimplemented` messages Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to https://github.com/rust-lang/rust/issues/137531. The modified test files are reported in https://github.com/rust-lang/rust/issues/143319 as failing for `--target=riscv64gc-unknown-linux-gnu`. Using `minicore` for them makes it easier to troubleshoot this sort of issue. r? ``@jieyouxu``
2025-07-03Rollup merge of #143038 - Qelxiros:142676-private-dependency-traits, r=tgross35Jana Dönszelmann-2/+6
avoid suggesting traits from private dependencies fixes rust-lang/rust#142676 fixes rust-lang/rust#138191 r? ``@tgross35``
2025-07-03Rollup merge of #134006 - klensy:typos, r=nnethercoteJana Dönszelmann-33/+33
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03std_detect: Tidying of slice lengthTsukasa OI-2/+1
We don't need to put the length of the `riscv_hwprobe` array into a variable. This commit removes that variable and gives the length of the output slice to the `__riscv_hwprobe` directly.
2025-07-03Link to 2024 edition page for `!` fallback changesclubby789-5/+3
2025-07-03use unsigned_abs instead of `abs` on signed int to silence clippyMarijn Schouten-1/+1
2025-07-03wrapping shift: remove first bitmask and tableMarijn Schouten-42/+6
2025-07-03minicore: use core's `diagnostic::on_unimplemented` messagesFolkert de Vries-0/+3
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-33/+33
2025-07-03Rollup merge of #143327 - RalfJung:miri-type-validity-error, r=oli-obkMatthias Krüger-4/+11
miri: improve errors for type validity assertion failures Miri has pretty nice errors for type validity violations, printing which field in the type the problem occurs at and so on. However, we don't see these errors when using e.g. `mem::zeroed` as that uses `assert_zero_valid` to bail out before Miri can detect the UB. Similar to what we did with `@saethlin's` UB checks, I think we should disable such language UB checks in Miri so that we can get better error messages. If we go for this we should probably say this in the intrinsic docs as well so that people don't think they can rely on these intrinsics catching anything. Furthermore, I slightly changed `MaybeUninit::assume_init` so that the `.value` field does not show up in error messages any more. `@rust-lang/miri` what do you think?
2025-07-03Rollup merge of #143321 - hkBst:typo-1, r=compiler-errorsMatthias Krüger-1/+1
byte-addresses memory -> byte-addressed memory Small typo fix
2025-07-02Auto merge of #143338 - matthiaskrgr:rollup-ykaxh04, r=matthiaskrgrbors-347/+328
Rollup of 11 pull requests Successful merges: - rust-lang/rust#131923 (Derive `Copy` and `Hash` for `IntErrorKind`) - rust-lang/rust#138340 (Remove some unsized tuple impls now that we don't support unsizing tuples anymore) - rust-lang/rust#141219 (Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`) - rust-lang/rust#142212 (bootstrap: validate `rust.codegen-backends` & `target.<triple>.codegen-backends`) - rust-lang/rust#142237 (Detect more cases of unused_parens around types) - rust-lang/rust#142964 (Attribute rework: a parser for single attributes without arguments) - rust-lang/rust#143070 (Rewrite `macro_rules!` parser to not use the MBE engine itself) - rust-lang/rust#143235 (Assemble const bounds via normal item bounds in old solver too) - rust-lang/rust#143261 (Feed `explicit_predicates_of` instead of `predicates_of`) - rust-lang/rust#143276 (loop match: handle opaque patterns) - rust-lang/rust#143306 (Add `track_caller` attributes to trace origin of Clippy lints) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-07-02Mention that casting to *const () is a way to roundtrip with from_raw_partsManish Goregaokar-0/+3
2025-07-02awhile -> a while where appropriateнаб-2/+2
2025-07-02Rollup merge of #142237 - benschulz:unused-parens-fn, r=fee1-deadMatthias Krüger-1/+1
Detect more cases of unused_parens around types With this change, more unused parentheses around bounds and types nested within bounds are detected.
2025-07-02Rollup merge of #141219 - Amanieu:leak_alloc, r=joboetMatthias Krüger-316/+321
Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global` Also applies to `Vec::into_raw_parts`. The expectation is that you can round-trip these methods with `from_raw`, but this is only true when using the global allocator. With custom allocators you should instead be using `into_raw_with_allocator` and `from_raw_in`. The implementation of `Box::leak` is changed to use `Box::into_raw_with_allocator` and explicitly leak the allocator (which was already the existing behavior). This is because, for `leak` to be safe, the allocator must not free its underlying backing store. The `Allocator` trait only guarantees that allocated memory remains valid until the allocator is dropped.
2025-07-02Rollup merge of #138340 - oli-obk:one-size-fits-all, r=m-ou-seMatthias Krüger-29/+5
Remove some unsized tuple impls now that we don't support unsizing tuples anymore Since https://github.com/rust-lang/rust/pull/137728 there is no sound way to create unsized tuples anymore. While we can't remove them from the language (tried here: https://github.com/rust-lang/rust/pull/138093) due to people using `PhantomData<(T, U)>` where `U: ?Sized` (they'd have to use `(PhantomData<T>, PhantomData<U>)` now), we can remove the impls from libcore I believe. r? libs I guess?
2025-07-02Rollup merge of #131923 - ranger-ross:impl-copy-hash-interrorkind, r=tgross35Matthias Krüger-1/+1
Derive `Copy` and `Hash` for `IntErrorKind` This PR derives `Copy` and `Hash` for `IntErrorKind` to make it easier to work with. (see #131826) I think an argument could be made to also derive `PartialOrd` + `Ord` as well given that other error kinds in the std like [`io::ErrorKind`](https://doc.rust-lang.org/src/std/io/error.rs.html#212-428) do this. Granted these seem much less useful for errors. Fixes https://github.com/rust-lang/rust/issues/131826
2025-07-02Rollup merge of #142138 - ashivaram23:vec_into_chunks, r=scottmcmMatthias Krüger-0/+55
Add `Vec::into_chunks` Tracking issue rust-lang/rust#142137
2025-07-02Rollup merge of #141847 - xizheyin:141837, r=jhprattMatthias Krüger-15/+41
Explain `TOCTOU` on the top of `std::fs`, and reference it in functions Fixes rust-lang/rust#141837 r? ``````@workingjubilee``````
2025-07-02miri: improve errors for type validity assertion failuresRalf Jung-4/+11
2025-07-02Remove some unsized tuple impls now that we don't support unsizing tuples ↵Oli Scherer-29/+5
anymore
2025-07-02remove deprecated from core::ffi::c_strMarijn Schouten-17/+9