2018-10-14 09:12:02 -05:00
|
|
|
error[E0515]: cannot return value referencing local data `*p`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/regions-infer-borrow-scope-too-big.rs:13:12
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough
|
2018-10-14 09:12:02 -05:00
|
|
|
| --- `*p` is borrowed here
|
|
|
|
LL | assert_eq!(*xc, 3);
|
|
|
|
LL | return xc;
|
|
|
|
| ^^ returns a value referencing data owned by the current function
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
For more information about this error, try `rustc --explain E0515`.
|