Hacker News new | ask | show | jobs
by nyanpasu64 1204 days ago

    int x = 123;
    const int *px = &x;
    (*(int*)px) = 456;
is legal in C. The Rust equivalent using & and &mut is UB. Writing this in Rust using raw pointers requires unsafe blocks everywhere, loses method syntax, has no -> operator, etc.