-
-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
These posts are really interesting and helpful. But when I try to run the following snippet in playground, it seems outdated and reports and error:
thread 'main' panicked at src/main.rs:18:5:
assertionleft == rightfailed
left: 8
right: 0
case-studies/unit-type-parameters/README.md
Lines 328 to 348 in 4c3517a
| ```rust | |
| mod phantom { | |
| pub use self::MyPhantomData::*; | |
| pub enum MyPhantomData<T: ?Sized> { | |
| MyPhantomData, | |
| #[allow(dead_code)] | |
| #[doc(hidden)] | |
| Marker(Void, [*const T; 0]), | |
| } | |
| pub enum Void {} | |
| } | |
| use phantom::MyPhantomData; | |
| fn main() { | |
| assert_eq!(std::mem::size_of::<MyPhantomData<usize>>(), 0); | |
| } | |
| ``` |
I checked the implementation of https://github.com/dtolnay/ghost but did not find the difference.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels