Open sudobeans opened 4 months ago
The error is with this webpage: https://onelinerhub.com/rust/how-to-convert-pointer-to-reference-in-rust
GitHub link: https://github.com/Onelinerhub/onelinerhub/blob/main//rust/how-to-convert-pointer-to-reference-in-rust.md
It contains this code:
let p: *const i32 = &10; let r: &i32 = &p;
But this code does not compile because &p is &*const i32. See for yourself on the Rust Playground.
&p
&*const i32
Update: I created PR #2004 to attempt to resolve this
The error is with this webpage: https://onelinerhub.com/rust/how-to-convert-pointer-to-reference-in-rust
GitHub link: https://github.com/Onelinerhub/onelinerhub/blob/main//rust/how-to-convert-pointer-to-reference-in-rust.md
It contains this code:
But this code does not compile because
&p
is&*const i32
. See for yourself on the Rust Playground.Update: I created PR #2004 to attempt to resolve this