$ rustc lifetimestatic_bad.rs 
error[E0621]: explicit lifetime required in the type of `ptr`
  --> lifetimestatic_bad.rs:14:16
   |
12 | fn set_ref(ptr: &i32) {
   |            --- consider changing the type of `ptr` to `&'static i32`
13 |     unsafe {
14 |         GPTR = ptr;
   |                ^^^ lifetime `'static` required

error: aborting due to previous error

For more information about this error, try `rustc --explain E0621`.