Skip to content

Commit 8a62c64

Browse files
committed
Apply suggestions by lqd
1 parent 061c786 commit 8a62c64

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

text/3621-derive-smart-pointer.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<T: ?Sized> Deref for Rc<T> {
200200

201201
impl<T> Rc<T> {
202202
pub fn new(value: T) -> Self {
203-
let inner = Box::new(ArcInner {
203+
let inner = Box::new(RcInner {
204204
refcount: 1,
205205
value,
206206
});
@@ -284,8 +284,8 @@ Given the following example code:
284284
```rust
285285
#[derive(SmartPointer)]
286286
struct MySmartPointer<'a, #[pointee] T: ?Sized, A>{
287-
ptr: &'a T
288-
phantom: PhantomData<A>
287+
ptr: &'a T,
288+
phantom: PhantomData<A>,
289289
}
290290
```
291291

@@ -296,13 +296,14 @@ we'll get the following expansion:
296296
impl<'a, T, A, U> ::core::ops::CoerceUnsized<MySmartPointer<'a, U, A>> for MySmartPointer<'a, T, A>
297297
where
298298
T: ?Sized + ::core::marker::Unsize<U>,
299-
U: ?::core::marker::Sized
299+
U: ?::core::marker::Sized,
300+
{}
300301

301302
#[automatically_derived]
302303
impl<'a, T, A, U> ::core::ops::DispatchFromDyn<MySmartPointer<'a, U, A>> for MySmartPointer<'a, T, A>
303304
where
304305
T: ?Sized + ::core::marker::Unsize<U>,
305-
U: ?::core::marker::Sized
306+
U: ?::core::marker::Sized,
306307
{}
307308
```
308309

@@ -321,7 +322,7 @@ you can use them for dynamic dispatch.
321322
## Vtable requirements
322323

323324
As seen in the `Rc` example, the macro needs to be usable even if the pointer
324-
is `NonNull<ArcInner<T>>` (as opposed to `NonNull<T>`).
325+
is `NonNull<RcInner<T>>` (as opposed to `NonNull<T>`).
325326

326327
# Drawbacks
327328
[drawbacks]: #drawbacks
@@ -469,7 +470,7 @@ progress by reducing the scope and stabilizing a subset.
469470

470471
There have already been [previous attempts to stabilize the underlying
471472
traits][pre-rfc], and they did not make much progress. Therefore, this RFC
472-
proposes to reduce ths scope and instead stabilize a derive macro.
473+
proposes to reduce the scope and instead stabilize a derive macro.
473474

474475
[ast-scope]: https://github.com/rust-lang/rfcs/pull/3519#discussion_r1492385549
475476
[rpit]: https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html

0 commit comments

Comments
 (0)