Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ impl<S: ?Sized, T: ?Sized> Id<S, T> {
}

/// Converts `Id<S, T>` into `Id<T, S>` since type equality is symmetric.
pub fn sym(self) -> Id<T, S> { Id(PhantomData) }
pub const fn sym(self) -> Id<T, S> { Id(PhantomData) }

/// If you have proofs `Id<S, T>` and `Id<T, U>` you can conclude `Id<S, U>`
/// since type equality is transitive.
pub fn trans<U: ?Sized>(self, _: Id<T, U>) -> Id<S, U> { Id(PhantomData) }
pub const fn trans<U: ?Sized>(self, _: Id<T, U>) -> Id<S, U> { Id(PhantomData) }

/// Casts a value of type `&S` to `&T` where `S == T`.
///
Expand Down