diff --git a/src/item.rs b/src/item.rs
index eb32d4f70b..de83e28aee 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -952,7 +952,8 @@ pub(crate) mod parsing {
let vis: Visibility = ahead.parse()?;
let lookahead = ahead.lookahead1();
- let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+ let allow_safe = false;
+ let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) {
let vis: Visibility = input.parse()?;
let sig: Signature = input.parse()?;
if input.peek(Token![;]) {
@@ -1493,11 +1494,14 @@ pub(crate) mod parsing {
}
}
- fn peek_signature(input: ParseStream) -> bool {
+ fn peek_signature(input: ParseStream, allow_safe: bool) -> bool {
let fork = input.fork();
fork.parse::