Skip to content

Commit 8cd20cb

Browse files
committedJun 17, 2024
Auto merge of rust-lang#126569 - jieyouxu:rollup-1uvkb2y, r=jieyouxu
Rollup of 8 pull requests Successful merges: - rust-lang#125258 (Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope) - rust-lang#126250 (docs(change): Don't mention a Cargo 2024 edition change for 1.79) - rust-lang#126288 (doc: Added commas where needed) - rust-lang#126346 (export std::os::fd module on HermitOS) - rust-lang#126468 (div_euclid, rem_euclid: clarify/extend documentation) - rust-lang#126531 (Add codegen test for `Request::provide_*`) - rust-lang#126535 (coverage: Arrange span extraction/refinement as a series of passes) - rust-lang#126538 (coverage: Several small improvements to graph code) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4aa43c7 + c1acd7a commit 8cd20cb

File tree

5 files changed

+17
-24
lines changed

5 files changed

+17
-24
lines changed
 

‎core/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ pub(crate) mod tags {
928928
/// An `Option` with a type tag `I`.
929929
///
930930
/// Since this struct implements `Erased`, the type can be erased to make a dynamically typed
931-
/// option. The type can be checked dynamically using `Erased::tag_id` and since this is statically
931+
/// option. The type can be checked dynamically using `Tagged::tag_id` and since this is statically
932932
/// checked for the concrete type, there is some degree of type safety.
933933
#[repr(transparent)]
934934
pub(crate) struct TaggedOption<'a, I: tags::Type<'a>>(pub Option<I::Reified>);

‎core/src/num/int_macros.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2784,8 +2784,10 @@ macro_rules! int_impl {
27842784
///
27852785
/// In other words, the result is `self / rhs` rounded to the integer `q`
27862786
/// such that `self >= q * rhs`.
2787-
/// If `self > 0`, this is equal to round towards zero (the default in Rust);
2788-
/// if `self < 0`, this is equal to round towards +/- infinity.
2787+
/// If `self > 0`, this is equal to rounding towards zero (the default in Rust);
2788+
/// if `self < 0`, this is equal to rounding away from zero (towards +/- infinity).
2789+
/// If `rhs > 0`, this is equal to rounding towards -infinity;
2790+
/// if `rhs < 0`, this is equal to rounding towards +infinity.
27892791
///
27902792
/// # Panics
27912793
///
@@ -2823,8 +2825,8 @@ macro_rules! int_impl {
28232825
/// Calculates the least nonnegative remainder of `self (mod rhs)`.
28242826
///
28252827
/// This is done as if by the Euclidean division algorithm -- given
2826-
/// `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and
2827-
/// `0 <= r < abs(rhs)`.
2828+
/// `r = self.rem_euclid(rhs)`, the result satisfies
2829+
/// `self = rhs * self.div_euclid(rhs) + r` and `0 <= r < abs(rhs)`.
28282830
///
28292831
/// # Panics
28302832
///

‎core/src/ptr/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
//! pointer. For code which *does* cast a usize to a pointer, the scope of the change depends
238238
//! on exactly what you're doing.
239239
//!
240-
//! In general you just need to make sure that if you want to convert a usize address to a
240+
//! In general, you just need to make sure that if you want to convert a usize address to a
241241
//! pointer and then use that pointer to read/write memory, you need to keep around a pointer
242242
//! that has sufficient provenance to perform that read/write itself. In this way all of your
243243
//! casts from an address to a pointer are essentially just applying offsets/indexing.
@@ -309,7 +309,7 @@
309309
//! i.e. the usual "ZSTs are fake, do what you want" rules apply *but* this only applies
310310
//! for actual forgery (integers cast to pointers). If you borrow some struct's field
311311
//! that *happens* to be zero-sized, the resulting pointer will have provenance tied to
312-
//! that allocation and it will still get invalidated if the allocation gets deallocated.
312+
//! that allocation, and it will still get invalidated if the allocation gets deallocated.
313313
//! In the future we may introduce an API to make such a forged allocation explicit.
314314
//!
315315
//! * [`wrapping_offset`][] a pointer outside its provenance. This includes pointers
@@ -698,7 +698,7 @@ pub const fn dangling_mut<T>() -> *mut T {
698698
///
699699
/// If there is no 'exposed' provenance that justifies the way this pointer will be used,
700700
/// the program has undefined behavior. In particular, the aliasing rules still apply: pointers
701-
/// and references that have been invalidated due to aliasing accesses cannot be used any more,
701+
/// and references that have been invalidated due to aliasing accesses cannot be used anymore,
702702
/// even if they have been exposed!
703703
///
704704
/// Note that there is no algorithm that decides which provenance will be used. You can think of this
@@ -1097,7 +1097,7 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
10971097
// If we end up here, it's because we're using a simple type -- like
10981098
// a small power-of-two-sized thing -- or a special type with particularly
10991099
// large alignment, particularly SIMD types.
1100-
// Thus we're fine just reading-and-writing it, as either it's small
1100+
// Thus, we're fine just reading-and-writing it, as either it's small
11011101
// and that works well anyway or it's special and the type's author
11021102
// presumably wanted things to be done in the larger chunk.
11031103

@@ -1290,7 +1290,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
12901290
// provides enough information to know that this is a typed operation.
12911291

12921292
// However, as of March 2023 the compiler was not capable of taking advantage
1293-
// of that information. Thus the implementation here switched to an intrinsic,
1293+
// of that information. Thus, the implementation here switched to an intrinsic,
12941294
// which lowers to `_0 = *src` in MIR, to address a few issues:
12951295
//
12961296
// - Using `MaybeUninit::assume_init` after a `copy_nonoverlapping` was not
@@ -1570,7 +1570,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
15701570
/// As a result, using `&packed.unaligned as *const FieldType` causes immediate
15711571
/// *undefined behavior* in your program.
15721572
///
1573-
/// Instead you must use the [`ptr::addr_of_mut!`](addr_of_mut)
1573+
/// Instead, you must use the [`ptr::addr_of_mut!`](addr_of_mut)
15741574
/// macro to create the pointer. You may use that returned pointer together with
15751575
/// this function.
15761576
///

‎std/src/os/hermit/io/mod.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
#![stable(feature = "os_fd", since = "1.66.0")]
1+
#![stable(feature = "rust1", since = "1.0.0")]
22

3-
mod net;
4-
#[path = "../../fd/owned.rs"]
5-
mod owned;
6-
#[path = "../../fd/raw.rs"]
7-
mod raw;
8-
9-
// Export the types and traits for the public API.
10-
#[stable(feature = "os_fd", since = "1.66.0")]
11-
pub use owned::*;
12-
#[stable(feature = "os_fd", since = "1.66.0")]
13-
pub use raw::*;
3+
#[stable(feature = "rust1", since = "1.0.0")]
4+
pub use crate::os::fd::*;

‎std/src/os/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub(crate) mod watchos;
160160
#[cfg(target_os = "xous")]
161161
pub mod xous;
162162

163-
#[cfg(any(unix, target_os = "wasi", doc))]
163+
#[cfg(any(unix, target_os = "hermit", target_os = "wasi", doc))]
164164
pub mod fd;
165165

166166
#[cfg(any(target_os = "linux", target_os = "android", doc))]

0 commit comments

Comments
 (0)