compiler/rust: Fix a bad cast in the memstream abstraction
If you just do ref.cast(), it will cast the thing it's a reference to.
If you want to turn a reference into a pointer, you need to explicitly
use "as".
Fixes: 279f38918f
("nak: memstream: move into common code")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31718>
This commit is contained in:

committed by
Marge Bot

parent
212e07a70e
commit
4cc9730307
@@ -33,7 +33,7 @@ impl MemStream {
|
|||||||
let stream_impl = stream_impl.as_mut().get_unchecked_mut();
|
let stream_impl = stream_impl.as_mut().get_unchecked_mut();
|
||||||
if !bindings::u_memstream_open(
|
if !bindings::u_memstream_open(
|
||||||
&mut stream_impl.stream,
|
&mut stream_impl.stream,
|
||||||
(&mut stream_impl.buffer).cast(),
|
(&mut stream_impl.buffer as *mut *mut u8).cast(),
|
||||||
&mut stream_impl.buffer_size,
|
&mut stream_impl.buffer_size,
|
||||||
) {
|
) {
|
||||||
return Err(io::Error::last_os_error());
|
return Err(io::Error::last_os_error());
|
||||||
|
Reference in New Issue
Block a user