Skip to content

Commit

Permalink
Merge pull request #1552 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 f1b463e + b4695ff commit 61ad235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ impl<'a> Cursor<'a> {
// past it, unless `ptr == scope`, which means that we're at the edge of
// our cursor's scope. We should only have `ptr != scope` at the exit
// from None-delimited groups entered with `ignore_none`.
while let Entry::End(_) = *ptr {
while let Entry::End(_) = unsafe { &*ptr } {
if ptr == scope {
break;
}
ptr = ptr.add(1);
ptr = unsafe { ptr.add(1) };
}

Cursor {
Expand All @@ -154,7 +154,7 @@ impl<'a> Cursor<'a> {
/// If the cursor is looking at an `Entry::Group`, the bumped cursor will
/// point at the first token in the group (with the same scope end).
unsafe fn bump_ignore_group(self) -> Cursor<'a> {
Cursor::create(self.ptr.offset(1), self.scope)
unsafe { Cursor::create(self.ptr.offset(1), self.scope) }
}

/// While the cursor is looking at a `None`-delimited group, move it to look
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
// Syn types in rustdoc of other crates get linked to here.
#![doc(html_root_url = "https://docs.rs/syn/2.0.42")]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(non_camel_case_types)]
#![allow(
clippy::bool_to_int_with_if,
Expand Down

0 comments on commit 61ad235

Please sign in to comment.