]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-infer-invariance-due-to-decl.rs
Apply suggestions from code review
[rust.git] / src / test / ui / regions / regions-infer-invariance-due-to-decl.rs
1 use std::marker;
2
3 struct Invariant<'a> {
4     marker: marker::PhantomData<*mut &'a()>
5 }
6
7 fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
8     let bj: Invariant<'r> = b_isize;
9 }
10
11 fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
12     b_isize //~ ERROR mismatched types
13 }
14
15 fn main() {
16 }