Skip to content

Commit 681dad8

Browse files
committed
Respond to review
1 parent 25047ae commit 681dad8

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/shims/sig.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pub struct ShimSig<'tcx, const ARGS: usize> {
1919
/// ```rust,ignore
2020
/// shim_sig!(extern "C" fn (*const T, i32) -> usize)
2121
/// ```
22+
///
23+
/// In type position, `winapi::` can be used as a shorthand for the full path used by
24+
/// `windows_ty_layout`.
2225
#[macro_export]
2326
macro_rules! shim_sig {
2427
(extern $abi:literal fn($($arg:ty),* $(,)?) -> $ret:ty) => {

src/shims/windows/foreign_items.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
137137
) -> InterpResult<'tcx, EmulateItemResult> {
138138
let this = self.eval_context_mut();
139139

140-
// According to
141-
// https://github.com/rust-lang/rust/blob/fb00adbdb69266f10df95a4527b767b0ad35ea48/compiler/rustc_target/src/spec/mod.rs#L2766-L2768,
142-
// x86-32 Windows uses a different calling convention than other Windows targets
143-
// for the "system" ABI.
144-
// TODO: Use this in shim-sig instead of 'system'? Or is that good enough for ExternAbi?
145-
// let sys_conv = if this.tcx.sess.target.arch == Arch::X86 {
146-
// CanonAbi::X86(X86Call::Stdcall)
147-
// } else {
148-
// CanonAbi::C
149-
// };
150-
151140
// See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
152141

153142
// Windows API stubs.
154-
// HANDLE = isize
143+
// HANDLE = *mut c_void (formerly: isize)
155144
// NTSTATUS = LONG = i32
156145
// DWORD = ULONG = u32
157146
// BOOL = i32

tests/pass-dep/getrandom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
#[cfg(not(target_os = "solaris"))]
1313
getrandom_01::getrandom(&mut data).unwrap();
1414

15-
// TODO: getrandom 0.2 uses the wrong return type for BCrypteGenRandom
15+
// On Windows, getrandom 0.2 uses the wrong return type for BCryptGenRandom
1616
#[cfg(not(target_os = "windows"))]
1717
getrandom_02::getrandom(&mut data).unwrap();
1818

0 commit comments

Comments
 (0)