diff options
| author | bors <bors@rust-lang.org> | 2025-02-10 11:38:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-10 11:38:45 +0000 |
| commit | 8c04e395952022a451138dc4dbead6dd6ae65203 (patch) | |
| tree | ad0062d7c194bb6841e3fa09c09fe6d28c08bdc0 /library/core/src | |
| parent | 80c091958f05e573433df974f8d2f2bc3a3eadfb (diff) | |
| parent | ffa8a96040b8bb1ae8b856ae2a95159ffe1cb400 (diff) | |
| download | rust-8c04e395952022a451138dc4dbead6dd6ae65203.tar.gz rust-8c04e395952022a451138dc4dbead6dd6ae65203.zip | |
Auto merge of #136809 - workingjubilee:rollup-jk0pew1, r=workingjubilee
Rollup of 12 pull requests Successful merges: - #136053 (coverage: Defer part of counter-creation until codegen) - #136201 (Removed dependency on the field-offset crate, alternate approach) - #136228 (Simplify Rc::as_ptr docs + typo fix) - #136353 (fix(libtest): Enable Instant on Emscripten targets) - #136472 ([`compiletest`-related cleanups 2/7] Feed stage number to compiletest directly) - #136487 (ci: stop mysql before removing it) - #136552 (Use an `Option` for `FindNextFileHandle` in `ReadDir` instead of `INVALID_FILE_HANDLE` sentinel value) - #136705 (Some miscellaneous edition-related library tweaks) - #136707 (Bump `cc` to v1.2.13 for the compiler workspace) - #136790 (Git blame ignore recent formatting commit) - #136792 (Don't apply editorconfig to llvm) - #136805 (ignore win_delete_self test in Miri) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/ffi/c_str.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ffi/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/intrinsics/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/iter/sources/once_with.rs | 14 | ||||
| -rw-r--r-- | library/core/src/panicking.rs | 4 | ||||
| -rw-r--r-- | library/core/src/ptr/metadata.rs | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs index 7180593edf0..75338e492ee 100644 --- a/library/core/src/ffi/c_str.rs +++ b/library/core/src/ffi/c_str.rs @@ -731,7 +731,7 @@ const unsafe fn strlen(ptr: *const c_char) -> usize { len } else { - extern "C" { + unsafe extern "C" { /// Provided by libc or compiler_builtins. fn strlen(s: *const c_char) -> usize; } diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs index 50968c57adc..9bae5fd466a 100644 --- a/library/core/src/ffi/mod.rs +++ b/library/core/src/ffi/mod.rs @@ -90,4 +90,4 @@ impl fmt::Debug for c_void { cfg(not(target_feature = "crt-static")) )] #[link(name = "/defaultlib:libcmt", modifiers = "+verbatim", cfg(target_feature = "crt-static"))] -extern "C" {} +unsafe extern "C" {} diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 3b249c835f2..6c9c6d0edc2 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -4855,7 +4855,7 @@ pub const unsafe fn copysignf128(_x: f128, _y: f128) -> f128 { #[cfg(miri)] #[rustc_allow_const_fn_unstable(const_eval_select)] pub(crate) const fn miri_promise_symbolic_alignment(ptr: *const (), align: usize) { - extern "Rust" { + unsafe extern "Rust" { /// Miri-provided extern function to promise that a given pointer is properly aligned for /// "symbolic" alignment checks. Will fail if the pointer is not actually aligned or `align` is /// not a power of two. Has no effect when alignment checks are concrete (which is the default). diff --git a/library/core/src/iter/sources/once_with.rs b/library/core/src/iter/sources/once_with.rs index 8b31ab2ff90..c9698b4fd43 100644 --- a/library/core/src/iter/sources/once_with.rs +++ b/library/core/src/iter/sources/once_with.rs @@ -58,8 +58,8 @@ use crate::iter::{FusedIterator, TrustedLen}; /// ``` #[inline] #[stable(feature = "iter_once_with", since = "1.43.0")] -pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> { - OnceWith { gen: Some(gen) } +pub fn once_with<A, F: FnOnce() -> A>(make: F) -> OnceWith<F> { + OnceWith { make: Some(make) } } /// An iterator that yields a single element of type `A` by @@ -70,13 +70,13 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> { #[derive(Clone)] #[stable(feature = "iter_once_with", since = "1.43.0")] pub struct OnceWith<F> { - gen: Option<F>, + make: Option<F>, } #[stable(feature = "iter_once_with_debug", since = "1.68.0")] impl<F> fmt::Debug for OnceWith<F> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if self.gen.is_some() { + if self.make.is_some() { f.write_str("OnceWith(Some(_))") } else { f.write_str("OnceWith(None)") @@ -90,13 +90,13 @@ impl<A, F: FnOnce() -> A> Iterator for OnceWith<F> { #[inline] fn next(&mut self) -> Option<A> { - let f = self.gen.take()?; + let f = self.make.take()?; Some(f()) } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { - self.gen.iter().size_hint() + self.make.iter().size_hint() } } @@ -110,7 +110,7 @@ impl<A, F: FnOnce() -> A> DoubleEndedIterator for OnceWith<F> { #[stable(feature = "iter_once_with", since = "1.43.0")] impl<A, F: FnOnce() -> A> ExactSizeIterator for OnceWith<F> { fn len(&self) -> usize { - self.gen.iter().len() + self.make.iter().len() } } diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs index b97f19e1baa..d36e677d21a 100644 --- a/library/core/src/panicking.rs +++ b/library/core/src/panicking.rs @@ -59,7 +59,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! { // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call // that gets resolved to the `#[panic_handler]` function. - extern "Rust" { + unsafe extern "Rust" { #[lang = "panic_impl"] fn panic_impl(pi: &PanicInfo<'_>) -> !; } @@ -100,7 +100,7 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call // that gets resolved to the `#[panic_handler]` function. - extern "Rust" { + unsafe extern "Rust" { #[lang = "panic_impl"] fn panic_impl(pi: &PanicInfo<'_>) -> !; } diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index e93b5658e24..9eee29d485f 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -155,7 +155,7 @@ pub struct DynMetadata<Dyn: ?Sized> { _phantom: crate::marker::PhantomData<Dyn>, } -extern "C" { +unsafe extern "C" { /// Opaque type for accessing vtables. /// /// Private implementation detail of `DynMetadata::size_of` etc. |
