-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FnMut/Fn shim for coroutine-closures that capture references
- Loading branch information
1 parent
b66d708
commit edda2c7
Showing
18 changed files
with
214 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
0 2 | ||
0 2 | ||
1 2 | ||
1 2 | ||
1 2 | ||
1 2 | ||
0 | ||
1 |
2 changes: 1 addition & 1 deletion
2
...losure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...osure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...nc_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-abort.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_move | ||
|
||
fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:42:33: 42:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}; | ||
fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:53:33: 53:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:42:53: 45:10 (#0)} { a: move _2, b: move (_1.0: i32) }; | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:53:53: 56:10 (#0)} { a: move _2, b: move (_1.0: i32) }; | ||
return; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...c_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-unwind.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_move | ||
|
||
fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:42:33: 42:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}; | ||
fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:53:33: 53:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:42:53: 45:10 (#0)} { a: move _2, b: move (_1.0: i32) }; | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:53:53: 56:10 (#0)} { a: move _2, b: move (_1.0: i32) }; | ||
return; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...losure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// MIR for `main::{closure#0}::{closure#1}::{closure#0}` 0 coroutine_by_move | ||
|
||
fn main::{closure#0}::{closure#1}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}, _2: ResumeTy) -> () | ||
yields () | ||
{ | ||
debug _task_context => _2; | ||
debug a => (_1.0: i32); | ||
debug b => (*(_1.1: &i32)); | ||
let mut _0: (); | ||
let _3: i32; | ||
scope 1 { | ||
debug a => _3; | ||
let _4: &i32; | ||
scope 2 { | ||
debug a => _4; | ||
let _5: &i32; | ||
scope 3 { | ||
debug b => _5; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_3); | ||
_3 = (_1.0: i32); | ||
FakeRead(ForLet(None), _3); | ||
StorageLive(_4); | ||
_4 = &_3; | ||
FakeRead(ForLet(None), _4); | ||
StorageLive(_5); | ||
_5 = &(*(_1.1: &i32)); | ||
FakeRead(ForLet(None), _5); | ||
_0 = const (); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
drop(_1) -> [return: bb1, unwind: bb2]; | ||
} | ||
|
||
bb1: { | ||
return; | ||
} | ||
|
||
bb2 (cleanup): { | ||
resume; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...osure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// MIR for `main::{closure#0}::{closure#1}::{closure#0}` 0 coroutine_by_move | ||
|
||
fn main::{closure#0}::{closure#1}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}, _2: ResumeTy) -> () | ||
yields () | ||
{ | ||
debug _task_context => _2; | ||
debug a => (_1.0: i32); | ||
debug b => (*(_1.1: &i32)); | ||
let mut _0: (); | ||
let _3: i32; | ||
scope 1 { | ||
debug a => _3; | ||
let _4: &i32; | ||
scope 2 { | ||
debug a => _4; | ||
let _5: &i32; | ||
scope 3 { | ||
debug b => _5; | ||
} | ||
} | ||
} | ||
|
||
bb0: { | ||
StorageLive(_3); | ||
_3 = (_1.0: i32); | ||
FakeRead(ForLet(None), _3); | ||
StorageLive(_4); | ||
_4 = &_3; | ||
FakeRead(ForLet(None), _4); | ||
StorageLive(_5); | ||
_5 = &(*(_1.1: &i32)); | ||
FakeRead(ForLet(None), _5); | ||
_0 = const (); | ||
StorageDead(_5); | ||
StorageDead(_4); | ||
StorageDead(_3); | ||
drop(_1) -> [return: bb1, unwind: bb2]; | ||
} | ||
|
||
bb1: { | ||
return; | ||
} | ||
|
||
bb2 (cleanup): { | ||
resume; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...nc_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_move.0.panic-abort.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_move | ||
|
||
fn main::{closure#0}::{closure#1}(_1: {async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: move (_1.0: &i32) }; | ||
return; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...c_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_move.0.panic-unwind.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_move | ||
|
||
fn main::{closure#0}::{closure#1}(_1: {async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: move (_1.0: &i32) }; | ||
return; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...ync_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_ref | ||
|
||
fn main::{closure#0}::{closure#1}(_1: &mut {async closure@$DIR/async_closure_shims.rs:49:29: 49:48}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10}; | ||
fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:49:49: 51:10 (#0)} { a: move _2 }; | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; | ||
return; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...nc_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_ref | ||
|
||
fn main::{closure#0}::{closure#1}(_1: &mut {async closure@$DIR/async_closure_shims.rs:49:29: 49:48}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10}; | ||
fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} { | ||
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; | ||
|
||
bb0: { | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:49:49: 51:10 (#0)} { a: move _2 }; | ||
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; | ||
return; | ||
} | ||
} |
Oops, something went wrong.