Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
//! (lazy_static library on crates.io)

use std::{
borrow::Borrow,
cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd},
collections::{hash_map::RandomState, HashMap},
fmt,
Expand All @@ -238,7 +239,7 @@
/// - `$hash_builder:expr` optional hash builder, an
/// implementation of [`std::hash::BuildHasher`] ;
/// - `$typ:typ,` type being hashconsed (the underlying type, not the
/// hashconsed one) ;

Check warning on line 242 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

doc list item overindented

Check warning on line 242 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

doc list item overindented

Check warning on line 242 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

doc list item overindented
#[macro_export]
macro_rules! consign {
(
Expand Down Expand Up @@ -349,7 +350,7 @@
}
}
impl<T> Eq for HConsed<T> {}
impl<T> PartialOrd for HConsed<T> {

Check warning on line 353 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

non-canonical implementation of `partial_cmp` on an `Ord` type

Check warning on line 353 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

non-canonical implementation of `partial_cmp` on an `Ord` type

Check warning on line 353 in src/lib.rs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

non-canonical implementation of `partial_cmp` on an `Ord` type
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.uid.partial_cmp(&other.uid)
Expand Down Expand Up @@ -378,6 +379,11 @@
self.elm.deref()
}
}
impl<T> Borrow<T> for HConsed<T> {
fn borrow(&self) -> &T {
self.elm.borrow()
}
}

impl<T: fmt::Display> fmt::Display for HConsed<T> {
#[inline]
Expand Down
Loading