fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.4 KiB41 linesraw
1error[E0716]: temporary value dropped while borrowed
2  --> $DIR/auto-trait-regions.rs:44:24
3   |
4LL |         let a = A(&mut true, &mut true, No);
5   |                        ^^^^                - temporary value is freed at the end of this statement
6   |                        |
7   |                        creates a temporary which is freed while still in use
8LL |         yield;
9LL |         assert_foo(a);
10   |                    - borrow later used here
11   |
12   = note: consider using a `let` binding to create a longer lived value
13
14error[E0716]: temporary value dropped while borrowed
15  --> $DIR/auto-trait-regions.rs:44:35
16   |
17LL |         let a = A(&mut true, &mut true, No);
18   |                                   ^^^^     - temporary value is freed at the end of this statement
19   |                                   |
20   |                                   creates a temporary which is freed while still in use
21LL |         yield;
22LL |         assert_foo(a);
23   |                    - borrow later used here
24   |
25   = note: consider using a `let` binding to create a longer lived value
26
27error: higher-ranked subtype error
28  --> $DIR/auto-trait-regions.rs:30:5
29   |
30LL |     assert_foo(gen);
31   |     ^^^^^^^^^^^^^^^
32
33error: higher-ranked subtype error
34  --> $DIR/auto-trait-regions.rs:48:5
35   |
36LL |     assert_foo(gen);
37   |     ^^^^^^^^^^^^^^^
38
39error: aborting due to 4 previous errors
40
41For more information about this error, try `rustc --explain E0716`.