Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
14
tests/ui/span/regions-escape-loop-via-variable.rs
Normal file
14
tests/ui/span/regions-escape-loop-via-variable.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
fn main() {
|
||||
let x = 3;
|
||||
|
||||
// Here, the variable `p` gets inferred to a type with a lifetime
|
||||
// of the loop body. The regionck then determines that this type
|
||||
// is invalid.
|
||||
let mut p = &x;
|
||||
|
||||
loop {
|
||||
let x = 1 + *p;
|
||||
p = &x;
|
||||
}
|
||||
//~^^ ERROR `x` does not live long enough
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue