diff options
| author | Obei Sideg <obei.sideg@gmail.com> | 2023-12-22 15:12:01 +0300 |
|---|---|---|
| committer | Obei Sideg <obei.sideg@gmail.com> | 2024-01-07 17:29:25 +0300 |
| commit | a8aa6878f63e53a9b0cfee542e9765407e1ca0d6 (patch) | |
| tree | beffa149b8d74a34ca8461831ee1222ec4def133 /src/tools/miri | |
| parent | 18edf9a64e8d84e72a6be67df3822e57dea8d34a (diff) | |
| download | rust-a8aa6878f63e53a9b0cfee542e9765407e1ca0d6.tar.gz rust-a8aa6878f63e53a9b0cfee542e9765407e1ca0d6.zip | |
Update test for `E0796` and `static_mut_ref` lint
Diffstat (limited to 'src/tools/miri')
| -rw-r--r-- | src/tools/miri/tests/fail/tls/tls_static_dealloc.rs | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/static_mut.rs | 3 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/tls/tls_static.rs | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs index d5e6d37226a..762a8d85314 100644 --- a/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs +++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.rs @@ -1,6 +1,8 @@ //! Ensure that thread-local statics get deallocated when the thread dies. #![feature(thread_local)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint +#![allow(static_mut_ref)] #[thread_local] static mut TLS: u8 = 0; diff --git a/src/tools/miri/tests/pass/static_mut.rs b/src/tools/miri/tests/pass/static_mut.rs index 218b02525bd..c1e58b70adb 100644 --- a/src/tools/miri/tests/pass/static_mut.rs +++ b/src/tools/miri/tests/pass/static_mut.rs @@ -1,4 +1,7 @@ static mut FOO: i32 = 42; + +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint +#[allow(static_mut_ref)] static BAR: Foo = Foo(unsafe { &FOO as *const _ }); #[allow(dead_code)] diff --git a/src/tools/miri/tests/pass/tls/tls_static.rs b/src/tools/miri/tests/pass/tls/tls_static.rs index fc4c8a283dd..9be00af47aa 100644 --- a/src/tools/miri/tests/pass/tls/tls_static.rs +++ b/src/tools/miri/tests/pass/tls/tls_static.rs @@ -8,6 +8,8 @@ //! test, we also check that thread-locals act as per-thread statics. #![feature(thread_local)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint +#![allow(static_mut_ref)] use std::thread; |
