diff options
| author | bors <bors@rust-lang.org> | 2025-03-03 03:41:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-03 03:41:03 +0000 |
| commit | 81d8edc2000aa38b08ad09fce22d90f1990b6459 (patch) | |
| tree | 5d8ec74d6b4e87f59d322a08c024abb94ddcae75 /library | |
| parent | daf59857d6d2b87af4b846316bf1561a6083ed51 (diff) | |
| parent | 59fe0c77bb87da1b42cbb6bcc81c2ca90a8e6493 (diff) | |
| download | rust-81d8edc2000aa38b08ad09fce22d90f1990b6459.tar.gz rust-81d8edc2000aa38b08ad09fce22d90f1990b6459.zip | |
Auto merge of #137900 - matthiaskrgr:rollup-rvan5ao, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #137375 (Minor internal comments fix for `BufRead::read_line`) - #137641 (More precisely document `Global::deallocate()`'s safety.) - #137755 (doc: update Wasmtime flags) - #137851 (improve `simd_select` error message when used with invalid mask type) - #137860 (rustc_target: Add msync target feature and enable it on powerpcspe targets) - #137871 (fix `RangeBounds::is_empty` documentation) - #137873 (Disable `f16` on Aarch64 without `neon`) - #137876 (Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`) - #137883 (edit mailmap) - #137886 (`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library')
| -rw-r--r-- | library/alloc/src/alloc.rs | 10 | ||||
| -rw-r--r-- | library/core/src/ops/range.rs | 2 | ||||
| -rw-r--r-- | library/std/build.rs | 7 | ||||
| -rw-r--r-- | library/std/src/io/mod.rs | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index e686a02f29b..3bfdc68dcda 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -264,8 +264,14 @@ unsafe impl Allocator for Global { #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) { if layout.size() != 0 { - // SAFETY: `layout` is non-zero in size, - // other conditions must be upheld by the caller + // SAFETY: + // * We have checked that `layout` is non-zero in size. + // * The caller is obligated to provide a layout that "fits", and in this case, + // "fit" always means a layout that is equal to the original, because our + // `allocate()`, `grow()`, and `shrink()` implementations never returns a larger + // allocation than requested. + // * Other conditions must be upheld by the caller, as per `Allocator::deallocate()`'s + // safety documentation. unsafe { dealloc(ptr.as_ptr(), layout) } } } diff --git a/library/core/src/ops/range.rs b/library/core/src/ops/range.rs index e0c442e5292..1935268cda8 100644 --- a/library/core/src/ops/range.rs +++ b/library/core/src/ops/range.rs @@ -827,7 +827,7 @@ pub trait RangeBounds<T: ?Sized> { } /// Returns `true` if the range contains no items. - /// One-sided ranges (`RangeFrom`, etc) always return `true`. + /// One-sided ranges (`RangeFrom`, etc) always return `false`. /// /// # Examples /// diff --git a/library/std/build.rs b/library/std/build.rs index 723d1eb02e0..9df35ce3cc8 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -12,6 +12,11 @@ fn main() { .expect("CARGO_CFG_TARGET_POINTER_WIDTH was not set") .parse() .unwrap(); + let target_features: Vec<_> = env::var("CARGO_CFG_TARGET_FEATURE") + .unwrap_or_default() + .split(",") + .map(ToOwned::to_owned) + .collect(); let is_miri = env::var_os("CARGO_CFG_MIRI").is_some(); println!("cargo:rustc-check-cfg=cfg(netbsd10)"); @@ -101,6 +106,8 @@ fn main() { ("s390x", _) => false, // Unsupported <https://github.com/llvm/llvm-project/issues/94434> ("arm64ec", _) => false, + // LLVM crash <https://github.com/llvm/llvm-project/issues/129394> + ("aarch64", _) if !target_features.iter().any(|f| f == "neon") => false, // MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054> ("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false, // Infinite recursion <https://github.com/llvm/llvm-project/issues/97981> diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 980ea1478e0..7f610bc88bf 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -2534,7 +2534,7 @@ pub trait BufRead: Read { fn read_line(&mut self, buf: &mut String) -> Result<usize> { // Note that we are not calling the `.read_until` method here, but // rather our hardcoded implementation. For more details as to why, see - // the comments in `read_to_end`. + // the comments in `default_read_to_string`. unsafe { append_to_string(buf, |b| read_until(self, b'\n', b)) } } |
