Skip to content

Commit 36cae3a

Browse files
committed
Annotate needs-unwind.
1 parent 051dd67 commit 36cae3a

9 files changed

+19
-17
lines changed

tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> {
44
debug x => _1; // in scope 0 at $DIR/checked_ops.rs:+0:20: +0:21
55
debug rhs => _2; // in scope 0 at $DIR/checked_ops.rs:+0:28: +0:31
66
let mut _0: std::option::Option<u32>; // return place in scope 0 at $DIR/checked_ops.rs:+0:41: +0:52
7-
scope 1 (inlined core::num::<impl u32>::checked_shl) { // at $DIR/checked_ops.rs:14:7: 14:23
7+
scope 1 (inlined core::num::<impl u32>::checked_shl) { // at $DIR/checked_ops.rs:15:7: 15:23
88
debug self => _1; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
99
debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
1010
let mut _13: (u32, bool); // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL

tests/mir-opt/pre-codegen/checked_ops.ilog2.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn ilog2(_1: u32) -> u32 {
44
debug x => _1; // in scope 0 at $DIR/checked_ops.rs:+0:14: +0:15
55
let mut _0: u32; // return place in scope 0 at $DIR/checked_ops.rs:+0:25: +0:28
6-
scope 1 (inlined #[track_caller] core::num::<impl u32>::ilog2) { // at $DIR/checked_ops.rs:19:7: 19:14
6+
scope 1 (inlined #[track_caller] core::num::<impl u32>::ilog2) { // at $DIR/checked_ops.rs:20:7: 20:14
77
debug self => _1; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
88
let mut _2: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
99
let mut _3: isize; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL

tests/mir-opt/pre-codegen/checked_ops.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2
2+
// needs-unwind
23
// ignore-debug
34

45
#![crate_type = "lib"]

tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn step_forward(_1: u32, _2: usize) -> u32 {
44
debug x => _1; // in scope 0 at $DIR/checked_ops.rs:+0:21: +0:22
55
debug n => _2; // in scope 0 at $DIR/checked_ops.rs:+0:29: +0:30
66
let mut _0: u32; // return place in scope 0 at $DIR/checked_ops.rs:+0:42: +0:45
7-
scope 1 (inlined <u32 as Step>::forward) { // at $DIR/checked_ops.rs:9:5: 9:35
7+
scope 1 (inlined <u32 as Step>::forward) { // at $DIR/checked_ops.rs:10:5: 10:35
88
debug start => _1; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
99
debug n => _2; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL
1010
let _3: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/iter/range.rs:LL:COL

tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
1717
scope 2 {
1818
debug x => _11; // in scope 2 at $DIR/loops.rs:+1:9: +1:10
1919
}
20-
scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) { // at $DIR/loops.rs:19:14: 19:32
20+
scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) { // at $DIR/loops.rs:20:14: 20:32
2121
debug self => _6; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL
2222
let mut _7: &mut impl Iterator<Item = T>; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL
2323
let mut _8: &mut impl Fn(T) -> Option<U>; // in scope 4 at $SRC_DIR/core/src/iter/adapters/filter_map.rs:LL:COL
2424
}
2525
}
26-
scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) { // at $DIR/loops.rs:19:14: 19:32
26+
scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) { // at $DIR/loops.rs:20:14: 20:32
2727
debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
2828
}
2929

@@ -32,7 +32,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
3232
StorageLive(_3); // scope 0 at $DIR/loops.rs:+1:14: +1:32
3333
_3 = <impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>(move _1, move _2) -> bb1; // scope 0 at $DIR/loops.rs:+1:14: +1:32
3434
// mir::Constant
35-
// + span: $DIR/loops.rs:19:19: 19:29
35+
// + span: $DIR/loops.rs:20:19: 20:29
3636
// + literal: Const { ty: fn(impl Iterator<Item = T>, impl Fn(T) -> Option<U>) -> FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> {<impl Iterator<Item = T> as Iterator>::filter_map::<U, impl Fn(T) -> Option<U>>}, val: Value(<ZST>) }
3737
}
3838

@@ -79,7 +79,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
7979
_11 = move ((_9 as Some).0: U); // scope 1 at $DIR/loops.rs:+1:9: +1:10
8080
_12 = opaque::<U>(move _11) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/loops.rs:+2:9: +2:18
8181
// mir::Constant
82-
// + span: $DIR/loops.rs:20:9: 20:15
82+
// + span: $DIR/loops.rs:21:9: 21:15
8383
// + literal: Const { ty: fn(U) {opaque::<U>}, val: Value(<ZST>) }
8484
}
8585

tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ fn int_range(_1: usize, _2: usize) -> () {
1616
scope 2 {
1717
debug i => _8; // in scope 2 at $DIR/loops.rs:+1:9: +1:10
1818
}
19-
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) { // at $DIR/loops.rs:7:14: 7:24
19+
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) { // at $DIR/loops.rs:8:14: 8:24
2020
debug self => _5; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
2121
}
2222
}
23-
scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) { // at $DIR/loops.rs:7:14: 7:24
23+
scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) { // at $DIR/loops.rs:8:14: 8:24
2424
debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
2525
}
2626

@@ -55,7 +55,7 @@ fn int_range(_1: usize, _2: usize) -> () {
5555
_8 = ((_6 as Some).0: usize); // scope 1 at $DIR/loops.rs:+1:9: +1:10
5656
_9 = opaque::<usize>(_8) -> bb5; // scope 2 at $DIR/loops.rs:+2:9: +2:18
5757
// mir::Constant
58-
// + span: $DIR/loops.rs:8:9: 8:15
58+
// + span: $DIR/loops.rs:9:9: 9:15
5959
// + literal: Const { ty: fn(usize) {opaque::<usize>}, val: Value(<ZST>) }
6060
}
6161

tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
1818
debug x => _9; // in scope 2 at $DIR/loops.rs:+1:9: +1:10
1919
}
2020
}
21-
scope 3 (inlined <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as IntoIterator>::into_iter) { // at $DIR/loops.rs:13:14: 13:25
21+
scope 3 (inlined <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as IntoIterator>::into_iter) { // at $DIR/loops.rs:14:14: 14:25
2222
debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
2323
}
2424

@@ -27,7 +27,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
2727
StorageLive(_3); // scope 0 at $DIR/loops.rs:+1:14: +1:25
2828
_3 = <impl Iterator<Item = T> as Iterator>::map::<U, impl Fn(T) -> U>(move _1, move _2) -> bb1; // scope 0 at $DIR/loops.rs:+1:14: +1:25
2929
// mir::Constant
30-
// + span: $DIR/loops.rs:13:19: 13:22
30+
// + span: $DIR/loops.rs:14:19: 14:22
3131
// + literal: Const { ty: fn(impl Iterator<Item = T>, impl Fn(T) -> U) -> Map<impl Iterator<Item = T>, impl Fn(T) -> U> {<impl Iterator<Item = T> as Iterator>::map::<U, impl Fn(T) -> U>}, val: Value(<ZST>) }
3232
}
3333

@@ -44,7 +44,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
4444
_6 = &mut _5; // scope 1 at $DIR/loops.rs:+1:14: +1:25
4545
_7 = <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::next(_6) -> [return: bb3, unwind: bb9]; // scope 1 at $DIR/loops.rs:+1:14: +1:25
4646
// mir::Constant
47-
// + span: $DIR/loops.rs:13:14: 13:25
47+
// + span: $DIR/loops.rs:14:14: 14:25
4848
// + literal: Const { ty: for<'a> fn(&'a mut Map<impl Iterator<Item = T>, impl Fn(T) -> U>) -> Option<<Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::Item> {<Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::next}, val: Value(<ZST>) }
4949
}
5050

@@ -68,7 +68,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
6868
_9 = move ((_7 as Some).0: U); // scope 1 at $DIR/loops.rs:+1:9: +1:10
6969
_10 = opaque::<U>(move _9) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/loops.rs:+2:9: +2:18
7070
// mir::Constant
71-
// + span: $DIR/loops.rs:14:9: 14:15
71+
// + span: $DIR/loops.rs:15:9: 15:15
7272
// + literal: Const { ty: fn(U) {opaque::<U>}, val: Value(<ZST>) }
7373
}
7474

tests/mir-opt/pre-codegen/loops.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// compile-flags: -O -Zmir-opt-level=2 -g
2+
// needs-unwind
23
// ignore-debug
34

45
#![crate_type = "lib"]

tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn vec_move(_1: Vec<impl Sized>) -> () {
2121
StorageLive(_2); // scope 0 at $DIR/loops.rs:+1:14: +1:15
2222
_2 = <Vec<impl Sized> as IntoIterator>::into_iter(move _1) -> bb1; // scope 0 at $DIR/loops.rs:+1:14: +1:15
2323
// mir::Constant
24-
// + span: $DIR/loops.rs:25:14: 25:15
24+
// + span: $DIR/loops.rs:26:14: 26:15
2525
// + literal: Const { ty: fn(Vec<impl Sized>) -> <Vec<impl Sized> as IntoIterator>::IntoIter {<Vec<impl Sized> as IntoIterator>::into_iter}, val: Value(<ZST>) }
2626
}
2727

@@ -36,7 +36,7 @@ fn vec_move(_1: Vec<impl Sized>) -> () {
3636
_4 = &mut _3; // scope 1 at $DIR/loops.rs:+1:14: +1:15
3737
_5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(_4) -> [return: bb3, unwind: bb9]; // scope 1 at $DIR/loops.rs:+1:14: +1:15
3838
// mir::Constant
39-
// + span: $DIR/loops.rs:25:14: 25:15
39+
// + span: $DIR/loops.rs:26:14: 26:15
4040
// + literal: Const { ty: for<'a> fn(&'a mut std::vec::IntoIter<impl Sized>) -> Option<<std::vec::IntoIter<impl Sized> as Iterator>::Item> {<std::vec::IntoIter<impl Sized> as Iterator>::next}, val: Value(<ZST>) }
4141
}
4242

@@ -60,7 +60,7 @@ fn vec_move(_1: Vec<impl Sized>) -> () {
6060
_7 = move ((_5 as Some).0: impl Sized); // scope 1 at $DIR/loops.rs:+1:9: +1:10
6161
_8 = opaque::<impl Sized>(move _7) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/loops.rs:+2:9: +2:18
6262
// mir::Constant
63-
// + span: $DIR/loops.rs:26:9: 26:15
63+
// + span: $DIR/loops.rs:27:9: 27:15
6464
// + literal: Const { ty: fn(impl Sized) {opaque::<impl Sized>}, val: Value(<ZST>) }
6565
}
6666

0 commit comments

Comments
 (0)