diff options
| -rw-r--r-- | src/liballoc/collections/linked_list.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 2 | ||||
| -rw-r--r-- | src/libcore/cell.rs | 9 |
4 files changed, 10 insertions, 5 deletions
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index 48f9865b870..a0c9263673d 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -90,7 +90,7 @@ impl<T> Clone for Iter<'_, T> { #[stable(feature = "rust1", since = "1.0.0")] pub struct IterMut<'a, T: 'a> { // We do *not* exclusively own the entire list here, references to node's `element` - // have been handed out by the iterator! So be careful when using this; the methods + // have been handed out by the iterator! So be careful when using this; the methods // called must be aware that there can be aliasing pointers to `element`. list: &'a mut LinkedList<T>, head: Option<NonNull<Node<T>>>, diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index f1c4c32e116..a11f9e8c145 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -280,7 +280,7 @@ struct RcBox<T: ?Sized> { #[stable(feature = "rust1", since = "1.0.0")] pub struct Rc<T: ?Sized> { ptr: NonNull<RcBox<T>>, - phantom: PhantomData<T>, + phantom: PhantomData<RcBox<T>>, } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 80d6c6e0d43..4b10f089c29 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -195,7 +195,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; #[stable(feature = "rust1", since = "1.0.0")] pub struct Arc<T: ?Sized> { ptr: NonNull<ArcInner<T>>, - phantom: PhantomData<T>, + phantom: PhantomData<ArcInner<T>>, } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fda103a52d8..817c04d0af9 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -137,9 +137,11 @@ //! use std::cell::Cell; //! use std::ptr::NonNull; //! use std::intrinsics::abort; +//! use std::marker::PhantomData; //! //! struct Rc<T: ?Sized> { -//! ptr: NonNull<RcBox<T>> +//! ptr: NonNull<RcBox<T>>, +//! phantom: PhantomData<RcBox<T>>, //! } //! //! struct RcBox<T: ?Sized> { @@ -151,7 +153,10 @@ //! impl<T: ?Sized> Clone for Rc<T> { //! fn clone(&self) -> Rc<T> { //! self.inc_strong(); -//! Rc { ptr: self.ptr } +//! Rc { +//! ptr: self.ptr, +//! phantom: PhantomData, +//! } //! } //! } //! |
