Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom: rename __getrandom_internal to follow Rust conventions #369

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

josephlr
Copy link
Member

@josephlr josephlr commented Sep 1, 2023

Fixes #368 CC: @ethever

This symbol isn't actually used anywhere, so it's fine to be renamed.

Once we are at MSRV 1.37, we can change the code to use an unnamed const, for example:

const _: () = {
    // We use Rust ABI to be safe against potential panics in the passed function.
    #[no_mangle]
    unsafe fn __getrandom_custom(dest: *mut u8, len: usize) -> u32 {

This symbol isn't actually used anywhere, so it's fine to be renamed.

Once we are at MSRV 1.37, we can change the code to use an
[unnamed `const`](https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html#using-unnamed-const-items-for-macros),
for example:
```rust
const _: () = {
    // We use Rust ABI to be safe against potential panics in the passed function.
    #[no_mangle]
    unsafe fn __getrandom_custom(dest: *mut u8, len: usize) -> u32 {
```
@josephlr josephlr requested a review from newpavlov September 1, 2023 03:30
@newpavlov newpavlov merged commit 1308930 into master Sep 1, 2023
47 checks passed
@newpavlov newpavlov deleted the rename_internal branch September 1, 2023 10:50
@newpavlov newpavlov mentioned this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants