Skip to content

Commit 8ec55dc

Browse files
committed
clarify transition path
1 parent e01bdaa commit 8ec55dc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

active/0000-raw-reform.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ following refactors:
165165

166166
* Deprecate all of `slice::raw` as poorly motivated, especially with raw slices available.
167167

168-
* Deprecate all unsafe methods on the `ImmutableSlice` and `MutableSlice` extension traits
169-
in favour of using raw slices.
168+
* Deprecate `ImmutableSlice::unsafe_get` and `MutableSlice::unsafe_mut` in favour of using raw
169+
slices and indexing into them.
170170

171171
* Add `as_raw` and `as_raw_mut` to the `Slice` and `MutSlice` extension traits.
172172

@@ -185,6 +185,11 @@ In addition, this would have the benefit of removing the need to explicitly cast
185185

186186
* Make the RawPtr traits take self by value, because ptrs are `copy`.
187187

188+
When all of this is done, slices will no longer have *any* unsafe methods. This clearly delinates
189+
slices as "the safe way" and raw slices as "the unsafe way". The naive transition path will be
190+
`foo.unsafe_get(i)` -> `foo.as_raw()[i]`. However if lots of unsafe work needs to be done, the
191+
`as_raw` conversion need only be done once.
192+
188193
The ptr module ends up only having the following functions:
189194

190195
```

0 commit comments

Comments
 (0)