File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -1318,6 +1318,7 @@ impl Clone for BorrowRef<'_> {
1318
1318
pub struct Ref < ' b , T : ?Sized + ' b > {
1319
1319
// NB: we use a pointer instead of `&'b T` to avoid `noalias` violations, because a
1320
1320
// `Ref` argument doesn't hold immutability for its whole scope, only until it drops.
1321
+ // `NonNull` is also covariant over `T`, just like we would have with `&T`.
1321
1322
value : NonNull < T > ,
1322
1323
borrow : BorrowRef < ' b > ,
1323
1324
}
@@ -1704,7 +1705,7 @@ pub struct RefMut<'b, T: ?Sized + 'b> {
1704
1705
// `RefMut` argument doesn't hold exclusivity for its whole scope, only until it drops.
1705
1706
value : NonNull < T > ,
1706
1707
borrow : BorrowRefMut < ' b > ,
1707
- // NonNull is covariant over T , so we need to reintroduce invariance.
1708
+ // ` NonNull` is covariant over `T` , so we need to reintroduce invariance.
1708
1709
marker : PhantomData < & ' b mut T > ,
1709
1710
}
1710
1711
You can’t perform that action at this time.
0 commit comments