@Leon I don’t know what your rust level is, but I myself maintain the following rule:
where-ever possible respect the rustc compilers’ guidance on lifetime of your objects. This means: avoid specifying a lifetime (sometimes you find it is necessary, but then that might indicate you’d want to re-organise your module a bit).
I mean that you don’t have to think too much about lifetime of your objects. Let the rust compiler do it for you.
It is sufficient to observe that if you borrow an object, it needs to live longer than the borrow. However obvious that may be, it is sufficient to understand lifetime.
In a pattern, all values that don’t implement the Copy trait have to be bound the same way. The goal here is to avoid binding simultaneously by-move and by-ref.
This limitation may be removed in a future version of Rust.
Then, you can do:
#[derive(Clone, Copy)]
struct Point { x: i32, y: i32 }
#[derive(Clone, Copy)]
struct Q{m1 : Point, m2 :Point}