Update test for E0796 and static_mut_ref lint

This commit is contained in:
Obei Sideg
2023-12-22 15:12:01 +03:00
parent 18edf9a64e
commit a8aa6878f6
54 changed files with 807 additions and 239 deletions
+1
View File
@@ -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;
+3
View File
@@ -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;