We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
repr(transparent)
hyper_context
1 parent ed99c09 commit 187b8f2Copy full SHA for 187b8f2
src/ffi/task.rs
@@ -66,6 +66,7 @@ struct TaskFuture {
66
}
67
68
/// An async context for a task that contains the related waker.
69
+#[repr(transparent)]
70
pub struct hyper_context<'a>(Context<'a>);
71
72
/// A waker that is saved and used to waken a pending task.
@@ -378,7 +379,7 @@ where
378
379
380
impl hyper_context<'_> {
381
pub(crate) fn wrap<'a, 'b>(cx: &'a mut Context<'b>) -> &'a mut hyper_context<'b> {
- // A struct with only one field has the same layout as that field.
382
+ // A repr(transparent) struct with only one field has the same layout as that field.
383
unsafe { std::mem::transmute::<&mut Context<'_>, &mut hyper_context<'_>>(cx) }
384
385
0 commit comments