@@ -283,7 +283,7 @@ extern "rust-intrinsic" {
283
283
/// [invalid value]
284
284
/// (https://doc.rust-lang.org/nomicon/meet-safe-and-unsafe.html).
285
285
///
286
- /// `transmute::<T, U>(t) ` is semantically equivalent to the following:
286
+ /// `transmute` is semantically equivalent to the following:
287
287
///
288
288
/// ```
289
289
/// use std::{mem, ptr};
@@ -303,7 +303,7 @@ extern "rust-intrinsic" {
303
303
/// the absolute last resort.
304
304
///
305
305
/// The [nomicon](https://doc.rust-lang.org/nomicon/transmutes.html) has
306
- /// more complete documentation. Read it before using `transmute` .
306
+ /// additional documentation.
307
307
///
308
308
/// # Alternatives
309
309
///
@@ -343,13 +343,13 @@ extern "rust-intrinsic" {
343
343
/// ```
344
344
/// // this is not a good way to do this.
345
345
/// let slice = unsafe { mem::transmute::<&str, &[u8]>("Rust") };
346
- /// assert_eq!(slice, [82, 117, 115, 116]);
346
+ /// assert_eq!(slice, & [82, 117, 115, 116]);
347
347
/// // You could use `str::as_bytes`
348
348
/// let slice = "Rust".as_bytes();
349
- /// assert_eq!(slice, [82, 117, 115, 116]);
349
+ /// assert_eq!(slice, & [82, 117, 115, 116]);
350
350
/// // Or, just use a byte string, if you have control over the string
351
351
/// // literal
352
- /// assert_eq!(b"Rust", [82, 117, 116, 116]);
352
+ /// assert_eq!(b"Rust", & [82, 117, 116, 116]);
353
353
/// ```
354
354
///
355
355
/// Turning a `Vec<&T>` into a `Vec<Option<&T>>`:
@@ -373,7 +373,7 @@ extern "rust-intrinsic" {
373
373
/// // exact same size, and the same or lesser alignment, as the old
374
374
/// // type. The same caveats exist for this method as transmute, for
375
375
/// // the original inner type (`&i32`) to the converted inner type
376
- /// // (`Option<&i32>`), so read the nomicon page linked above.
376
+ /// // (`Option<&i32>`), so read the nomicon pages linked above.
377
377
/// let v_from_raw = Vec::from_raw_parts(v_orig.as_mut_ptr(),
378
378
/// v_orig.len(),
379
379
/// v_orig.capacity());
@@ -441,7 +441,7 @@ extern "rust-intrinsic" {
441
441
/// assert_eq!(bitpattern, 0x3F800000);
442
442
/// ```
443
443
///
444
- /// Turning a pointer into a function pointer (this isn't guaranteed to
444
+ /// Turning a pointer into a function pointer (this is not guaranteed to
445
445
/// work in Rust, although, for example, Linux does make this guarantee):
446
446
///
447
447
/// ```
@@ -453,8 +453,8 @@ extern "rust-intrinsic" {
453
453
/// assert_eq!(function(), 0);
454
454
/// ```
455
455
///
456
- /// Extending a lifetime, or shortening an invariant an invariant lifetime;
457
- /// this is advanced, very unsafe rust:
456
+ /// Extending a lifetime, or shortening an invariant lifetime; this is
457
+ /// advanced, very unsafe rust:
458
458
///
459
459
/// ```
460
460
/// use std::mem;
@@ -464,11 +464,10 @@ extern "rust-intrinsic" {
464
464
/// mem::transmute::<R<'b>, R<'static>>(ptr);
465
465
/// }
466
466
///
467
- /// unsafe fn shorten_invariant<'b, 'c>(r: &'b mut R<'static>)
468
- /// -> &'b R<'c> {
469
- /// let ref_to_original =
470
- /// mem::transmute::<&'b mut R<'static>, &'b mut R<'c>>(
471
- /// ref_to_extended);
467
+ /// unsafe fn shorten_invariant_lifetime<'b, 'c>(r: &'b mut R<'static>)
468
+ /// -> &'b mut R<'c> {
469
+ /// mem::transmute::<&'b mut R<'static>, &'b mut R<'c>>(
470
+ /// ref_to_extended)
472
471
/// }
473
472
/// ```
474
473
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
0 commit comments