diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/libloading/tests/markers.rs | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libloading/tests/markers.rs')
-rw-r--r-- | vendor/libloading/tests/markers.rs | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/vendor/libloading/tests/markers.rs b/vendor/libloading/tests/markers.rs new file mode 100644 index 000000000..330c034ad --- /dev/null +++ b/vendor/libloading/tests/markers.rs @@ -0,0 +1,96 @@ +extern crate libloading; + +#[cfg(test)] +fn assert_send<T: Send>() {} +#[cfg(test)] +fn assert_sync<T: Sync>() {} +#[cfg(test)] +fn assert_display<T: std::fmt::Display>() {} + +#[test] +fn check_error_send() { + assert_send::<libloading::Error>(); +} + +#[test] +fn check_error_sync() { + assert_sync::<libloading::Error>(); +} + +#[test] +fn check_error_display() { + assert_display::<libloading::Error>(); +} + +#[test] +fn check_library_send() { + assert_send::<libloading::Library>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_send() { + assert_send::<libloading::os::unix::Library>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_send() { + assert_send::<libloading::os::windows::Library>(); +} + +#[test] +fn check_library_sync() { + assert_sync::<libloading::Library>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_sync() { + assert_sync::<libloading::os::unix::Library>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_sync() { + assert_sync::<libloading::os::windows::Library>(); +} + +#[test] +fn check_symbol_send() { + assert_send::<libloading::Symbol<fn() -> ()>>(); + // assert_not_send::<libloading::Symbol<*const ()>>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_send() { + assert_send::<libloading::os::unix::Symbol<fn() -> ()>>(); + // assert_not_send::<libloading::os::unix::Symbol<*const ()>>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_send() { + assert_send::<libloading::os::windows::Symbol<fn() -> ()>>(); +} + +#[test] +fn check_symbol_sync() { + assert_sync::<libloading::Symbol<fn() -> ()>>(); + // assert_not_sync::<libloading::Symbol<*const ()>>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_sync() { + assert_sync::<libloading::os::unix::Symbol<fn() -> ()>>(); + // assert_not_sync::<libloading::os::unix::Symbol<*const ()>>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_sync() { + assert_sync::<libloading::os::windows::Symbol<fn() -> ()>>(); + // assert_not_sync::<libloading::os::windows::Symbol<*const ()>>(); +} |