Skip to content

Commit a6197a5

Browse files
committed
Fixup comments
1 parent e39d61c commit a6197a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_data_structures/src/owned_slice.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ where
7474
O: Send + Sync + 'static,
7575
F: FnOnce(&O) -> Result<&[u8], E>,
7676
{
77-
// We box the owner of the bytes, so it doesn't move.
77+
// We wrap the owner of the bytes in, so it doesn't move.
7878
//
7979
// Since the owner does not move and we don't access it in any way
80-
// before drop, there is nothing that can invalidate the bytes pointer.
80+
// before dropping, there is nothing that can invalidate the bytes pointer.
8181
//
8282
// Thus, "extending" the lifetime of the reference returned from `F` is fine.
8383
// We pretend that we pass it a reference that lives as long as the returned slice.
@@ -137,11 +137,11 @@ impl Borrow<[u8]> for OwnedSlice {
137137
}
138138
}
139139

140-
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box<dyn Send + Sync>)`, which is `Send`
140+
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Send`
141141
#[cfg(parallel_compiler)]
142142
unsafe impl Send for OwnedSlice {}
143143

144-
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box<dyn Send + Sync>)`, which is `Sync`
144+
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Sync`
145145
#[cfg(parallel_compiler)]
146146
unsafe impl Sync for OwnedSlice {}
147147

0 commit comments

Comments
 (0)