☰
Debian Codegraph
@
15:15.3.rel1-2
15:15.3.rel1-1
/
/
gcc
/
testsuite
/
rust
/
borrowck
/
position_dependant_outlives.rs
☽
☼
gcc/testsuite/rust/borrowck/position_dependant_outlives.rs
code
plain
raw
1
// { dg-additional-options "-frust-compile-until=compilation -frust-borrowcheck" }
2
3
pub fn position_dependent_outlives<'a>(x: &'a mut i32, cond: bool) -> &'a mut i32 {
4
let y = &mut *x;
5
if cond {
6
return y;
7
} else {
8
*x = 0;
9
return x;
10
}
11
}