2018-07-26 00:21:35 -05:00
|
|
|
warning: not reporting region error due to nll
|
|
|
|
--> $DIR/mir_check_cast_unsafe_fn.rs:18:32
|
|
|
|
|
|
|
|
|
LL | let g: unsafe fn(_) -> _ = f;
|
|
|
|
| ^
|
|
|
|
|
2018-07-24 09:22:41 -05:00
|
|
|
error: borrowed data escapes outside of function
|
2018-07-26 00:21:35 -05:00
|
|
|
--> $DIR/mir_check_cast_unsafe_fn.rs:20:14
|
|
|
|
|
|
|
|
|
LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
|
2018-07-24 09:22:41 -05:00
|
|
|
| ----- `input` is a reference that is only valid in the function body
|
2018-07-26 00:21:35 -05:00
|
|
|
...
|
|
|
|
LL | unsafe { g(input) }
|
2018-07-24 09:22:41 -05:00
|
|
|
| ^^^^^^^^ `input` escapes the function body here
|
2018-07-26 00:21:35 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|