]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/promote-no-mut.stderr
use iter:: before free functions
[rust.git] / src / test / ui / consts / promote-no-mut.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/promote-no-mut.rs:3:50
3    |
4 LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
5    |                                        ----------^^^^^^^^^-
6    |                                        |         |        |
7    |                                        |         |        temporary value is freed at the end of this statement
8    |                                        |         creates a temporary which is freed while still in use
9    |                                        using this value as a static requires that borrow lasts for `'static`
10
11 error[E0716]: temporary value dropped while borrowed
12   --> $DIR/promote-no-mut.rs:6:18
13    |
14 LL |     let x = &mut [1,2,3];
15    |                  ^^^^^^^ creates a temporary which is freed while still in use
16 LL |     x
17    |     - using this value as a static requires that borrow lasts for `'static`
18 LL | };
19    | - temporary value is freed at the end of this statement
20
21 error: aborting due to 2 previous errors
22
23 For more information about this error, try `rustc --explain E0716`.