File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub struct LinkedList<T> {
39
39
head : Option < NonNull < Node < T > > > ,
40
40
tail : Option < NonNull < Node < T > > > ,
41
41
len : usize ,
42
- marker : PhantomData < T > ,
42
+ marker : PhantomData < Box < Node < T > > > ,
43
43
}
44
44
45
45
struct Node < T > {
@@ -60,7 +60,7 @@ pub struct Iter<'a, T: 'a> {
60
60
head : Option < NonNull < Node < T > > > ,
61
61
tail : Option < NonNull < Node < T > > > ,
62
62
len : usize ,
63
- marker : PhantomData < & ' a T > ,
63
+ marker : PhantomData < & ' a Node < T > > ,
64
64
}
65
65
66
66
#[ stable( feature = "collection_debug" , since = "1.17.0" ) ]
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ struct RcBox<T: ?Sized> {
280
280
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
281
281
pub struct Rc < T : ?Sized > {
282
282
ptr : NonNull < RcBox < T > > ,
283
- phantom : PhantomData < T > ,
283
+ phantom : PhantomData < RcBox < T > > ,
284
284
}
285
285
286
286
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
195
195
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
196
196
pub struct Arc < T : ?Sized > {
197
197
ptr : NonNull < ArcInner < T > > ,
198
- phantom : PhantomData < T > ,
198
+ phantom : PhantomData < ArcInner < T > > ,
199
199
}
200
200
201
201
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
Original file line number Diff line number Diff line change 137
137
//! use std::cell::Cell;
138
138
//! use std::ptr::NonNull;
139
139
//! use std::intrinsics::abort;
140
+ //! use std::marker::PhantomData;
140
141
//!
141
142
//! struct Rc<T: ?Sized> {
142
- //! ptr: NonNull<RcBox<T>>
143
+ //! ptr: NonNull<RcBox<T>>,
144
+ //! phantom: PhantomData<RcBox<T>>,
143
145
//! }
144
146
//!
145
147
//! struct RcBox<T: ?Sized> {
You can’t perform that action at this time.
0 commit comments