Skip to content

Commit

Permalink
Merge pull request #183 from nikomatsakis/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
nikomatsakis authored Jul 5, 2024
2 parents 15ce6cf + 56c16d0 commit b8306ab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions crates/formality-core/src/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ macro_rules! seq {

}

pub trait VecExt<T>: Sized {
fn with_pushed(self, other: T) -> Self;
}

impl<T: Ord + Clone> VecExt<T> for Vec<T> {
fn with_pushed(mut self, other: T) -> Self {
self.push(other);
self
}
}

pub trait SetExt<T>: Sized {
fn split_first(self) -> Option<(T, Set<T>)>;

Expand Down
4 changes: 2 additions & 2 deletions crates/formality-core/src/parse/parser/left_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl StackEntry {
let scope: *const () = erase_type(scope);
let start_text: *const str = start_text;
let type_id = TypeId::of::<T>();
scope == self.scope && start_text == self.start_text && self.type_id == type_id
scope == self.scope && std::ptr::eq(start_text, self.start_text) && self.type_id == type_id
}

/// True if a call to parse a value of type `T` with the given scope scope/text
Expand Down Expand Up @@ -152,7 +152,7 @@ impl StackEntry {
let Some(current_state) = &self.current_state else {
panic!("observed a stack frame with no current state (forgot to call `recuse`?");
};
if start_text != current_state.current_text {
if !std::ptr::eq(start_text, current_state.current_text) {
return None;
}

Expand Down
File renamed without changes.

0 comments on commit b8306ab

Please sign in to comment.