Skip to content

Commit

Permalink
Merge pull request #427 from dtolnay/unsafeop
Browse files Browse the repository at this point in the history
Turn on deny(unsafe_op_in_unsafe_fn)
  • Loading branch information
dtolnay authored Dec 21, 2023
2 parents 49b26d2 + e95447c commit 6756d15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(
clippy::cast_lossless,
clippy::cast_possible_truncation,
Expand Down Expand Up @@ -1239,7 +1240,7 @@ impl Literal {
// representation. This is not public API other than for quote.
#[doc(hidden)]
pub unsafe fn from_str_unchecked(repr: &str) -> Self {
Literal::_new(imp::Literal::from_str_unchecked(repr))
Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) })
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ impl Literal {
if inside_proc_macro() {
Literal::Compiler(proc_macro::Literal::from_str(repr).expect("invalid literal"))
} else {
Literal::Fallback(fallback::Literal::from_str_unchecked(repr))
Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) })
}
}

Expand Down

0 comments on commit 6756d15

Please sign in to comment.