forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathissue-45696-scribble-on-boxed-borrow.migrate.stderr
57 lines (52 loc) · 2.77 KB
/
issue-45696-scribble-on-boxed-borrow.migrate.stderr
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
warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5
|
LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
| ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
...
LL | }
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5
|
LL | fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
| ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
...
LL | }
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
warning[E0713]: borrow may still be in use when destructor runs
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:85:5
|
LL | fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'a>>>) -> &'a mut u32 {
| -- lifetime `'a` defined here
LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
| ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
...
LL | }
| - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
error: compilation successful
--> $DIR/issue-45696-scribble-on-boxed-borrow.rs:92:1
|
LL | / fn main() { //[ast]~ ERROR compilation successful
LL | | //[migrate]~^ ERROR compilation successful
LL | | let mut x = 1;
LL | | {
... |
LL | | *boxed_boxed_scribbled(Box::new(Box::new(Scribble(&mut x)))) += 10;
LL | | }
| |_^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0713`.