Closed
Description
Currently, the following code triggers a compilation failure.
#![feature(derive_smart_pointer)]
use core::marker::SmartPointer;
#[repr(transparent)]
#[derive(SmartPointer)]
struct MyArc<T: ?Sized> {
inner: *mut T,
}
error: At least one generic type should be designated as `#[pointee]` in order to derive `SmartPointer` traits
--> src/lib.rs:5:10
|
5 | #[derive(SmartPointer)]
| ^^^^^^^^^^^^
|
= note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
However, the RFC says that specifying #[pointee]
when the struct has only one type parameter is allowed, but not required.
See also this patch on the LKML.
Tracking issue: #123430
cc @dingxiangfei2009