Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move __getrandom_custom definition into an unnamed block
This supersedes #341, and makes the following changes - All the code for implementing `__getrandom_custom` is now in an **named** `const` block (unnamed consts require Rust 1.37) - I found this approch [here](https://internals.rust-lang.org/t/anonymous-modules/15441) - Nothing inside the block can be referenced outside of it - `__getrandom_custom` is marked `unsafe` - It can't be accessed externally, but is "logically" unsafe as it dereferences raw pointers - The type of the function is moved to a typedef, so we can check that the defined type matches that of `getrandom:getrandom`. - Use `::core::result::Result` instead of `Result` - Similar to use use of `from_raw_parts_mut` this prevents compilation errors if `Result` is redefined. Signed-off-by: Joe Richey <[email protected]>
- Loading branch information