-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable
missing-unsafe-on-extern
lint (#9963)
* Enable `missing-unsafe-on-extern` lint This'll be a hard error in the 2024 edition so go ahead and opt-in to it now to ease our future transition. * Fix adapter build * Fix custom c-api build * Fix fuzzer build * Fix some Windows `extern` blocks
- Loading branch information
1 parent
4f52f29
commit 0fff9c1
Showing
16 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ pub struct Descriptors { | |
|
||
#[cfg(not(feature = "proxy"))] | ||
#[link(wasm_import_module = "wasi:filesystem/[email protected]")] | ||
extern "C" { | ||
unsafe extern "C" { | ||
#[link_name = "get-directories"] | ||
fn wasi_filesystem_get_directories(rval: *mut PreopenList); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,12 +114,12 @@ pub mod bindings { | |
} | ||
} | ||
|
||
#[export_name = "wasi:cli/[email protected]#run"] | ||
#[unsafe(export_name = "wasi:cli/[email protected]#run")] | ||
#[cfg(feature = "command")] | ||
pub unsafe extern "C" fn run() -> u32 { | ||
pub extern "C" fn run() -> u32 { | ||
#[link(wasm_import_module = "__main_module__")] | ||
extern "C" { | ||
fn _start(); | ||
unsafe extern "C" { | ||
safe fn _start(); | ||
} | ||
_start(); | ||
0 | ||
|
@@ -457,7 +457,7 @@ impl BumpAlloc { | |
|
||
#[cfg(not(feature = "proxy"))] | ||
#[link(wasm_import_module = "wasi:cli/[email protected]")] | ||
extern "C" { | ||
unsafe extern "C" { | ||
#[link_name = "get-arguments"] | ||
fn wasi_cli_get_arguments(rval: *mut WasmStrList); | ||
#[link_name = "get-environment"] | ||
|
@@ -2156,7 +2156,7 @@ pub unsafe extern "C" fn poll_oneoff( | |
} | ||
|
||
#[link(wasm_import_module = "wasi:io/[email protected]")] | ||
extern "C" { | ||
unsafe extern "C" { | ||
#[link_name = "poll"] | ||
fn poll_import(pollables: *const Pollable, len: usize, rval: *mut ReadyList); | ||
} | ||
|
@@ -2731,7 +2731,7 @@ enum AllocationState { | |
} | ||
|
||
#[expect(improper_ctypes, reason = "types behind pointers")] | ||
extern "C" { | ||
unsafe extern "C" { | ||
fn get_state_ptr() -> *mut State; | ||
fn set_state_ptr(state: *mut State); | ||
fn get_allocation_state() -> AllocationState; | ||
|
@@ -2764,7 +2764,7 @@ impl State { | |
#[cold] | ||
fn new() -> *mut State { | ||
#[link(wasm_import_module = "__main_module__")] | ||
extern "C" { | ||
unsafe extern "C" { | ||
fn cabi_realloc( | ||
old_ptr: *mut u8, | ||
old_len: usize, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters