Skip to content

Commit 1820f84

Browse files
committed
Use unsafe_op_in_unsafe_fn
RFC #2585 has been updated to be an optional lint for now. We clearly want this behavior, so use this lint for our code. While here, also enable some other lints that sound useful. We are actually missing a couple of unsafe{} blocks in unsafe functions, so follow-up commits are needed to properly document the safety assumptions around these. See: rust-lang/rfcs#2585 (comment) See: rust-lang/rust#71668
1 parent 6f73530 commit 1820f84

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#![warn(missing_docs)]
2-
#![warn(rustdoc::missing_doc_code_examples)]
2+
#![warn(nonstandard_style)]
33
#![warn(rust_2018_idioms)]
4+
#![warn(rustdoc::missing_doc_code_examples)]
5+
#![warn(single_use_lifetimes)]
6+
#![warn(unsafe_op_in_unsafe_fn)]
7+
#![warn(unused_crate_dependencies)]
8+
#![warn(unused)]
49

510
//! Allocate heap memory with user-specified alignment.
611
@@ -189,7 +194,6 @@ impl<T> AlignedBox<[T]> {
189194
// # SAFETY
190195
// The initializer function has to initialize the value behind the pointer without
191196
// reading or dropping the old uninitialized value, e.g., using std::ptr::write.
192-
#[allow(unused_unsafe)] // https://github.com/rust-lang/rfcs/pull/2585
193197
unsafe fn new_slice(
194198
alignment: usize,
195199
nelems: usize,
@@ -232,7 +236,6 @@ impl<T> AlignedBox<[T]> {
232236
// # SAFETY
233237
// The initializer function has to initialize the value behind the pointer without
234238
// reading or dropping the old uninitialized value, e.g., using std::ptr::write.
235-
#[allow(unused_unsafe)] // https://github.com/rust-lang/rfcs/pull/2585
236239
unsafe fn realloc(
237240
&mut self,
238241
nelems: usize,

0 commit comments

Comments
 (0)