newtype-tools 1.0.13

A lightweight library designed to make the newtype idiom more ergonomic to use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![cfg(feature = "derive")]

// There is a small discrepancy between the stable and nightly in span reporting.
// ```ignore
// error: expected `#[newtype(NewtypeKind)]`
//   --> tests/trybuild/newtype_attribute.rs:34:30
//    |
// 34 |     #[newtype_tools::newtype(Amount, Amount)]
//    |                              ^^^^^^
// ```
#[rustversion::stable]
#[test]
fn newtype_trybuild() {
    let t = trybuild::TestCases::new();
    t.compile_fail("tests/trybuild/*.rs");
    t.compile_fail("tests/trybuild/conversions/*.rs");
    t.compile_fail("tests/trybuild/ops/*.rs");
}