Skip to content

Commit 6756d15

Browse files
authored
Merge pull request #427 from dtolnay/unsafeop
Turn on deny(unsafe_op_in_unsafe_fn)
2 parents 49b26d2 + e95447c commit 6756d15

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
9191
#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
9292
#![cfg_attr(doc_cfg, feature(doc_cfg))]
93+
#![deny(unsafe_op_in_unsafe_fn)]
9394
#![allow(
9495
clippy::cast_lossless,
9596
clippy::cast_possible_truncation,
@@ -1239,7 +1240,7 @@ impl Literal {
12391240
// representation. This is not public API other than for quote.
12401241
#[doc(hidden)]
12411242
pub unsafe fn from_str_unchecked(repr: &str) -> Self {
1242-
Literal::_new(imp::Literal::from_str_unchecked(repr))
1243+
Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) })
12431244
}
12441245
}
12451246

src/wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl Literal {
762762
if inside_proc_macro() {
763763
Literal::Compiler(proc_macro::Literal::from_str(repr).expect("invalid literal"))
764764
} else {
765-
Literal::Fallback(fallback::Literal::from_str_unchecked(repr))
765+
Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) })
766766
}
767767
}
768768

0 commit comments

Comments
 (0)