mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Auto merge of #87445 - amalik18:issue-83584-fix, r=kennytm
Fix may not to appropriate might not or must not I went through and changed occurrences of `may not` to be more explicit with `might not` and `must not`.
This commit is contained in:
commit
fe1c942eee
@ -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;
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ impl<K, V> NodeRef<marker::Dying, K, V, marker::LeafOrInternal> {
|
||||
|
||||
impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, 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
|
||||
@ -777,7 +777,7 @@ impl<BorrowType, K, V, NodeType, HandleType>
|
||||
|
||||
impl<'a, K, V, NodeType, HandleType> Handle<NodeRef<marker::Mut<'a>, 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`.
|
||||
|
@ -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` must not contain any `'{'` or `'}'` characters.
|
||||
//!
|
||||
//! # Formatting traits
|
||||
//!
|
||||
|
@ -2526,7 +2526,7 @@ unsafe fn data_offset<T: ?Sized>(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 must not be relied upon outside of std.
|
||||
unsafe { data_offset_align(align_of_val_raw(ptr)) }
|
||||
}
|
||||
|
||||
|
@ -921,7 +921,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);
|
||||
@ -969,7 +969,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);
|
||||
@ -1517,7 +1517,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
|
||||
|
@ -1056,8 +1056,8 @@ impl<T: ?Sized> Arc<T> {
|
||||
// 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
|
||||
// allocation itself (there may still be weak pointers lying around).
|
||||
// Destroy the data at this time, even though we must not free the box
|
||||
// allocation itself (there might still be weak pointers lying around).
|
||||
unsafe { ptr::drop_in_place(Self::get_mut_unchecked(self)) };
|
||||
|
||||
// Drop the weak ref collectively held by all strong references
|
||||
@ -2587,7 +2587,7 @@ unsafe fn data_offset<T: ?Sized>(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 must not be relied upon outside of std.
|
||||
unsafe { data_offset_align(align_of_val_raw(ptr)) }
|
||||
}
|
||||
|
||||
|
@ -2229,7 +2229,7 @@ impl<T, A: Allocator> Vec<T, A> {
|
||||
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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -408,7 +408,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
|
||||
|
@ -99,7 +99,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 must 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
|
||||
|
@ -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.
|
||||
///
|
||||
|
@ -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.
|
||||
|
@ -277,7 +277,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
|
||||
|
@ -2078,7 +2078,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
|
||||
|
@ -941,7 +941,7 @@ pub fn drop<T>(_x: T) {}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_transmute_copy", issue = "83165")]
|
||||
pub const unsafe fn transmute_copy<T, U>(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::<U>() > align_of::<T>() {
|
||||
// SAFETY: `src` is a reference which is guaranteed to be valid for reads.
|
||||
// The caller must guarantee that the actual transmutation is safe.
|
||||
|
@ -1748,7 +1748,7 @@ macro_rules! int_impl {
|
||||
|
||||
/// Returns the logarithm of the number with respect to an arbitrary base.
|
||||
///
|
||||
/// This method may not be optimized owing to implementation details;
|
||||
/// This method might not be optimized owing to implementation details;
|
||||
/// `log2` can produce results more efficiently for base 2, and `log10`
|
||||
/// can produce results more efficiently for base 10.
|
||||
///
|
||||
@ -1856,7 +1856,7 @@ macro_rules! int_impl {
|
||||
///
|
||||
/// Returns `None` if the number is negative or zero, or if the base is not at least 2.
|
||||
///
|
||||
/// This method may not be optimized owing to implementation details;
|
||||
/// This method might not be optimized owing to implementation details;
|
||||
/// `checked_log2` can produce results more efficiently for base 2, and
|
||||
/// `checked_log10` can produce results more efficiently for base 10.
|
||||
///
|
||||
|
@ -637,7 +637,7 @@ macro_rules! uint_impl {
|
||||
|
||||
/// Returns the logarithm of the number with respect to an arbitrary base.
|
||||
///
|
||||
/// This method may not be optimized owing to implementation details;
|
||||
/// This method might not be optimized owing to implementation details;
|
||||
/// `log2` can produce results more efficiently for base 2, and `log10`
|
||||
/// can produce results more efficiently for base 10.
|
||||
///
|
||||
@ -745,7 +745,7 @@ macro_rules! uint_impl {
|
||||
///
|
||||
/// Returns `None` if the number is zero, or if the base is not at least 2.
|
||||
///
|
||||
/// This method may not be optimized owing to implementation details;
|
||||
/// This method might not be optimized owing to implementation details;
|
||||
/// `checked_log2` can produce results more efficiently for base 2, and
|
||||
/// `checked_log10` can produce results more efficiently for base 10.
|
||||
///
|
||||
|
@ -319,7 +319,7 @@ pub trait FromResidual<R = <Self as Try>::Residual> {
|
||||
/// This should be implemented consistently with the `branch` method such
|
||||
/// that applying the `?` operator will get back an equivalent residual:
|
||||
/// `FromResidual::from_residual(r).branch() --> ControlFlow::Break(r)`.
|
||||
/// (It may not be an *identical* residual when interconversion is involved.)
|
||||
/// (It must not be an *identical* residual when interconversion is involved.)
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
@ -159,9 +159,9 @@
|
||||
//! section needs to function correctly.
|
||||
//!
|
||||
//! 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
|
||||
//! completely okay to not ever call [`drop`] on a pinned element (e.g., you can still
|
||||
//! call [`mem::forget`] on a <code>[Pin]<[Box]\<T>></code>). 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 must not free or reuse the storage
|
||||
//! *without calling [`drop`]*.
|
||||
//!
|
||||
//! # `Drop` implementation
|
||||
|
@ -244,7 +244,7 @@ impl<T: ?Sized> *const T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
|
||||
@ -404,7 +404,7 @@ impl<T: ?Sized> *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 might 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.
|
||||
@ -435,7 +435,7 @@ impl<T: ?Sized> *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 might 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.
|
||||
@ -590,7 +590,7 @@ impl<T: ?Sized> *const T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z`
|
||||
@ -652,7 +652,7 @@ impl<T: ?Sized> *const T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z`
|
||||
|
@ -250,7 +250,7 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
|
||||
@ -419,7 +419,7 @@ impl<T: ?Sized> *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 might 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.
|
||||
@ -450,7 +450,7 @@ impl<T: ?Sized> *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 might 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.
|
||||
@ -696,7 +696,7 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z`
|
||||
@ -758,7 +758,7 @@ impl<T: ?Sized> *mut T {
|
||||
///
|
||||
/// This operation itself is always safe, but using the resulting pointer is not.
|
||||
///
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it may not
|
||||
/// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
|
||||
/// be used to read or write other allocated objects.
|
||||
///
|
||||
/// In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z`
|
||||
|
@ -2274,7 +2274,7 @@ impl<T> [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.
|
||||
@ -2309,7 +2309,7 @@ impl<T> [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
|
||||
@ -2364,7 +2364,7 @@ impl<T> [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
|
||||
|
@ -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
|
||||
///
|
||||
@ -633,7 +633,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.
|
||||
///
|
||||
@ -660,7 +660,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
|
||||
///
|
||||
@ -713,7 +713,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
|
||||
///
|
||||
|
@ -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:
|
||||
//!
|
||||
|
@ -7,7 +7,7 @@ const ANDROID_SET_ABORT_MESSAGE: &[u8] = b"android_set_abort_message\0";
|
||||
type SetAbortMessageType = unsafe extern "C" fn(*const libc::c_char) -> ();
|
||||
|
||||
// Forward the abort message to libc's android_set_abort_message. We try our best to populate the
|
||||
// message but as this function may already be called as part of a failed allocation, it may not be
|
||||
// message but as this function may already be called as part of a failed allocation, it might not be
|
||||
// possible to do so.
|
||||
//
|
||||
// Some methods of core are on purpose avoided (such as try_reserve) as these rely on the correct
|
||||
|
@ -386,7 +386,7 @@ fn run_client<A: for<'a, 's> 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 ());
|
||||
|
@ -467,10 +467,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")]
|
||||
@ -657,7 +657,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,
|
||||
}
|
||||
@ -973,7 +973,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()`
|
||||
@ -995,7 +995,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()`
|
||||
@ -1044,7 +1044,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
|
||||
@ -1065,7 +1065,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
|
||||
@ -1085,7 +1085,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
|
||||
@ -1106,7 +1106,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
|
||||
|
@ -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")]
|
||||
|
@ -682,7 +682,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||
/// 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
|
||||
@ -698,7 +698,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
|
||||
@ -711,7 +711,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
|
||||
@ -748,7 +748,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 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
|
||||
|
@ -409,7 +409,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.
|
||||
///
|
||||
|
@ -409,7 +409,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.
|
||||
///
|
||||
|
@ -419,7 +419,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
|
||||
@ -1081,7 +1081,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
|
||||
@ -1116,7 +1116,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
|
||||
@ -1148,7 +1148,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
|
||||
|
@ -824,7 +824,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");
|
||||
}
|
||||
|
@ -555,7 +555,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 must 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
|
||||
@ -1369,7 +1369,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.
|
||||
///
|
||||
|
@ -874,7 +874,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
|
||||
|
@ -408,7 +408,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
|
||||
///
|
||||
@ -447,7 +447,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
|
||||
///
|
||||
@ -483,7 +483,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
|
||||
///
|
||||
|
@ -31,7 +31,7 @@ pub(super) unsafe fn sockaddr_un(path: &Path) -> io::Result<(libc::sockaddr_un,
|
||||
if bytes.contains(&0) {
|
||||
return Err(io::Error::new_const(
|
||||
io::ErrorKind::InvalidInput,
|
||||
&"paths may not contain interior null bytes",
|
||||
&"paths must not contain interior null bytes",
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,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
|
||||
|
@ -163,7 +163,7 @@ pub auto trait RefUnwindSafe {}
|
||||
/// When using [`catch_unwind`] it may be the case that some of the closed over
|
||||
/// variables are not unwind safe. For example if `&mut T` is captured the
|
||||
/// compiler will generate a warning indicating that it is not unwind safe. It
|
||||
/// may not be the case, however, that this is actually a problem due to the
|
||||
/// might not be the case, however, that this is actually a problem due to the
|
||||
/// specific usage of [`catch_unwind`] if unwind safety is specifically taken into
|
||||
/// account. This wrapper struct is useful for a quick and lightweight
|
||||
/// annotation that a variable is indeed unwind safe.
|
||||
@ -406,7 +406,7 @@ impl<S: Stream> Stream for AssertUnwindSafe<S> {
|
||||
///
|
||||
/// # Notes
|
||||
///
|
||||
/// Note that this function **may not catch all panics** in Rust. A panic in
|
||||
/// Note that this function **might not catch all panics** in Rust. A panic in
|
||||
/// Rust is not always implemented via unwinding, but can be implemented by
|
||||
/// aborting the process as well. This function *only* catches unwinding panics,
|
||||
/// not those that abort the process.
|
||||
|
@ -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:
|
||||
///
|
||||
|
@ -254,7 +254,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
|
||||
@ -317,7 +317,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
|
||||
@ -392,7 +392,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
|
||||
|
@ -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.
|
||||
|
||||
// https://www.1024cores.net/home/lock-free-algorithms
|
||||
// /queues/non-intrusive-mpsc-node-based-queue
|
||||
|
@ -339,7 +339,7 @@ impl<T> Packet<T> {
|
||||
|
||||
// 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<T> Packet<T> {
|
||||
// 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.
|
||||
|
@ -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
|
||||
|
@ -120,7 +120,7 @@ pub type LockResult<Guard> = Result<Guard, PoisonError<Guard>>;
|
||||
/// 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<Guard> = Result<Guard, TryLockError<Guard>>;
|
||||
|
@ -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:
|
||||
//!
|
||||
|
@ -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],
|
||||
|
@ -906,7 +906,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.
|
||||
@ -922,7 +922,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.
|
||||
|
@ -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.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user