]> git.lizzy.rs Git - rust.git/blob - src/test/ui/wf/wf-misc-methods-issue-28609.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / wf / wf-misc-methods-issue-28609.stderr
1 error[E0597]: borrowed value does not live long enough
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    |                               ^^ temporary value does not live long enough
6 LL | }
7    | - temporary value only lives until here
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:20
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    | - borrowed value only lives until here
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:20
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    | - borrowed value only lives until here
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[E0597]: borrowed value does not live long enough
59   --> $DIR/wf-misc-methods-issue-28609.rs:63:15
60    |
61 LL |     s << &mut 3 //~ ERROR does not live long enough
62    |               ^ temporary value does not live long enough
63 LL | }
64    | - temporary value only lives until here
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[E0597]: borrowed value does not live long enough
76   --> $DIR/wf-misc-methods-issue-28609.rs:68:16
77    |
78 LL |     s.shl(&mut 3) //~ ERROR does not live long enough
79    |                ^ temporary value does not live long enough
80 LL | }
81    | - temporary value only lives until here
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[E0597]: borrowed value does not live long enough
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    |                     ^ temporary value does not live long enough
97 LL | }
98    | - temporary value only lives until here
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 For more information about this error, try `rustc --explain E0597`.