diff --git a/library/alloc/benches/binary_heap.rs b/library/alloc/benches/binary_heap.rs index 5b6538ea6c6b3..491243e22c73b 100644 --- a/library/alloc/benches/binary_heap.rs +++ b/library/alloc/benches/binary_heap.rs @@ -36,7 +36,7 @@ fn bench_peek_mut_deref_mut(b: &mut Bencher) { let mut peek_mut = bheap.peek_mut().unwrap(); // The compiler shouldn't be able to optimize away the `sift_down` // assignment in `PeekMut`'s `DerefMut` implementation since - // the loop may not run. + // the loop might not run. for &i in vec.iter() { *peek_mut = i; } diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 9a7119470f370..b51142c7e6eff 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -477,7 +477,7 @@ impl<'a, K, V> NodeRef, K, V, marker::LeafOrInternal> { impl<'a, K, V, Type> NodeRef, K, V, Type> { /// Temporarily takes out another, mutable reference to the same node. Beware, as - /// this method is very dangerous, doubly so since it may not immediately appear + /// this method is very dangerous, doubly so since it might not immediately appear /// dangerous. /// /// Because mutable pointers can roam anywhere around the tree, the returned @@ -766,7 +766,7 @@ impl<'a, K, V, Type> Handle, K, V, marker::LeafOrInterna impl<'a, K, V, NodeType, HandleType> Handle, K, V, NodeType>, HandleType> { /// Temporarily takes out another, mutable handle on the same location. Beware, as - /// this method is very dangerous, doubly so since it may not immediately appear + /// this method is very dangerous, doubly so since it might not immediately appear /// dangerous. /// /// For details, see `NodeRef::reborrow_mut`. diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index 3ef55f06e5198..a3615df71bc1e 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -138,7 +138,7 @@ //! the `0` flag (see below) is specified for numerics, then the implicit fill character is //! `0`. //! -//! Note that alignment may not be implemented by some types. In particular, it +//! Note that alignment might not be implemented by some types. In particular, it //! is not generally implemented for the `Debug` trait. A good way to ensure //! padding is applied is to format your input, then pad this resulting string //! to obtain your output: @@ -300,7 +300,7 @@ //! count := parameter | integer //! parameter := argument '$' //! ``` -//! In the above grammar, `text` may not contain any `'{'` or `'}'` characters. +//! In the above grammar, `text` might not contain any `'{'` or `'}'` characters. //! //! # Formatting traits //! diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index dac4acc4692a2..2114d5e7facee 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2395,7 +2395,7 @@ unsafe fn data_offset(ptr: *const T) -> isize { // SAFETY: since the only unsized types possible are slices, trait objects, // and extern types, the input safety requirement is currently enough to // satisfy the requirements of align_of_val_raw; this is an implementation - // detail of the language that may not be relied upon outside of std. + // detail of the language that should not be relied upon outside of std. unsafe { data_offset_align(align_of_val_raw(ptr)) } } diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index f4ec4a36ffd2b..7febca1cfd3c1 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -868,7 +868,7 @@ impl String { /// assert!(s.capacity() >= 10); /// ``` /// - /// This may not actually increase the capacity: + /// This might not actually increase the capacity: /// /// ``` /// let mut s = String::with_capacity(10); @@ -915,7 +915,7 @@ impl String { /// assert!(s.capacity() >= 10); /// ``` /// - /// This may not actually increase the capacity: + /// This might not actually increase the capacity: /// /// ``` /// let mut s = String::with_capacity(10); @@ -1438,7 +1438,7 @@ impl String { } /// Returns the length of this `String`, in bytes, not [`char`]s or - /// graphemes. In other words, it may not be what a human considers the + /// graphemes. In other words, it might not be what a human considers the /// length of the string. /// /// # Examples diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index aeae888dddc03..f7422e9de31fc 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1034,7 +1034,7 @@ impl Arc { // Non-inlined part of `drop`. #[inline(never)] unsafe fn drop_slow(&mut self) { - // Destroy the data at this time, even though we may not free the box + // Destroy the data at this time, even though we might not free the box // allocation itself (there may still be weak pointers lying around). unsafe { ptr::drop_in_place(Self::get_mut_unchecked(self)) }; @@ -2516,7 +2516,7 @@ unsafe fn data_offset(ptr: *const T) -> isize { // SAFETY: since the only unsized types possible are slices, trait objects, // and extern types, the input safety requirement is currently enough to // satisfy the requirements of align_of_val_raw; this is an implementation - // detail of the language that may not be relied upon outside of std. + // detail of the language that should not be relied upon outside of std. unsafe { data_offset_align(align_of_val_raw(ptr)) } } diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 20c2aae1789ad..74ef2699a6b7e 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2189,7 +2189,7 @@ impl Vec { unsafe { let mut ptr = self.as_mut_ptr().add(self.len()); // Use SetLenOnDrop to work around bug where compiler - // may not realize the store through `ptr` through self.set_len() + // might not realize the store through `ptr` through self.set_len() // don't alias. let mut local_len = SetLenOnDrop::new(&mut self.len); diff --git a/library/alloc/src/vec/source_iter_marker.rs b/library/alloc/src/vec/source_iter_marker.rs index 50882fc17673e..04f308bd296fc 100644 --- a/library/alloc/src/vec/source_iter_marker.rs +++ b/library/alloc/src/vec/source_iter_marker.rs @@ -56,7 +56,7 @@ where let src = unsafe { iterator.as_inner().as_into_iter() }; // check if SourceIter contract was upheld - // caveat: if they weren't we may not even make it to this point + // caveat: if they weren't we might not even make it to this point debug_assert_eq!(src_buf, src.buf.as_ptr()); // check InPlaceIterable contract. This is only possible if the iterator advanced the // source pointer at all. If it uses unchecked access via TrustedRandomAccess diff --git a/library/alloc/tests/binary_heap.rs b/library/alloc/tests/binary_heap.rs index ce794a9a4afa2..1f85dcff07fa2 100644 --- a/library/alloc/tests/binary_heap.rs +++ b/library/alloc/tests/binary_heap.rs @@ -395,7 +395,7 @@ fn test_retain() { // old binaryheap failed this test // // Integrity means that all elements are present after a comparison panics, -// even if the order may not be correct. +// even if the order might not be correct. // // Destructors must be called exactly once per element. // FIXME: re-enable emscripten once it can unwind again diff --git a/library/core/src/alloc/global.rs b/library/core/src/alloc/global.rs index 6dcc110f1539c..a4ec00caa7c12 100644 --- a/library/core/src/alloc/global.rs +++ b/library/core/src/alloc/global.rs @@ -54,7 +54,7 @@ use crate::ptr; /// this trait are allowed to rely on the contracts defined on each method, /// and implementors must ensure such contracts remain true. /// -/// * You may not rely on allocations actually happening, even if there are explicit +/// * You should not rely on allocations actually happening, even if there are explicit /// heap allocations in the source. The optimizer may detect unused allocations that it can either /// eliminate entirely or move to the stack and thus never invoke the allocator. The /// optimizer may further assume that allocation is infallible, so code that used to fail due diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 8f52985d1df71..5a0dadc87b636 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -47,7 +47,7 @@ pub fn from_mut(s: &mut T) -> &mut [T; 1] { /// initialization). /// /// Note that the traits [`AsRef`] and [`AsMut`] provide similar methods for types that -/// may not be fixed-size arrays. Implementors should prefer those traits +/// might not be fixed-size arrays. Implementors should prefer those traits /// instead. #[unstable(feature = "fixed_size_array", issue = "27778")] pub unsafe trait FixedSizeArray { diff --git a/library/core/src/future/future.rs b/library/core/src/future/future.rs index e9a99ddb6b1bd..b5ef296e206cc 100644 --- a/library/core/src/future/future.rs +++ b/library/core/src/future/future.rs @@ -7,7 +7,7 @@ use crate::task::{Context, Poll}; /// A future represents an asynchronous computation. /// -/// A future is a value that may not have finished computing yet. This kind of +/// A future is a value that might not have finished computing yet. This kind of /// "asynchronous value" makes it possible for a thread to continue doing useful /// work while it waits for the value to become available. /// diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs index 2f8f504d8fcaa..d47f5d4c4630d 100644 --- a/library/core/src/iter/adapters/zip.rs +++ b/library/core/src/iter/adapters/zip.rs @@ -420,7 +420,7 @@ impl ZipFmt::__iterator_get_unchecked` must be safe to call /// provided the following conditions are met. diff --git a/library/core/src/iter/mod.rs b/library/core/src/iter/mod.rs index 2a179f0b1d77b..f57855878f70c 100644 --- a/library/core/src/iter/mod.rs +++ b/library/core/src/iter/mod.rs @@ -336,7 +336,7 @@ //! This will print the numbers `0` through `4`, each on their own line. //! //! Bear in mind that methods on infinite iterators, even those for which a -//! result can be determined mathematically in finite time, may not terminate. +//! result can be determined mathematically in finite time, might not terminate. //! Specifically, methods such as [`min`], which in the general case require //! traversing every element in the iterator, are likely not to return //! successfully for any infinite iterators. diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index 4b293c596e7af..d541a758f7af0 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -279,7 +279,7 @@ macro_rules! step_integer_impls { // // Casting to isize extends the width but preserves the sign. // Use wrapping_sub in isize space and cast to usize to compute - // the difference that may not fit inside the range of isize. + // the difference that might not fit inside the range of isize. Some((*end as isize).wrapping_sub(*start as isize) as usize) } else { None diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index e75a36477188c..d26f4ee3ba6cf 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -2057,7 +2057,7 @@ pub trait Iterator { /// to produce a single value from it. /// /// Note: `fold()`, and similar methods that traverse the entire iterator, - /// may not terminate for infinite iterators, even on traits for which a + /// might not terminate for infinite iterators, even on traits for which a /// result is determinable in finite time. /// /// Note: [`reduce()`] can be used to use the first element as the initial diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 85e0e7200875d..307b9965dc5c7 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -316,7 +316,7 @@ pub trait StructuralEq { /// attempt to derive a `Copy` implementation, we'll get an error: /// /// ```text -/// the trait `Copy` may not be implemented for this type; field `points` does not implement `Copy` +/// the trait `Copy` might not be implemented for this type; field `points` does not implement `Copy` /// ``` /// /// Shared references (`&T`) are also `Copy`, so a type can be `Copy`, even when it holds diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 446d72f1d32e4..113f9fb21f8f4 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -935,7 +935,7 @@ pub fn drop(_x: T) {} #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")] pub const unsafe fn transmute_copy(src: &T) -> U { - // If U has a higher alignment requirement, src may not be suitably aligned. + // If U has a higher alignment requirement, src might not be suitably aligned. if align_of::() > align_of::() { // SAFETY: `src` is a reference which is guaranteed to be valid for reads. // The caller must guarantee that the actual transmutation is safe. diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index f008a64ffe653..1699542f4881e 100644 --- a/library/core/src/num/dec2flt/mod.rs +++ b/library/core/src/num/dec2flt/mod.rs @@ -304,7 +304,7 @@ fn simplify(decimal: &mut Decimal<'_>) { let end = decimal.fractional.len() - trailing_zeros; decimal.fractional = &decimal.fractional[..end]; // Simplify numbers of the form 0.0...x and x...0.0, adjusting the exponent accordingly. - // This may not always be a win (possibly pushes some numbers out of the fast path), but it + // This might not always be a win (possibly pushes some numbers out of the fast path), but it // simplifies other parts significantly (notably, approximating the magnitude of the value). if decimal.integral.is_empty() { let leading_zeros = decimal.fractional.iter().take_while(is_zero).count(); diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index b2de0e16a17bb..38a2827e97a30 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -159,7 +159,7 @@ //! Notice that this guarantee does *not* mean that memory does not leak! It is still //! completely okay not ever to call [`drop`] on a pinned element (e.g., you can still //! call [`mem::forget`] on a [`Pin`]`<`[`Box`]`>`). In the example of the doubly-linked -//! list, that element would just stay in the list. However you may not free or reuse the storage +//! list, that element would just stay in the list. However you should not free or reuse the storage //! *without calling [`drop`]*. //! //! # `Drop` implementation diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index b511466acd639..ded162d56aab8 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -408,7 +408,7 @@ impl *const T { /// /// [`guaranteed_ne`]: #method.guaranteed_ne /// - /// The return value may change depending on the compiler version and unsafe code may not + /// The return value may change depending on the compiler version and unsafe code should not /// rely on the result of this function for soundness. It is suggested to only use this function /// for performance optimizations where spurious `false` return values by this function do not /// affect the outcome, but just the performance. @@ -439,7 +439,7 @@ impl *const T { /// /// [`guaranteed_eq`]: #method.guaranteed_eq /// - /// The return value may change depending on the compiler version and unsafe code may not + /// The return value may change depending on the compiler version and unsafe code should not /// rely on the result of this function for soundness. It is suggested to only use this function /// for performance optimizations where spurious `false` return values by this function do not /// affect the outcome, but just the performance. diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index fa09cf854353d..489a2839570e7 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -423,7 +423,7 @@ impl *mut T { /// /// [`guaranteed_ne`]: #method.guaranteed_ne /// - /// The return value may change depending on the compiler version and unsafe code may not + /// The return value may change depending on the compiler version and unsafe code should not /// rely on the result of this function for soundness. It is suggested to only use this function /// for performance optimizations where spurious `false` return values by this function do not /// affect the outcome, but just the performance. @@ -454,7 +454,7 @@ impl *mut T { /// /// [`guaranteed_eq`]: #method.guaranteed_eq /// - /// The return value may change depending on the compiler version and unsafe code may not + /// The return value may change depending on the compiler version and unsafe code should not /// rely on the result of this function for soundness. It is suggested to only use this function /// for performance optimizations where spurious `false` return values by this function do not /// affect the outcome, but just the performance. diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index d7a28c8d08f78..446661cdbdef3 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -2266,7 +2266,7 @@ impl [T] { self.binary_search_by(|k| f(k).cmp(b)) } - /// Sorts the slice, but may not preserve the order of equal elements. + /// Sorts the slice, but might not preserve the order of equal elements. /// /// This sort is unstable (i.e., may reorder equal elements), in-place /// (i.e., does not allocate), and *O*(*n* \* log(*n*)) worst-case. @@ -2301,7 +2301,7 @@ impl [T] { sort::quicksort(self, |a, b| a.lt(b)); } - /// Sorts the slice with a comparator function, but may not preserve the order of equal + /// Sorts the slice with a comparator function, but might not preserve the order of equal /// elements. /// /// This sort is unstable (i.e., may reorder equal elements), in-place @@ -2356,7 +2356,7 @@ impl [T] { sort::quicksort(self, |a, b| compare(a, b) == Ordering::Less); } - /// Sorts the slice with a key extraction function, but may not preserve the order of equal + /// Sorts the slice with a key extraction function, but might not preserve the order of equal /// elements. /// /// This sort is unstable (i.e., may reorder equal elements), in-place diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 95dd54976b2c0..1c4413894a209 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -123,7 +123,7 @@ impl str { /// Returns the length of `self`. /// /// This length is in bytes, not [`char`]s or graphemes. In other words, - /// it may not be what a human considers the length of the string. + /// it might not be what a human considers the length of the string. /// /// [`char`]: prim@char /// @@ -622,7 +622,7 @@ impl str { /// string slice by [`char`]. This method returns such an iterator. /// /// It's important to remember that [`char`] represents a Unicode Scalar - /// Value, and may not match your idea of what a 'character' is. Iteration + /// Value, and might not match your idea of what a 'character' is. Iteration /// over grapheme clusters may be what you actually want. This functionality /// is not provided by Rust's standard library, check crates.io instead. /// @@ -649,7 +649,7 @@ impl str { /// assert_eq!(None, chars.next()); /// ``` /// - /// Remember, [`char`]s may not match your intuition about characters: + /// Remember, [`char`]s might not match your intuition about characters: /// /// [`char`]: prim@char /// @@ -702,7 +702,7 @@ impl str { /// assert_eq!(None, char_indices.next()); /// ``` /// - /// Remember, [`char`]s may not match your intuition about characters: + /// Remember, [`char`]s might not match your intuition about characters: /// /// [`char`]: prim@char /// diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index bf70b28579c8b..374f887e5b87c 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -41,7 +41,7 @@ //! instructions to implement `AtomicI8`. Note that this emulation should not //! have an impact on correctness of code, it's just something to be aware of. //! -//! The atomic types in this module may not be available on all platforms. The +//! The atomic types in this module might not be available on all platforms. The //! atomic types here are all widely available, however, and can generally be //! relied upon existing. Some notable exceptions are: //! diff --git a/library/proc_macro/src/bridge/client.rs b/library/proc_macro/src/bridge/client.rs index c6bec5a6fbdc2..8ae7b6de1a63e 100644 --- a/library/proc_macro/src/bridge/client.rs +++ b/library/proc_macro/src/bridge/client.rs @@ -386,7 +386,7 @@ fn run_client DecodeMut<'a, 's, ()>, R: Encode<()>>( // // Note that panics should be impossible beyond this point, but // this is defensively trying to avoid any accidental panicking - // reaching the `extern "C"` (which should `abort` but may not + // reaching the `extern "C"` (which should `abort` but might not // at the moment, so this is also potentially preventing UB). b.clear(); Ok::<_, ()>(output).encode(&mut b, &mut ()); diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 5f1f7d8cac418..1e6a44509754e 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -449,10 +449,10 @@ impl SourceFile { /// /// ### Note /// If the code span associated with this `SourceFile` was generated by an external macro, this - /// macro, this may not be an actual path on the filesystem. Use [`is_real`] to check. + /// macro, this might not be an actual path on the filesystem. Use [`is_real`] to check. /// /// Also note that even if `is_real` returns `true`, if `--remap-path-prefix` was passed on - /// the command line, the path as given may not actually be valid. + /// the command line, the path as given might not actually be valid. /// /// [`is_real`]: Self::is_real #[unstable(feature = "proc_macro_span", issue = "54725")] @@ -639,7 +639,7 @@ pub enum Delimiter { /// An implicit delimiter, that may, for example, appear around tokens coming from a /// "macro variable" `$var`. It is important to preserve operator priorities in cases like /// `$var * 3` where `$var` is `1 + 2`. - /// Implicit delimiters may not survive roundtrip of a token stream through a string. + /// Implicit delimiters might not survive roundtrip of a token stream through a string. #[stable(feature = "proc_macro_lib2", since = "1.29.0")] None, } @@ -952,7 +952,7 @@ macro_rules! suffixed_int_literals { /// This function will create an integer like `1u32` where the integer /// value specified is the first part of the token and the integral is /// also suffixed at the end. - /// Literals created from negative numbers may not survive round-trips through + /// Literals created from negative numbers might not survive round-trips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// Literals created through this method have the `Span::call_site()` @@ -974,7 +974,7 @@ macro_rules! unsuffixed_int_literals { /// specified on this token, meaning that invocations like /// `Literal::i8_unsuffixed(1)` are equivalent to /// `Literal::u32_unsuffixed(1)`. - /// Literals created from negative numbers may not survive rountrips through + /// Literals created from negative numbers might not survive rountrips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// Literals created through this method have the `Span::call_site()` @@ -1023,7 +1023,7 @@ impl Literal { /// This constructor is similar to those like `Literal::i8_unsuffixed` where /// the float's value is emitted directly into the token but no suffix is /// used, so it may be inferred to be a `f64` later in the compiler. - /// Literals created from negative numbers may not survive rountrips through + /// Literals created from negative numbers might not survive rountrips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// # Panics @@ -1044,7 +1044,7 @@ impl Literal { /// specified is the preceding part of the token and `f32` is the suffix of /// the token. This token will always be inferred to be an `f32` in the /// compiler. - /// Literals created from negative numbers may not survive rountrips through + /// Literals created from negative numbers might not survive rountrips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// # Panics @@ -1064,7 +1064,7 @@ impl Literal { /// This constructor is similar to those like `Literal::i8_unsuffixed` where /// the float's value is emitted directly into the token but no suffix is /// used, so it may be inferred to be a `f64` later in the compiler. - /// Literals created from negative numbers may not survive rountrips through + /// Literals created from negative numbers might not survive rountrips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// # Panics @@ -1085,7 +1085,7 @@ impl Literal { /// specified is the preceding part of the token and `f64` is the suffix of /// the token. This token will always be inferred to be an `f64` in the /// compiler. - /// Literals created from negative numbers may not survive rountrips through + /// Literals created from negative numbers might not survive rountrips through /// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal). /// /// # Panics diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs index 0aae4674b2942..a691b2569b688 100644 --- a/library/std/src/backtrace.rs +++ b/library/std/src/backtrace.rs @@ -35,13 +35,13 @@ //! `BacktraceStatus` enum as a result of `Backtrace::status`. //! //! Like above with accuracy platform support is done on a best effort basis. -//! Sometimes libraries may not be available at runtime or something may go +//! Sometimes libraries might not be available at runtime or something may go //! wrong which would cause a backtrace to not be captured. Please feel free to //! report issues with platforms where a backtrace cannot be captured though! //! //! ## Environment Variables //! -//! The `Backtrace::capture` function may not actually capture a backtrace by +//! The `Backtrace::capture` function might not actually capture a backtrace by //! default. Its behavior is governed by two environment variables: //! //! * `RUST_LIB_BACKTRACE` - if this is set to `0` then `Backtrace::capture` @@ -61,7 +61,7 @@ //! Note that the `Backtrace::force_capture` function can be used to ignore //! these environment variables. Also note that the state of environment //! variables is cached once the first backtrace is created, so altering -//! `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` at runtime may not actually change +//! `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` at runtime might not actually change //! how backtraces are captured. #![unstable(feature = "backtrace", issue = "53487")] diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 9763a2da34151..343bcf004df82 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -673,7 +673,7 @@ pub fn current_exe() -> io::Result { /// for more. /// /// The first element is traditionally the path of the executable, but it can be -/// set to arbitrary text, and may not even exist. This means this property +/// set to arbitrary text, and might not even exist. This means this property /// should not be relied upon for security purposes. /// /// [`env::args()`]: args @@ -689,7 +689,7 @@ pub struct Args { /// for more. /// /// The first element is traditionally the path of the executable, but it can be -/// set to arbitrary text, and may not even exist. This means this property +/// set to arbitrary text, and might not even exist. This means this property /// should not be relied upon for security purposes. /// /// [`env::args_os()`]: args_os @@ -702,7 +702,7 @@ pub struct ArgsOs { /// via the command line). /// /// The first element is traditionally the path of the executable, but it can be -/// set to arbitrary text, and may not even exist. This means this property should +/// set to arbitrary text, and might not even exist. This means this property should /// not be relied upon for security purposes. /// /// On Unix systems the shell usually expands unquoted arguments with glob patterns @@ -739,7 +739,7 @@ pub fn args() -> Args { /// via the command line). /// /// The first element is traditionally the path of the executable, but it can be -/// set to arbitrary text, and it may not even exist, so this property should +/// set to arbitrary text, and it might not even exist, so this property should /// not be relied upon for security purposes. /// /// On glibc Linux systems, arguments are retrieved by placing a function in ".init_array". diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index c16d27fa1f58c..a90b6157c03dc 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -407,7 +407,7 @@ impl f32 { /// Returns the logarithm of the number with respect to an arbitrary base. /// - /// The result may not be correctly rounded owing to implementation details; + /// The result might not be correctly rounded owing to implementation details; /// `self.log2()` can produce more accurate results for base 2, and /// `self.log10()` can produce more accurate results for base 10. /// diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 4c95df5ffe04a..67fcea325c6fa 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -407,7 +407,7 @@ impl f64 { /// Returns the logarithm of the number with respect to an arbitrary base. /// - /// The result may not be correctly rounded owing to implementation details; + /// The result might not be correctly rounded owing to implementation details; /// `self.log2()` can produce more accurate results for base 2, and /// `self.log10()` can produce more accurate results for base 10. /// diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 860bc130b7d8b..9ae1ac134b745 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -415,7 +415,7 @@ impl File { self.inner.fsync() } - /// This function is similar to [`sync_all`], except that it may not + /// This function is similar to [`sync_all`], except that it might not /// synchronize file metadata to the filesystem. /// /// This is intended for use cases that must synchronize content, but don't @@ -1051,7 +1051,7 @@ impl Metadata { /// /// # Errors /// - /// This field may not be available on all platforms, and will return an + /// This field might not be available on all platforms, and will return an /// `Err` on platforms where it is not available. /// /// # Examples @@ -1086,7 +1086,7 @@ impl Metadata { /// /// # Errors /// - /// This field may not be available on all platforms, and will return an + /// This field might not be available on all platforms, and will return an /// `Err` on platforms where it is not available. /// /// # Examples @@ -1118,7 +1118,7 @@ impl Metadata { /// /// # Errors /// - /// This field may not be available on all platforms, and will return an + /// This field might not be available on all platforms, and will return an /// `Err` on platforms or filesystems where it is not available. /// /// # Examples diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 5c969741592e6..9670459d248a6 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -809,7 +809,7 @@ fn symlink_noexist() { }; // Use a relative path for testing. Symlinks get normalized by Windows, - // so we may not get the same path back for absolute paths + // so we might not get the same path back for absolute paths check!(symlink_file(&"foo", &tmpdir.join("bar"))); assert_eq!(check!(fs::read_link(&tmpdir.join("bar"))).to_str().unwrap(), "foo"); } diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 9953bcd556dd9..f01e724c48960 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -539,7 +539,7 @@ pub trait Read { /// contents of `buf` being true. It is recommended that *implementations* /// only write data to `buf` instead of reading its contents. /// - /// Correspondingly, however, *callers* of this method may not assume any guarantees + /// Correspondingly, however, *callers* of this method should not assume any guarantees /// about how the implementation uses `buf`. The trait is safe to implement, /// so it is possible that the code that's supposed to write to the buffer might also read /// from it. It is your responsibility to make sure that `buf` is initialized @@ -1301,7 +1301,7 @@ pub trait Write { /// Write a buffer into this writer, returning how many bytes were written. /// /// This function will attempt to write the entire contents of `buf`, but - /// the entire write may not succeed, or the write may also generate an + /// the entire write might not succeed, or the write may also generate an /// error. A call to `write` represents *at most one* attempt to write to /// any wrapped object. /// diff --git a/library/std/src/net/addr.rs b/library/std/src/net/addr.rs index 55546a5b03771..786c79d0f4177 100644 --- a/library/std/src/net/addr.rs +++ b/library/std/src/net/addr.rs @@ -864,7 +864,7 @@ pub trait ToSocketAddrs { /// Converts this object to an iterator of resolved `SocketAddr`s. /// - /// The returned iterator may not actually yield any values depending on the + /// The returned iterator might not actually yield any values depending on the /// outcome of any resolution performed. /// /// Note that this function may block the current thread while resolution is diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs index b9af5992dffdf..ba1483073d6f7 100644 --- a/library/std/src/net/udp.rs +++ b/library/std/src/net/udp.rs @@ -406,7 +406,7 @@ impl UdpSocket { /// Sets the value of the `IP_MULTICAST_LOOP` option for this socket. /// /// If enabled, multicast packets will be looped back to the local socket. - /// Note that this may not have any effect on IPv6 sockets. + /// Note that this might not have any effect on IPv6 sockets. /// /// # Examples /// @@ -445,7 +445,7 @@ impl UdpSocket { /// this socket. The default value is 1 which means that multicast packets /// don't leave the local network unless explicitly requested. /// - /// Note that this may not have any effect on IPv6 sockets. + /// Note that this might not have any effect on IPv6 sockets. /// /// # Examples /// @@ -481,7 +481,7 @@ impl UdpSocket { /// Sets the value of the `IPV6_MULTICAST_LOOP` option for this socket. /// /// Controls whether this socket sees the multicast packets it sends itself. - /// Note that this may not have any affect on IPv4 sockets. + /// Note that this might not have any affect on IPv4 sockets. /// /// # Examples /// diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 64b22b64f4bf1..3b264a692e2f8 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -303,7 +303,7 @@ mod prim_never {} /// /// [`String`]: string/struct.String.html /// -/// As always, remember that a human intuition for 'character' may not map to +/// As always, remember that a human intuition for 'character' might not map to /// Unicode's definitions. For example, despite looking similar, the 'é' /// character is one Unicode code point while 'é' is two Unicode code points: /// diff --git a/library/std/src/sync/condvar.rs b/library/std/src/sync/condvar.rs index ffc1e57f4e03f..0be1a81706569 100644 --- a/library/std/src/sync/condvar.rs +++ b/library/std/src/sync/condvar.rs @@ -255,7 +255,7 @@ impl Condvar { /// except that the thread will be blocked for roughly no longer /// than `ms` milliseconds. This method should not be used for /// precise timing due to anomalies such as preemption or platform - /// differences that may not cause the maximum amount of time + /// differences that might not cause the maximum amount of time /// waited to be precisely `ms`. /// /// Note that the best effort is made to ensure that the time waited is @@ -318,7 +318,7 @@ impl Condvar { /// The semantics of this function are equivalent to [`wait`] except that /// the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as - /// preemption or platform differences that may not cause the maximum + /// preemption or platform differences that might not cause the maximum /// amount of time waited to be precisely `dur`. /// /// Note that the best effort is made to ensure that the time waited is @@ -393,7 +393,7 @@ impl Condvar { /// The semantics of this function are equivalent to [`wait_while`] except /// that the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as - /// preemption or platform differences that may not cause the maximum + /// preemption or platform differences that might not cause the maximum /// amount of time waited to be precisely `dur`. /// /// Note that the best effort is made to ensure that the time waited is diff --git a/library/std/src/sync/mpsc/mpsc_queue.rs b/library/std/src/sync/mpsc/mpsc_queue.rs index 42bc639dc2527..110d6843cce8a 100644 --- a/library/std/src/sync/mpsc/mpsc_queue.rs +++ b/library/std/src/sync/mpsc/mpsc_queue.rs @@ -6,7 +6,7 @@ //! //! Note that the current implementation of this queue has a caveat of the `pop` //! method, and see the method for more information about it. Due to this -//! caveat, this queue may not be appropriate for all use-cases. +//! caveat, this queue might not be appropriate for all use-cases. // http://www.1024cores.net/home/lock-free-algorithms // /queues/non-intrusive-mpsc-node-based-queue diff --git a/library/std/src/sync/mpsc/stream.rs b/library/std/src/sync/mpsc/stream.rs index a652f24c58a19..2a1d3f8967e99 100644 --- a/library/std/src/sync/mpsc/stream.rs +++ b/library/std/src/sync/mpsc/stream.rs @@ -339,7 +339,7 @@ impl Packet { // At this point in time, we have gated all future senders from sending, // and we have flagged the channel as being disconnected. The senders - // still have some responsibility, however, because some sends may not + // still have some responsibility, however, because some sends might not // complete until after we flag the disconnection. There are more // details in the sending methods that see DISCONNECTED } @@ -370,7 +370,7 @@ impl Packet { // at all. // // Hence, because of these invariants, we immediately return `Ok(true)`. - // Note that the data may not actually be sent on the channel just yet. + // Note that the data might not actually be sent on the channel just yet. // The other end could have flagged the upgrade but not sent data to // this end. This is fine because we know it's a small bounded windows // of time until the data is actually sent. diff --git a/library/std/src/sync/once.rs b/library/std/src/sync/once.rs index 2e5f843fc43cb..2d3ac94fab8b2 100644 --- a/library/std/src/sync/once.rs +++ b/library/std/src/sync/once.rs @@ -198,7 +198,7 @@ impl Once { /// routine is currently running. /// /// When this function returns, it is guaranteed that some initialization - /// has run and completed (it may not be the closure specified). It is also + /// has run and completed (it might not be the closure specified). It is also /// guaranteed that any memory writes performed by the executed closure can /// be reliably observed by other threads at this point (there is a /// happens-before relation between the closure and code executing after the diff --git a/library/std/src/sys/unix/ext/process.rs b/library/std/src/sys/unix/ext/process.rs index bc3bc0dcb0ce3..568cb700f9e26 100644 --- a/library/std/src/sys/unix/ext/process.rs +++ b/library/std/src/sys/unix/ext/process.rs @@ -77,7 +77,7 @@ pub trait CommandExt: Sealed { /// /// When this closure is run, aspects such as the stdio file descriptors and /// working directory have successfully been changed, so output to these - /// locations may not appear where intended. + /// locations might not appear where intended. /// /// [POSIX fork() specification]: /// https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html diff --git a/library/std/src/sys/windows/mutex.rs b/library/std/src/sys/windows/mutex.rs index 12c5ea741f9ef..56f91ebe58287 100644 --- a/library/std/src/sys/windows/mutex.rs +++ b/library/std/src/sys/windows/mutex.rs @@ -1,6 +1,6 @@ //! System Mutexes //! -//! The Windows implementation of mutexes is a little odd and it may not be +//! The Windows implementation of mutexes is a little odd and it might not be //! immediately obvious what's going on. The primary oddness is that SRWLock is //! used instead of CriticalSection, and this is done because: //! diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs index be3141e46a1cc..2973951fe9004 100644 --- a/library/std/src/sys/windows/stdio.rs +++ b/library/std/src/sys/windows/stdio.rs @@ -169,7 +169,7 @@ impl io::Read for Stdin { // We assume that if the last `u16` is an unpaired surrogate they got sliced apart by our // buffer size, and keep it around for the next read hoping to put them together. -// This is a best effort, and may not work if we are not the only reader on Stdin. +// This is a best effort, and might not work if we are not the only reader on Stdin. fn read_u16s_fixup_surrogates( handle: c::HANDLE, buf: &mut [u16], diff --git a/library/std/src/sys_common/poison.rs b/library/std/src/sys_common/poison.rs index 2ab2c700a1bf1..d54c4e88ee8c9 100644 --- a/library/std/src/sys_common/poison.rs +++ b/library/std/src/sys_common/poison.rs @@ -119,7 +119,7 @@ pub type LockResult = Result>; /// A type alias for the result of a nonblocking locking method. /// /// For more information, see [`LockResult`]. A `TryLockResult` doesn't -/// necessarily hold the associated guard in the [`Err`] type as the lock may not +/// necessarily hold the associated guard in the [`Err`] type as the lock might not /// have been acquired for other reasons. #[stable(feature = "rust1", since = "1.0.0")] pub type TryLockResult = Result>; diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index ffdf4be158457..238749f8b490b 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -903,7 +903,7 @@ pub fn park() { /// The semantics of this function are equivalent to [`park`] except /// that the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as -/// preemption or platform differences that may not cause the maximum +/// preemption or platform differences that might not cause the maximum /// amount of time waited to be precisely `ms` long. /// /// See the [park documentation][`park`] for more detail. @@ -919,7 +919,7 @@ pub fn park_timeout_ms(ms: u32) { /// The semantics of this function are equivalent to [`park`][park] except /// that the thread will be blocked for roughly no longer than `dur`. This /// method should not be used for precise timing due to anomalies such as -/// preemption or platform differences that may not cause the maximum +/// preemption or platform differences that might not cause the maximum /// amount of time waited to be precisely `dur` long. /// /// See the [park documentation][park] for more details. diff --git a/library/std/src/time.rs b/library/std/src/time.rs index 89addae078948..73408fb077eee 100644 --- a/library/std/src/time.rs +++ b/library/std/src/time.rs @@ -34,7 +34,7 @@ pub use core::time::Duration; /// benchmarks or timing how long an operation takes. /// /// Note, however, that instants are not guaranteed to be **steady**. In other -/// words, each tick of the underlying clock may not be the same length (e.g. +/// words, each tick of the underlying clock might not be the same length (e.g. /// some seconds may be longer than others). An instant may jump forwards or /// experience time dilation (slow down or speed up), but it will never go /// backwards. @@ -485,7 +485,7 @@ impl SystemTime { /// /// This function may fail as the underlying system clock is susceptible to /// drift and updates (e.g., the system clock could go backwards), so this - /// function may not always succeed. If successful, [`Ok`]`(`[`Duration`]`)` is + /// function might not always succeed. If successful, [`Ok`]`(`[`Duration`]`)` is /// returned where the duration represents the amount of time elapsed from /// this time measurement to the current time. ///