mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Update test for E0796 and static_mut_ref lint
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
("future-incompatible", "Lints that detect code that has future-compatibility problems"),
|
||||
("rust-2018-compatibility", "Lints used to transition code from the 2015 edition to 2018"),
|
||||
("rust-2021-compatibility", "Lints used to transition code from the 2018 edition to 2021"),
|
||||
("rust-2024-compatibility", "Lints used to transition code from the 2021 edition to 2024"),
|
||||
];
|
||||
|
||||
type LintGroups = BTreeMap<String, BTreeSet<String>>;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user