summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/promotion.stderr
blob: 0b8dc0ce0e903c75322bc3c0926883887392b14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:11:27
   |
LL |     let x: &'static () = &foo1();
   |            -----------    ^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
...
LL | }
   | - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:12:28
   |
LL |     let y: &'static i32 = &foo2(42);
   |            ------------    ^^^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
...
LL | }
   | - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:13:28
   |
LL |     let z: &'static i32 = &foo3();
   |            ------------    ^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
...
LL | }
   | - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:14:34
   |
LL |     let a: &'static Cell<i32> = &foo4();
   |            ------------------    ^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
...
LL | }
   | - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:15:42
   |
LL |     let a: &'static Option<Cell<i32>> = &foo5();
   |            --------------------------    ^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
LL |     let a: &'static Option<Cell<i32>> = &foo6();
LL | }
   | - temporary value is freed at the end of this statement

error[E0716]: temporary value dropped while borrowed
  --> $DIR/promotion.rs:16:42
   |
LL |     let a: &'static Option<Cell<i32>> = &foo6();
   |            --------------------------    ^^^^^^ creates a temporary value which is freed while still in use
   |            |
   |            type annotation requires that borrow lasts for `'static`
LL | }
   | - temporary value is freed at the end of this statement

error: aborting due to 6 previous errors

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