Skip to content

Commit c77024c

Browse files
committedJun 9, 2019
Fix more tests after revert of rustdoc cfg(test) feature
1 parent 6c747e0 commit c77024c

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed
 

‎src/libcore/marker.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ impl<T: ?Sized> !Send for *mut T { }
7373
/// impl Foo for Impl { }
7474
/// impl Bar for Impl { }
7575
///
76-
/// let x: &Foo = &Impl; // OK
77-
/// // let y: &Bar = &Impl; // error: the trait `Bar` cannot
78-
/// // be made into an object
76+
/// let x: &dyn Foo = &Impl; // OK
77+
/// // let y: &dyn Bar = &Impl; // error: the trait `Bar` cannot
78+
/// // be made into an object
7979
/// ```
8080
///
8181
/// [trait object]: ../../book/ch17-02-trait-objects.html

‎src/libcore/mem/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
510510
/// A simple example:
511511
///
512512
/// ```
513+
/// #![feature(mem_take)]
514+
///
513515
/// use std::mem;
514516
///
515517
/// let mut v: Vec<i32> = vec![1, 2];
@@ -540,7 +542,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
540542
/// `self`, allowing it to be returned:
541543
///
542544
/// ```
543-
/// # #![allow(dead_code)]
545+
/// #![feature(mem_take)]
546+
///
544547
/// use std::mem;
545548
///
546549
/// # struct Buffer<T> { buf: Vec<T> }

‎src/libcore/raw.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/// let value: i32 = 123;
5454
///
5555
/// // let the compiler make a trait object
56-
/// let object: &Foo = &value;
56+
/// let object: &dyn Foo = &value;
5757
///
5858
/// // look at the raw representation
5959
/// let raw_object: raw::TraitObject = unsafe { mem::transmute(object) };
@@ -65,7 +65,7 @@
6565
///
6666
/// // construct a new object, pointing to a different `i32`, being
6767
/// // careful to use the `i32` vtable from `object`
68-
/// let synthesized: &Foo = unsafe {
68+
/// let synthesized: &dyn Foo = unsafe {
6969
/// mem::transmute(raw::TraitObject {
7070
/// data: &other_value as *const _ as *mut (),
7171
/// vtable: raw_object.vtable,

0 commit comments

Comments
 (0)
Please sign in to comment.