mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Auto merge of #111362 - mj10021:issue-74838-update, r=cuviper
delete [allow(unused_unsafe)] from issue #74838 While looking into issue #111288 I noticed the following `#[allow(...)]` with a `FIXME` asking for it to be removed. Deleting the `#[allow(...)]` does not seem to break anything, it seems like the lint has been updated for unsafe blocks in macros?
This commit is contained in:
commit
1821920cc8
@ -392,7 +392,6 @@ pub mod __alloc_error_handler {
|
||||
static __rust_alloc_error_handler_should_panic: u8;
|
||||
}
|
||||
|
||||
#[allow(unused_unsafe)]
|
||||
if unsafe { __rust_alloc_error_handler_should_panic != 0 } {
|
||||
panic!("memory allocation of {size} bytes failed")
|
||||
} else {
|
||||
|
@ -418,7 +418,7 @@ pub mod arch;
|
||||
// set up in such a way that directly pulling it here works such that the
|
||||
// crate uses this crate as its core.
|
||||
#[path = "../../portable-simd/crates/core_simd/src/mod.rs"]
|
||||
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)]
|
||||
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn)]
|
||||
#[allow(rustdoc::bare_urls)]
|
||||
#[unstable(feature = "portable_simd", issue = "86656")]
|
||||
mod core_simd;
|
||||
|
@ -336,7 +336,6 @@ fn default_alloc_error_hook(layout: Layout) {
|
||||
static __rust_alloc_error_handler_should_panic: u8;
|
||||
}
|
||||
|
||||
#[allow(unused_unsafe)]
|
||||
if unsafe { __rust_alloc_error_handler_should_panic != 0 } {
|
||||
panic!("memory allocation of {} bytes failed", layout.size());
|
||||
} else {
|
||||
|
@ -542,7 +542,7 @@ pub mod time;
|
||||
// Pull in `std_float` crate into std. The contents of
|
||||
// `std_float` are in a different repository: rust-lang/portable-simd.
|
||||
#[path = "../../portable-simd/crates/std_float/src/lib.rs"]
|
||||
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)]
|
||||
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn)]
|
||||
#[allow(rustdoc::bare_urls)]
|
||||
#[unstable(feature = "portable_simd", issue = "86656")]
|
||||
mod std_float;
|
||||
|
@ -87,10 +87,6 @@ pub macro thread_local_inner {
|
||||
static __KEY: $crate::thread::local_impl::Key<$t> =
|
||||
$crate::thread::local_impl::Key::<$t>::new();
|
||||
|
||||
// FIXME: remove the #[allow(...)] marker when macros don't
|
||||
// raise warning for missing/extraneous unsafe blocks anymore.
|
||||
// See https://github.com/rust-lang/rust/issues/74838.
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
__KEY.get(move || {
|
||||
if let $crate::option::Option::Some(init) = init {
|
||||
|
@ -24,7 +24,6 @@ pub macro thread_local_inner {
|
||||
const fn __init() -> $t { INIT_EXPR }
|
||||
static __KEY: $crate::thread::local_impl::Key<$t> =
|
||||
$crate::thread::local_impl::Key::new();
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
__KEY.get(move || {
|
||||
if let $crate::option::Option::Some(init) = _init {
|
||||
@ -59,10 +58,6 @@ pub macro thread_local_inner {
|
||||
static __KEY: $crate::thread::local_impl::Key<$t> =
|
||||
$crate::thread::local_impl::Key::new();
|
||||
|
||||
// FIXME: remove the #[allow(...)] marker when macros don't
|
||||
// raise warning for missing/extraneous unsafe blocks anymore.
|
||||
// See https://github.com/rust-lang/rust/issues/74838.
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
__KEY.get(move || {
|
||||
if let $crate::option::Option::Some(init) = init {
|
||||
|
@ -43,10 +43,6 @@ pub macro thread_local_inner {
|
||||
static __KEY: $crate::thread::local_impl::Key<$t> =
|
||||
$crate::thread::local_impl::Key::new();
|
||||
|
||||
// FIXME: remove the #[allow(...)] marker when macros don't
|
||||
// raise warning for missing/extraneous unsafe blocks anymore.
|
||||
// See https://github.com/rust-lang/rust/issues/74838.
|
||||
#[allow(unused_unsafe)]
|
||||
unsafe {
|
||||
__KEY.get(move || {
|
||||
if let $crate::option::Option::Some(init) = init {
|
||||
|
@ -69,10 +69,7 @@ unsafe extern "C" fn init() {
|
||||
|
||||
/// Helper macro for creating CStrs from literals and symbol names.
|
||||
macro_rules! ansi_str {
|
||||
(sym $ident:ident) => {{
|
||||
#[allow(unused_unsafe)]
|
||||
crate::sys::compat::const_cstr_from_bytes(concat!(stringify!($ident), "\0").as_bytes())
|
||||
}};
|
||||
(sym $ident:ident) => {{ crate::sys::compat::const_cstr_from_bytes(concat!(stringify!($ident), "\0").as_bytes()) }};
|
||||
($lit:literal) => {{ crate::sys::compat::const_cstr_from_bytes(concat!($lit, "\0").as_bytes()) }};
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#![allow(dead_code)] // stack_guard isn't used right now on all platforms
|
||||
#![allow(unused_unsafe)] // thread_local with `const {}` triggers this liny
|
||||
|
||||
use crate::cell::RefCell;
|
||||
use crate::sys::thread::guard::Guard;
|
||||
|
Loading…
Reference in New Issue
Block a user