File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ mod std_vendor;
127
127
/// ```
128
128
pub struct Arc < T : ?Sized > {
129
129
ptr : NonNull < ArcInner < T > > ,
130
+ // NB: this informs dropck that objects of type `ArcInner<T>` may be used in `<Arc<T> as
131
+ // Drop>::drop`. Note that dropck already assumes that objects of type `T` may be used in
132
+ // `<Arc<T> as Drop>::drop` and the distinction between `T` and `ArcInner<T>` is not presently
133
+ // meaningful with respect to dropck - but this may change in the future so this is left here
134
+ // out of an abundance of caution.
135
+ //
136
+ // See https://doc.rust-lang.org/nomicon/phantom-data.html#generic-parameters-and-drop-checking
137
+ // for more detail on the semantics of dropck in the presence of `PhantomData`.
130
138
_p : PhantomData < ArcInner < T > > ,
131
139
}
132
140
You can’t perform that action at this time.
0 commit comments