File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -132,11 +132,8 @@ where
132132 T : ' static ,
133133 {
134134 self . inner . iter ( ) . filter_map ( |a| {
135- let pin = a. inner . inner . as_ref ( ) ;
135+ let pointer = a. inner . inner . as_ref ( ) . get_ref ( ) ;
136136
137- // Safety: We are only changing the type of the pointer, and pinning it again before returning it.
138- // None of the fields are accessed.
139- let pointer = unsafe { Pin :: into_inner_unchecked ( pin) } ;
140137 let any = pointer as & ( dyn Any + Send ) ;
141138 // SAFETY: this returns `None` and drops a `&T`, which is safe because dropping a reference is trivial.
142139 let inner = any. downcast_ref :: < T > ( ) ?;
Original file line number Diff line number Diff line change @@ -124,10 +124,8 @@ where
124124 T : ' static ,
125125 {
126126 self . inner . iter ( ) . filter_map ( |a| {
127- let pin = a. inner . inner . as_ref ( ) ;
127+ let pointer = a. inner . inner . as_ref ( ) . get_ref ( ) ;
128128
129- // Safety: We are only temporarily manipulating the pointer and pinning it again further down.
130- let pointer = unsafe { Pin :: into_inner_unchecked ( pin) } ;
131129 let any = pointer as & ( dyn Any + Send ) ;
132130 let inner = any. downcast_ref :: < T > ( ) ?;
133131
You can’t perform that action at this time.
0 commit comments