guppy/
macros.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (c) The cargo-guppy Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0

//! Test and helper macros.

/// Assert that a struct with a single lifetime parameter is covariant.
macro_rules! assert_covariant {
    ($i:ident) => {
        const _: () = {
            fn assert_covariant<'a, 'b: 'a>(x: $i<'b>) -> $i<'a> {
                x
            }
        };
    };
}