Skip to content

Commit

Permalink
move comments in inline_coroutine to fix spans
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehri01 committed Nov 1, 2023
1 parent 2fcb4d9 commit 6a4bb1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
22 changes: 11 additions & 11 deletions tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
fn main() -> () {
let mut _0: ();
let _1: std::ops::CoroutineState<i32, bool>;
let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>;
let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
let mut _4: {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8}>;
let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8};
let mut _4: {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8};
+ let mut _5: bool;
scope 1 {
debug _r => _1;
}
+ scope 2 (inlined g) {
+ }
+ scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) {
+ scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8}>::new) {
+ debug pointer => _3;
+ scope 4 {
+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) {
+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8}>::new_unchecked) {
+ debug pointer => _3;
+ }
+ }
+ }
+ scope 6 (inlined g::{closure#0}) {
+ debug a => _5;
+ let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
+ let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8};
+ let mut _7: u32;
+ let mut _8: i32;
+ }
Expand All @@ -37,20 +37,20 @@
- }
-
- bb1: {
+ _4 = {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8 (#0)};
+ _4 = {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8 (#0)};
_3 = &mut _4;
- _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new(move _3) -> [return: bb2, unwind: bb5];
- _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8}>::new(move _3) -> [return: bb2, unwind: bb5];
- }
-
- bb2: {
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: move _3 };
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8}> { pointer: move _3 };
StorageDead(_3);
- _1 = <{coroutine@$DIR/inline_coroutine.rs:19:5: 19:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
- _1 = <{coroutine@$DIR/inline_coroutine.rs:16:5: 16:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
+ StorageLive(_5);
+ _5 = const false;
+ StorageLive(_6);
+ StorageLive(_7);
+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8});
+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:16:5: 16:8});
+ _7 = discriminant((*_6));
+ switchInt(move _7) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11];
}
Expand Down
7 changes: 4 additions & 3 deletions tests/mir-opt/inline/inline_coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use std::pin::Pin;

// EMIT_MIR inline_coroutine.main.Inline.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: (inlined g)
// CHECK: (inlined g::{closure#0})
let _r = Pin::new(&mut g()).resume(false);
}

Expand All @@ -18,3 +15,7 @@ pub fn g() -> impl Coroutine<bool> {
#[inline]
|a| { yield if a { 7 } else { 13 } }
}

// CHECK-LABEL: fn main(
// CHECK: (inlined g)
// CHECK: (inlined g::{closure#0})

0 comments on commit 6a4bb1f

Please sign in to comment.