File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,15 @@ impl Core {
182182 let mut core = self . lock ( ) ;
183183 core. input = input as * const [ u8 ] ;
184184 core. input_ports = input_ports as * const [ InputPort ] ;
185- core. audio_callback = Some ( std:: ptr:: addr_of_mut!( audio_callback) as * mut _ ) ;
185+ // SAFETY: we extend the lifetime of audio_callback to 'static, but it will only be
186+ // used during the execution of this function. The explicit transmute is needed
187+ // due to https://github.com/rust-lang/rust/pull/136776
188+ core. audio_callback = Some ( std:: mem:: transmute :: <
189+ * mut dyn FnMut ( & [ AudioFrame ] ) ,
190+ * mut ( dyn FnMut ( & [ AudioFrame ] ) + ' static ) ,
191+ > (
192+ std:: ptr:: addr_of_mut!( audio_callback) as * mut _
193+ ) ) ;
186194 std:: mem:: drop ( core) ;
187195
188196 run ( ) ;
You can’t perform that action at this time.
0 commit comments