Skip to content

Commit b46a32a

Browse files
committed
Move more to the lints table
1 parent 4849b16 commit b46a32a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,10 @@ private-interfaces = "deny"
6767
unnameable-types = "deny"
6868
unreachable-pub = "deny"
6969

70+
# We *mostly* avoid unsafe code, but there are a few fine-grained cases allowed
71+
unsafe-code = "deny"
72+
73+
rust-2018-idioms = "warn"
74+
7075
[lints.clippy]
7176
style = "allow"

benches/faststring.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ impl<'a, S> From<&'a S> for &'a OneShot<str>
3333
where
3434
S: AsRef<str>,
3535
{
36+
#[allow(unsafe_code)]
3637
fn from(s: &'a S) -> Self {
3738
let s: &str = s.as_ref();
39+
// SAFETY: OneShot is a `repr(transparent)` wrapper
3840
unsafe { &*(s as *const str as *const OneShot<str>) }
3941
}
4042
}

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// We *mostly* avoid unsafe code, but `Slice` allows it for DST casting.
2-
#![deny(unsafe_code)]
3-
#![warn(rust_2018_idioms)]
41
#![no_std]
52

63
//! [`IndexMap`] is a hash table where the iteration order of the key-value

0 commit comments

Comments
 (0)