]> git.proxmox.com Git - rustc.git/blob - tests/ui/regions/regions-infer-invariance-due-to-decl.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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
13 //~^ ERROR lifetime may not live long enough
14 }
15
16 fn main() {
17 }