Debian Codegraph @

tests/fixtures/valid/complex-lifetimes.rs

raw symbols SCIP
1 use daft::Diffable;
2 use std::{cell::Cell, fmt::Debug, marker::PhantomData};
3
4 #[derive(Debug, Eq, PartialEq, Diffable)]
5 // 'daft is named as such to test potential clashes with generated code.
6 struct S<'a, 'b, 'daft: 'a, 'inv, 'contra> {
7 // Multiple lifetime params.
8 multi_ref: &'a &'b Vec<u8>,
9
10 // Lifetime param with a lifetime bound.
11 bound_ref: &'daft Vec<u8>,
12
13 // Invariant lifetime parameter.
14 inv_ref: PhantomData<Cell<&'inv ()>>,
15
16 // Contravariant lifetime parameter.
17 contra_ref: PhantomData<fn(&'contra ())>,
18 }
19
20 fn main() {}