]> git.lizzy.rs Git - rust.git/blob - src/test/ui/wf/wf-misc-methods-issue-28609.nll.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / wf / wf-misc-methods-issue-28609.nll.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/wf-misc-methods-issue-28609.rs:32:31
3    |
4 LL |     s.transmute_inherent(&mut 42) //~ ERROR does not live long enough
5    |                               ^^ creates a temporary which is freed while still in use
6 LL | }
7    | - temporary value is freed at the end of this statement
8    |
9 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 30:1...
10   --> $DIR/wf-misc-methods-issue-28609.rs:30:1
11    |
12 LL | / fn return_dangling_pointer_inherent(s: S2) -> &u32 {
13 LL | |     let s = s;
14 LL | |     s.transmute_inherent(&mut 42) //~ ERROR does not live long enough
15 LL | | }
16    | |_^
17
18 error[E0597]: `four` does not live long enough
19   --> $DIR/wf-misc-methods-issue-28609.rs:45:19
20    |
21 LL |     s.bomb = Some(&four); //~ ERROR does not live long enough
22    |                   ^^^^^ borrowed value does not live long enough
23 LL |     &s
24 LL | }
25    | - `four` dropped here while still borrowed
26    |
27 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 42:1...
28   --> $DIR/wf-misc-methods-issue-28609.rs:42:1
29    |
30 LL | / fn return_dangling_pointer_coerce(s: S2) -> &u32 {
31 LL | |     let four = 4;
32 LL | |     let mut s = s;
33 LL | |     s.bomb = Some(&four); //~ ERROR does not live long enough
34 LL | |     &s
35 LL | | }
36    | |_^
37
38 error[E0597]: `four` does not live long enough
39   --> $DIR/wf-misc-methods-issue-28609.rs:52:19
40    |
41 LL |     s.bomb = Some(&four); //~ ERROR does not live long enough
42    |                   ^^^^^ borrowed value does not live long enough
43 LL |     &*s
44 LL | }
45    | - `four` dropped here while still borrowed
46    |
47 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 49:1...
48   --> $DIR/wf-misc-methods-issue-28609.rs:49:1
49    |
50 LL | / fn return_dangling_pointer_unary_op(s: S2) -> &u32 {
51 LL | |     let four = 4;
52 LL | |     let mut s = s;
53 LL | |     s.bomb = Some(&four); //~ ERROR does not live long enough
54 LL | |     &*s
55 LL | | }
56    | |_^
57
58 error[E0716]: temporary value dropped while borrowed
59   --> $DIR/wf-misc-methods-issue-28609.rs:63:15
60    |
61 LL |     s << &mut 3 //~ ERROR does not live long enough
62    |               ^ creates a temporary which is freed while still in use
63 LL | }
64    | - temporary value is freed at the end of this statement
65    |
66 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 61:1...
67   --> $DIR/wf-misc-methods-issue-28609.rs:61:1
68    |
69 LL | / fn return_dangling_pointer_binary_op(s: S2) -> &u32 {
70 LL | |     let s = s;
71 LL | |     s << &mut 3 //~ ERROR does not live long enough
72 LL | | }
73    | |_^
74
75 error[E0716]: temporary value dropped while borrowed
76   --> $DIR/wf-misc-methods-issue-28609.rs:68:16
77    |
78 LL |     s.shl(&mut 3) //~ ERROR does not live long enough
79    |                ^ creates a temporary which is freed while still in use
80 LL | }
81    | - temporary value is freed at the end of this statement
82    |
83 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 66:1...
84   --> $DIR/wf-misc-methods-issue-28609.rs:66:1
85    |
86 LL | / fn return_dangling_pointer_method(s: S2) -> &u32 {
87 LL | |     let s = s;
88 LL | |     s.shl(&mut 3) //~ ERROR does not live long enough
89 LL | | }
90    | |_^
91
92 error[E0716]: temporary value dropped while borrowed
93   --> $DIR/wf-misc-methods-issue-28609.rs:73:21
94    |
95 LL |     S2::shl(s, &mut 3) //~ ERROR does not live long enough
96    |                     ^ creates a temporary which is freed while still in use
97 LL | }
98    | - temporary value is freed at the end of this statement
99    |
100 note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 71:1...
101   --> $DIR/wf-misc-methods-issue-28609.rs:71:1
102    |
103 LL | / fn return_dangling_pointer_ufcs(s: S2) -> &u32 {
104 LL | |     let s = s;
105 LL | |     S2::shl(s, &mut 3) //~ ERROR does not live long enough
106 LL | | }
107    | |_^
108
109 error: aborting due to 6 previous errors
110
111 Some errors occurred: E0597, E0716.
112 For more information about an error, try `rustc --explain E0597`.