|
57 | 57 | LL | };
|
58 | 58 | | - temporary value is freed at the end of this statement
|
59 | 59 |
|
60 |
| -error: aborting due to 6 previous errors |
| 60 | +error[E0716]: temporary value dropped while borrowed |
| 61 | + --> $DIR/promoted_const_call3.rs:17:26 |
| 62 | + | |
| 63 | +LL | let _: &'static _ = &String::new(); |
| 64 | + | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| 65 | + | | |
| 66 | + | type annotation requires that borrow lasts for `'static` |
| 67 | +... |
| 68 | +LL | } |
| 69 | + | - temporary value is freed at the end of this statement |
| 70 | + |
| 71 | +error[E0716]: temporary value dropped while borrowed |
| 72 | + --> $DIR/promoted_const_call3.rs:20:26 |
| 73 | + | |
| 74 | +LL | let _: &'static _ = &id(&String::new()); |
| 75 | + | ---------- ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| 76 | + | | |
| 77 | + | type annotation requires that borrow lasts for `'static` |
| 78 | +... |
| 79 | +LL | } |
| 80 | + | - temporary value is freed at the end of this statement |
| 81 | + |
| 82 | +error[E0716]: temporary value dropped while borrowed |
| 83 | + --> $DIR/promoted_const_call3.rs:20:30 |
| 84 | + | |
| 85 | +LL | let _: &'static _ = &id(&String::new()); |
| 86 | + | ---------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement |
| 87 | + | | | |
| 88 | + | | creates a temporary value which is freed while still in use |
| 89 | + | type annotation requires that borrow lasts for `'static` |
| 90 | + |
| 91 | +error[E0716]: temporary value dropped while borrowed |
| 92 | + --> $DIR/promoted_const_call3.rs:24:26 |
| 93 | + | |
| 94 | +LL | let _: &'static _ = &std::mem::ManuallyDrop::new(String::new()); |
| 95 | + | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| 96 | + | | |
| 97 | + | type annotation requires that borrow lasts for `'static` |
| 98 | +LL | |
| 99 | +LL | } |
| 100 | + | - temporary value is freed at the end of this statement |
| 101 | + |
| 102 | +error: aborting due to 10 previous errors |
61 | 103 |
|
62 | 104 | Some errors have detailed explanations: E0493, E0716.
|
63 | 105 | For more information about an error, try `rustc --explain E0493`.
|
0 commit comments