guppy/
macros.rs

1// Copyright (c) The cargo-guppy Contributors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Test and helper macros.
5
6/// Assert that a struct with a single lifetime parameter is covariant.
7macro_rules! assert_covariant {
8    ($i:ident) => {
9        const _: () = {
10            #[allow(dead_code)]
11            fn assert_covariant<'a, 'b: 'a>(x: $i<'b>) -> $i<'a> {
12                x
13            }
14        };
15    };
16}