Crate locspan_derive

Crate locspan_derive 

Source
Expand description

This library provides the StrippedPartialEq derive macro used to automatically implement the StrippedPartialEq comparison trait defined in the locspan library.

§Usage

use locspan::Loc;
use locspan_derive::StrippedPartialEq;

// Implement `StrippedPartialEq` for the `Foo` type.
// Type parameters will be required to implement
// `StrippedPartialEq` themselves unless they are marked
// with `#[locspan(ignore(...))]`.
#[derive(StrippedPartialEq)]
#[locspan(ignore(S, P))]
struct Foo<T, S, P> {
  a: Loc<T, S, P>,

  // Files are compared using `StrippedPartialEq`
  // unless they are marked with `#[locspan(stripped)]`, in
  // which case `PartialEq` is used.
  #[locspan(stripped)]
  b: std::path::PathBuf
}

Derive Macros§

StrippedEq
StrippedHash
StrippedOrd
StrippedPartialEq
StrippedPartialOrd