diff --git a/src/lib.rs b/src/lib.rs index 5d6a458..36ea850 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1240,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) }) } } diff --git a/src/wrapper.rs b/src/wrapper.rs index 37fdf37..a5d49b5 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -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) }) } }