logoalt Hacker News

Kavelachyesterday at 7:45 PM1 replyview on HN

From what I read from the PR comments, the case is that the unsafe blocks behave in a way that allows for UB.

This is expected, because unsafe rust can leave your program in an unhealthy state, since the language doesn't doesn't hold your hand anymore.


Replies

DSMan195276yesterday at 8:20 PM

The point is that at a minimum you're supposed to bubble the `unsafe` up if the API does not guarantee safety is maintained for all cases (and documents the invariants that have to be kept by the caller), otherwise the system breaks down.