File tree Expand file tree Collapse file tree 13 files changed +109
-111
lines changed Expand file tree Collapse file tree 13 files changed +109
-111
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ fn test_append() {
102
102
assert_eq ! ( m. pop_front( ) , Some ( elt) )
103
103
}
104
104
assert_eq ! ( n. len( ) , 0 ) ;
105
- // let 's make sure it's working properly, since we
106
- // did some direct changes to private members
105
+ // Let 's make sure it's working properly, since we
106
+ // did some direct changes to private members.
107
107
n. push_back ( 3 ) ;
108
108
assert_eq ! ( n. len( ) , 1 ) ;
109
109
assert_eq ! ( n. pop_front( ) , Some ( 3 ) ) ;
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ fn allocator_param() {
5
5
use crate :: alloc:: AllocErr ;
6
6
7
7
// Writing a test of integration between third-party
8
- // allocators and RawVec is a little tricky because the RawVec
8
+ // allocators and ` RawVec` is a little tricky because the ` RawVec`
9
9
// API does not expose fallible allocation methods, so we
10
10
// cannot check what happens when allocator is exhausted
11
11
// (beyond detecting a panic).
12
12
//
13
- // Instead, this just checks that the RawVec methods do at
13
+ // Instead, this just checks that the ` RawVec` methods do at
14
14
// least go through the Allocator API when it reserves
15
15
// storage.
16
16
@@ -44,7 +44,7 @@ fn allocator_param() {
44
44
fn reserve_does_not_overallocate ( ) {
45
45
{
46
46
let mut v: RawVec < u32 > = RawVec :: new ( ) ;
47
- // First `reserve` allocates like `reserve_exact`
47
+ // First, `reserve` allocates like `reserve_exact`.
48
48
v. reserve ( 0 , 9 ) ;
49
49
assert_eq ! ( 9 , v. capacity( ) ) ;
50
50
}
Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ impl<T: ?Sized> Rc<T> {
567
567
/// let x = Rc::from_raw(x_ptr);
568
568
/// assert_eq!(&*x, "hello");
569
569
///
570
- /// // Further calls to `Rc::from_raw(x_ptr)` would be memory unsafe.
570
+ /// // Further calls to `Rc::from_raw(x_ptr)` would be memory- unsafe.
571
571
/// }
572
572
///
573
573
/// // The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ impl<T: ?Sized> Arc<T> {
547
547
/// let x = Arc::from_raw(x_ptr);
548
548
/// assert_eq!(&*x, "hello");
549
549
///
550
- /// // Further calls to `Arc::from_raw(x_ptr)` would be memory unsafe.
550
+ /// // Further calls to `Arc::from_raw(x_ptr)` would be memory- unsafe.
551
551
/// }
552
552
///
553
553
/// // The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
Original file line number Diff line number Diff line change @@ -153,13 +153,13 @@ impl dyn Any {
153
153
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
154
154
#[ inline]
155
155
pub fn is < T : Any > ( & self ) -> bool {
156
- // Get TypeId of the type this function is instantiated with
156
+ // Get ` TypeId` of the type this function is instantiated with.
157
157
let t = TypeId :: of :: < T > ( ) ;
158
158
159
- // Get TypeId of the type in the trait object
159
+ // Get ` TypeId` of the type in the trait object.
160
160
let concrete = self . type_id ( ) ;
161
161
162
- // Compare both TypeIds on equality
162
+ // Compare both `TypeId`s on equality.
163
163
t == concrete
164
164
}
165
165
Original file line number Diff line number Diff line change @@ -602,10 +602,10 @@ unsafe impl<T: ?Sized> Freeze for *mut T {}
602
602
unsafe impl < T : ?Sized > Freeze for & T { }
603
603
unsafe impl < T : ?Sized > Freeze for & mut T { }
604
604
605
- /// Types which can be safely moved after being pinned.
605
+ /// Types that can be safely moved after being pinned.
606
606
///
607
607
/// Since Rust itself has no notion of immovable types, and considers moves
608
- /// (e.g. through assignment or [`mem::replace`]) to always be safe,
608
+ /// (e.g., through assignment or [`mem::replace`]) to always be safe,
609
609
/// this trait cannot prevent types from moving by itself.
610
610
///
611
611
/// Instead it is used to prevent moves through the type system,
Original file line number Diff line number Diff line change @@ -1042,7 +1042,7 @@ impl<T: ?Sized> *const T {
1042
1042
( self as * const u8 ) == null ( )
1043
1043
}
1044
1044
1045
- /// Cast to a pointer to a different type
1045
+ /// Casts to a pointer of another type.
1046
1046
#[ stable( feature = "ptr_cast" , since = "1.38.0" ) ]
1047
1047
#[ inline]
1048
1048
pub const fn cast < U > ( self ) -> * const U {
@@ -1726,7 +1726,7 @@ impl<T: ?Sized> *mut T {
1726
1726
( self as * mut u8 ) == null_mut ( )
1727
1727
}
1728
1728
1729
- /// Cast to a pointer to a different type
1729
+ /// Casts to a pointer of another type.
1730
1730
#[ stable( feature = "ptr_cast" , since = "1.38.0" ) ]
1731
1731
#[ inline]
1732
1732
pub const fn cast < U > ( self ) -> * mut U {
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ impl<T: ?Sized> NonNull<T> {
125
125
& mut * self . as_ptr ( )
126
126
}
127
127
128
- /// Cast to a pointer of another type
128
+ /// Casts to a pointer of another type.
129
129
#[ stable( feature = "nonnull_cast" , since = "1.27.0" ) ]
130
130
#[ inline]
131
131
pub const fn cast < U > ( self ) -> NonNull < U > {
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ impl Error for VarError {
290
290
///
291
291
/// Note that while concurrent access to environment variables is safe in Rust,
292
292
/// some platforms only expose inherently unsafe non-threadsafe APIs for
293
- /// inspecting the environment. As a result extra care needs to be taken when
293
+ /// inspecting the environment. As a result, extra care needs to be taken when
294
294
/// auditing calls to unsafe external FFI functions to ensure that any external
295
295
/// environment accesses are properly synchronized with accesses in Rust.
296
296
///
You can’t perform that action at this time.
0 commit comments