File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ struct TaskFuture {
127127/// its only purpose is to provide access to the waker. See `hyper_waker`.
128128///
129129/// Corresponding Rust type: <https://doc.rust-lang.org/std/task/struct.Context.html>
130+ #[ repr( C ) ] // we transmute references
130131pub struct hyper_context < ' a > ( Context < ' a > ) ;
131132
132133/// A waker that is saved and used to waken a pending task.
@@ -500,7 +501,7 @@ where
500501
501502impl hyper_context < ' _ > {
502503 pub ( crate ) fn wrap < ' a , ' b > ( cx : & ' a mut Context < ' b > ) -> & ' a mut hyper_context < ' b > {
503- // A struct with only one field has the same layout as that field.
504+ // A repr(C) newtype has the same layout as its only field.
504505 unsafe { std:: mem:: transmute :: < & mut Context < ' _ > , & mut hyper_context < ' _ > > ( cx) }
505506 }
506507}
Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ fn h2_to_io_error(e: h2::Error) -> std::io::Error {
386386 }
387387}
388388
389+ #[ repr( transparent) ]
389390struct UpgradedSendStream < B > ( SendStream < SendBuf < Neutered < B > > > ) ;
390391
391392impl < B > UpgradedSendStream < B >
You can’t perform that action at this time.
0 commit comments