You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses as to convert the reference to a pointer. We've ran into issues in the past with as, e.g. RustyYato/cell-project#4. Specifically, it breaks inference in a bad way.
Suggested fix:
Use type ascription instead of as, e.g. let r1: *const i32.
The text was updated successfully, but these errors were encountered:
we can't remember what we were doing where it broke inference... we're struggling to figure out a test case which demonstrates it tho. sorry about that.
(ps: we believe this example to be unsound, specifically due to the Drop impl, but we digress. the main thing we're trying to point out is the difference between as and type ascription and the Drop impl doesn't actually matter for that.)
main
branch to see if this has already been fixedURL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#dereferencing-a-raw-pointer
Description of the problem:
This uses
as
to convert the reference to a pointer. We've ran into issues in the past withas
, e.g. RustyYato/cell-project#4. Specifically, it breaks inference in a bad way.Suggested fix:
Use type ascription instead of
as
, e.g.let r1: *const i32
.The text was updated successfully, but these errors were encountered: