about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-02 23:47:48 +0000
committerbors <bors@rust-lang.org>2022-10-02 23:47:48 +0000
commit573fd5a8c52d044e3fcb6bd9b7082046d60526da (patch)
treeaf82e40d810fa576ef801fa121e376b85c655038 /src/test/ui
parentde692f1fae957fcfb0efb46db044a61261169963 (diff)
parent0919c945929f1cccc84fac44b982132ba2262a17 (diff)
downloadrust-573fd5a8c52d044e3fcb6bd9b7082046d60526da.tar.gz
rust-573fd5a8c52d044e3fcb6bd9b7082046d60526da.zip
Auto merge of #102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrum
Get rid of exclude-list for Windows-only tests

Main purpose of this change is to get rid of a quite long (and growing) list of excluded targets, while this test should only be useful on Windows (as far as I understand it). The `// only-windows` header seams to implement exactly what we need here.

I don't know why there are some whitespace changes, but `x.py fmt` and `.git/hooks/pre-push` are happy.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/abi/x86stdcall.rs26
-rw-r--r--src/test/ui/abi/x86stdcall2.rs12
2 files changed, 8 insertions, 30 deletions
diff --git a/src/test/ui/abi/x86stdcall.rs b/src/test/ui/abi/x86stdcall.rs
index 868923e5932..d1cf1319fb0 100644
--- a/src/test/ui/abi/x86stdcall.rs
+++ b/src/test/ui/abi/x86stdcall.rs
@@ -1,17 +1,15 @@
 // run-pass
-// ignore-wasm32-bare no libc to test ffi with
-// ignore-sgx no libc
+// only-windows
 // GetLastError doesn't seem to work with stack switching
 
 #[cfg(windows)]
 mod kernel32 {
-  extern "system" {
-    pub fn SetLastError(err: usize);
-    pub fn GetLastError() -> usize;
-  }
+    extern "system" {
+        pub fn SetLastError(err: usize);
+        pub fn GetLastError() -> usize;
+    }
 }
 
-
 #[cfg(windows)]
 pub fn main() {
     unsafe {
@@ -22,17 +20,3 @@ pub fn main() {
         assert_eq!(expected, actual);
     }
 }
-
-#[cfg(any(target_os = "android",
-          target_os = "dragonfly",
-          target_os = "emscripten",
-          target_os = "freebsd",
-          target_os = "fuchsia",
-          target_os = "illumos",
-          target_os = "linux",
-          target_os = "macos",
-          target_os = "netbsd",
-          target_os = "openbsd",
-          target_os = "solaris",
-          target_os = "vxworks"))]
-pub fn main() { }
diff --git a/src/test/ui/abi/x86stdcall2.rs b/src/test/ui/abi/x86stdcall2.rs
index 563e3aba632..4d508ecb242 100644
--- a/src/test/ui/abi/x86stdcall2.rs
+++ b/src/test/ui/abi/x86stdcall2.rs
@@ -1,4 +1,5 @@
 // run-pass
+// only-windows
 
 #![allow(non_camel_case_types)]
 pub type HANDLE = usize;
@@ -7,20 +8,16 @@ pub type SIZE_T = u32;
 pub type LPVOID = usize;
 pub type BOOL = u8;
 
-#[cfg(windows)]
 mod kernel32 {
-    use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL};
+    use super::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T};
 
     extern "system" {
         pub fn GetProcessHeap() -> HANDLE;
-        pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T)
-                      -> LPVOID;
+        pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID;
         pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL;
     }
 }
 
-
-#[cfg(windows)]
 pub fn main() {
     let heap = unsafe { kernel32::GetProcessHeap() };
     let mem = unsafe { kernel32::HeapAlloc(heap, 0, 100) };
@@ -28,6 +25,3 @@ pub fn main() {
     let res = unsafe { kernel32::HeapFree(heap, 0, mem) };
     assert!(res != 0);
 }
-
-#[cfg(not(windows))]
-pub fn main() { }