Crates.io | locspan-derive |
lib.rs | locspan-derive |
version | 0.6.0 |
source | src |
created_at | 2022-06-28 11:05:03.566106 |
updated_at | 2022-11-03 13:47:06.720318 |
description | Derive macros for the `locspan` code mapping library |
homepage | |
repository | https://github.com/timothee-haudebourg/locspan-derive |
max_upload_size | |
id | 614770 |
size | 59,358 |
locspan
code mapping library.This library provides the StrippedPartialEq
derive macro
used to automatically implement the StrippedPartialEq
comparison
trait defined in the locspan
library.
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 `#[stripped]`.
#[derive(StrippedPartialEq)]
struct Foo<T, #[stripped] S, #[stripped] P> {
a: Loc<T, S, P>,
// Files are compared using `StrippedPartialEq`
// unless they are marked with `#[stripped]`, in
// which case `PartialEq` is used.
#[stripped]
b: std::path::PathBuf
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.