Skip to content

Commit fe1c942

Browse files
committed
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`.
2 parents e66a8c2 + ffcf8a0 commit fe1c942

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+96
-96
lines changed

library/alloc/benches/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn bench_peek_mut_deref_mut(b: &mut Bencher) {
3636
let mut peek_mut = bheap.peek_mut().unwrap();
3737
// The compiler shouldn't be able to optimize away the `sift_down`
3838
// assignment in `PeekMut`'s `DerefMut` implementation since
39-
// the loop may not run.
39+
// the loop might not run.
4040
for &i in vec.iter() {
4141
*peek_mut = i;
4242
}

library/alloc/src/collections/btree/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ impl<K, V> NodeRef<marker::Dying, K, V, marker::LeafOrInternal> {
409409

410410
impl<'a, K, V, Type> NodeRef<marker::Mut<'a>, K, V, Type> {
411411
/// Temporarily takes out another mutable reference to the same node. Beware, as
412-
/// this method is very dangerous, doubly so since it may not immediately appear
412+
/// this method is very dangerous, doubly so since it might not immediately appear
413413
/// dangerous.
414414
///
415415
/// Because mutable pointers can roam anywhere around the tree, the returned
@@ -777,7 +777,7 @@ impl<BorrowType, K, V, NodeType, HandleType>
777777

778778
impl<'a, K, V, NodeType, HandleType> Handle<NodeRef<marker::Mut<'a>, K, V, NodeType>, HandleType> {
779779
/// Temporarily takes out another mutable handle on the same location. Beware, as
780-
/// this method is very dangerous, doubly so since it may not immediately appear
780+
/// this method is very dangerous, doubly so since it might not immediately appear
781781
/// dangerous.
782782
///
783783
/// For details, see `NodeRef::reborrow_mut`.

library/alloc/src/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
//! the `0` flag (see below) is specified for numerics, then the implicit fill character is
139139
//! `0`.
140140
//!
141-
//! Note that alignment may not be implemented by some types. In particular, it
141+
//! Note that alignment might not be implemented by some types. In particular, it
142142
//! is not generally implemented for the `Debug` trait. A good way to ensure
143143
//! padding is applied is to format your input, then pad this resulting string
144144
//! to obtain your output:
@@ -300,7 +300,7 @@
300300
//! count := parameter | integer
301301
//! parameter := argument '$'
302302
//! ```
303-
//! In the above grammar, `text` may not contain any `'{'` or `'}'` characters.
303+
//! In the above grammar, `text` must not contain any `'{'` or `'}'` characters.
304304
//!
305305
//! # Formatting traits
306306
//!

library/alloc/src/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
25262526
// SAFETY: since the only unsized types possible are slices, trait objects,
25272527
// and extern types, the input safety requirement is currently enough to
25282528
// satisfy the requirements of align_of_val_raw; this is an implementation
2529-
// detail of the language that may not be relied upon outside of std.
2529+
// detail of the language that must not be relied upon outside of std.
25302530
unsafe { data_offset_align(align_of_val_raw(ptr)) }
25312531
}
25322532

library/alloc/src/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ impl String {
921921
/// assert!(s.capacity() >= 10);
922922
/// ```
923923
///
924-
/// This may not actually increase the capacity:
924+
/// This might not actually increase the capacity:
925925
///
926926
/// ```
927927
/// let mut s = String::with_capacity(10);
@@ -969,7 +969,7 @@ impl String {
969969
/// assert!(s.capacity() >= 10);
970970
/// ```
971971
///
972-
/// This may not actually increase the capacity:
972+
/// This might not actually increase the capacity:
973973
///
974974
/// ```
975975
/// let mut s = String::with_capacity(10);
@@ -1517,7 +1517,7 @@ impl String {
15171517
}
15181518

15191519
/// Returns the length of this `String`, in bytes, not [`char`]s or
1520-
/// graphemes. In other words, it may not be what a human considers the
1520+
/// graphemes. In other words, it might not be what a human considers the
15211521
/// length of the string.
15221522
///
15231523
/// # Examples

library/alloc/src/sync.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,8 @@ impl<T: ?Sized> Arc<T> {
10561056
// Non-inlined part of `drop`.
10571057
#[inline(never)]
10581058
unsafe fn drop_slow(&mut self) {
1059-
// Destroy the data at this time, even though we may not free the box
1060-
// allocation itself (there may still be weak pointers lying around).
1059+
// Destroy the data at this time, even though we must not free the box
1060+
// allocation itself (there might still be weak pointers lying around).
10611061
unsafe { ptr::drop_in_place(Self::get_mut_unchecked(self)) };
10621062

10631063
// Drop the weak ref collectively held by all strong references
@@ -2587,7 +2587,7 @@ unsafe fn data_offset<T: ?Sized>(ptr: *const T) -> isize {
25872587
// SAFETY: since the only unsized types possible are slices, trait objects,
25882588
// and extern types, the input safety requirement is currently enough to
25892589
// satisfy the requirements of align_of_val_raw; this is an implementation
2590-
// detail of the language that may not be relied upon outside of std.
2590+
// detail of the language that must not be relied upon outside of std.
25912591
unsafe { data_offset_align(align_of_val_raw(ptr)) }
25922592
}
25932593

library/alloc/src/vec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,7 @@ impl<T, A: Allocator> Vec<T, A> {
22292229
unsafe {
22302230
let mut ptr = self.as_mut_ptr().add(self.len());
22312231
// Use SetLenOnDrop to work around bug where compiler
2232-
// may not realize the store through `ptr` through self.set_len()
2232+
// might not realize the store through `ptr` through self.set_len()
22332233
// don't alias.
22342234
let mut local_len = SetLenOnDrop::new(&mut self.len);
22352235

library/alloc/src/vec/source_iter_marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656

5757
let src = unsafe { iterator.as_inner().as_into_iter() };
5858
// check if SourceIter contract was upheld
59-
// caveat: if they weren't we may not even make it to this point
59+
// caveat: if they weren't we might not even make it to this point
6060
debug_assert_eq!(src_buf, src.buf.as_ptr());
6161
// check InPlaceIterable contract. This is only possible if the iterator advanced the
6262
// source pointer at all. If it uses unchecked access via TrustedRandomAccess

library/alloc/tests/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ fn test_retain() {
408408
// old binaryheap failed this test
409409
//
410410
// Integrity means that all elements are present after a comparison panics,
411-
// even if the order may not be correct.
411+
// even if the order might not be correct.
412412
//
413413
// Destructors must be called exactly once per element.
414414
// FIXME: re-enable emscripten once it can unwind again

library/core/src/alloc/global.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ use crate::ptr;
9999
/// this trait are allowed to rely on the contracts defined on each method,
100100
/// and implementors must ensure such contracts remain true.
101101
///
102-
/// * You may not rely on allocations actually happening, even if there are explicit
102+
/// * You must not rely on allocations actually happening, even if there are explicit
103103
/// heap allocations in the source. The optimizer may detect unused allocations that it can either
104104
/// eliminate entirely or move to the stack and thus never invoke the allocator. The
105105
/// optimizer may further assume that allocation is infallible, so code that used to fail due

0 commit comments

Comments
 (0)