Update test results after rebase

This commit is contained in:
Jannis Christopher Köhl 2022-10-05 01:24:33 +02:00
parent c56e99cdba
commit f99950f6ae
15 changed files with 47 additions and 30 deletions

View file

@ -87,8 +87,8 @@ pub trait ValueAnalysis<'tcx> {
// But discriminants are currently not tracked, so we do nothing.
// Related: https://github.com/rust-lang/unsafe-code-guidelines/issues/84
}
StatementKind::CopyNonOverlapping(..) => {
// FIXME: What to do here?
StatementKind::Intrinsic(box intrinsic) => {
self.handle_intrinsic(intrinsic, state);
}
StatementKind::StorageLive(local) | StatementKind::StorageDead(local) => {
// It is UB to read from an unitialized or unallocated local.
@ -106,6 +106,22 @@ pub trait ValueAnalysis<'tcx> {
}
}
fn handle_intrinsic(
&self,
intrinsic: &NonDivergingIntrinsic<'tcx>,
state: &mut State<Self::Value>,
) {
self.super_intrinsic(intrinsic, state);
}
fn super_intrinsic(
&self,
_intrinsic: &NonDivergingIntrinsic<'tcx>,
_state: &mut State<Self::Value>,
) {
todo!();
}
fn handle_assign(
&self,
target: Place<'tcx>,

View file

@ -53,7 +53,7 @@
StorageDead(_5); // scope 2 at $DIR/checked.rs:+3:17: +3:18
StorageDead(_4); // scope 2 at $DIR/checked.rs:+3:17: +3:18
StorageLive(_7); // scope 3 at $DIR/checked.rs:+5:9: +5:10
- _7 = const core::num::<impl i32>::MAX; // scope 3 at $DIR/checked.rs:+5:13: +5:21
- _7 = const _; // scope 3 at $DIR/checked.rs:+5:13: +5:21
+ _7 = const i32::MAX; // scope 3 at $DIR/checked.rs:+5:13: +5:21
StorageLive(_8); // scope 4 at $DIR/checked.rs:+6:9: +6:10
StorageLive(_9); // scope 4 at $DIR/checked.rs:+6:13: +6:14

View file

@ -25,7 +25,7 @@
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -25,7 +25,7 @@
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -16,7 +16,7 @@
StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
_3 = const FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
_3 = const _; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
// mir::Constant
// + span: $DIR/const_prop_fails_gracefully.rs:8:13: 8:16
// + literal: Const { ty: &i32, val: Unevaluated(FOO, [], None) }

View file

@ -8,7 +8,8 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
_1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
- _1 = const _; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
+ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
}

View file

@ -11,7 +11,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
// mir::Constant
// + span: $DIR/ref_deref.rs:6:6: 6:10
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -14,7 +14,7 @@
- StorageLive(_3); // scope 0 at $DIR/ref_deref.rs:+1:8: +1:9
- _3 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:+1:8: +1:9
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:6:6: 6:10
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -11,7 +11,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
_4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
_4 = const _; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
// mir::Constant
// + span: $DIR/ref_deref_project.rs:6:6: 6:17
// + literal: Const { ty: &(i32, i32), val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -14,7 +14,7 @@
- StorageLive(_3); // scope 0 at $DIR/ref_deref_project.rs:+1:8: +1:14
- _3 = (const 4_i32, const 5_i32); // scope 0 at $DIR/ref_deref_project.rs:+1:8: +1:14
- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ _4 = const _; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ // mir::Constant
+ // + span: $DIR/ref_deref_project.rs:6:6: 6:17
+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -18,7 +18,7 @@
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -18,7 +18,7 @@
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -14,7 +14,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/promoted.rs:+2:9: +2:10
StorageLive(_2); // scope 0 at $DIR/promoted.rs:+2:14: +2:17
_4 = const main::promoted[0]; // scope 0 at $DIR/promoted.rs:+2:14: +2:17
_4 = const _; // scope 0 at $DIR/promoted.rs:+2:14: +2:17
// mir::Constant
// + span: $DIR/promoted.rs:6:14: 6:17
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }

View file

@ -3,35 +3,35 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/recursive.rs:+0:11: +0:11
let _1: S; // in scope 0 at $DIR/recursive.rs:+2:9: +2:10
let mut _3: &S; // in scope 0 at $DIR/recursive.rs:+3:20: +3:22
let _4: &S; // in scope 0 at $DIR/recursive.rs:+3:20: +3:22
let mut _6: &S; // in scope 0 at $DIR/recursive.rs:+4:20: +4:22
let _7: &S; // in scope 0 at $DIR/recursive.rs:+4:20: +4:22
let _1: S<'_>; // in scope 0 at $DIR/recursive.rs:+2:9: +2:10
let mut _3: &S<'_>; // in scope 0 at $DIR/recursive.rs:+3:20: +3:22
let _4: &S<'_>; // in scope 0 at $DIR/recursive.rs:+3:20: +3:22
let mut _6: &S<'_>; // in scope 0 at $DIR/recursive.rs:+4:20: +4:22
let _7: &S<'_>; // in scope 0 at $DIR/recursive.rs:+4:20: +4:22
let mut _9: isize; // in scope 0 at $DIR/recursive.rs:+6:9: +6:18
let mut _11: isize; // in scope 0 at $DIR/recursive.rs:+7:13: +7:22
let mut _13: isize; // in scope 0 at $DIR/recursive.rs:+8:17: +8:28
let mut _15: !; // in scope 0 at $DIR/recursive.rs:+9:22: +9:43
let mut _16: !; // in scope 0 at $DIR/recursive.rs:+11:18: +11:39
let mut _17: !; // in scope 0 at $DIR/recursive.rs:+13:14: +13:35
let mut _18: &S; // in scope 0 at $DIR/recursive.rs:+7:20: +7:21
let mut _19: &S; // in scope 0 at $DIR/recursive.rs:+7:20: +7:21
let mut _18: &S<'_>; // in scope 0 at $DIR/recursive.rs:+7:20: +7:21
let mut _19: &S<'_>; // in scope 0 at $DIR/recursive.rs:+7:20: +7:21
scope 1 {
debug a => _1; // in scope 1 at $DIR/recursive.rs:+2:9: +2:10
let _2: S; // in scope 1 at $DIR/recursive.rs:+3:9: +3:10
let _2: S<'_>; // in scope 1 at $DIR/recursive.rs:+3:9: +3:10
scope 2 {
debug b => _2; // in scope 2 at $DIR/recursive.rs:+3:9: +3:10
let _5: S; // in scope 2 at $DIR/recursive.rs:+4:9: +4:10
let _5: S<'_>; // in scope 2 at $DIR/recursive.rs:+4:9: +4:10
scope 3 {
debug c => _5; // in scope 3 at $DIR/recursive.rs:+4:9: +4:10
let _8: u32; // in scope 3 at $DIR/recursive.rs:+5:9: +5:10
let _10: &S; // in scope 3 at $DIR/recursive.rs:+6:16: +6:17
let _10: &S<'_>; // in scope 3 at $DIR/recursive.rs:+6:16: +6:17
scope 4 {
debug d => _8; // in scope 4 at $DIR/recursive.rs:+5:9: +5:10
}
scope 5 {
debug b => _10; // in scope 5 at $DIR/recursive.rs:+6:16: +6:17
let _12: &&S; // in scope 5 at $DIR/recursive.rs:+7:20: +7:21
let _12: &&S<'_>; // in scope 5 at $DIR/recursive.rs:+7:20: +7:21
scope 6 {
debug a => _12; // in scope 6 at $DIR/recursive.rs:+7:20: +7:21
let _14: &u32; // in scope 6 at $DIR/recursive.rs:+8:24: +8:27
@ -55,7 +55,7 @@
_4 = &_1; // scope 1 at $DIR/recursive.rs:+3:20: +3:22
_3 = &(*_4); // scope 1 at $DIR/recursive.rs:+3:20: +3:22
Deinit(_2); // scope 1 at $DIR/recursive.rs:+3:13: +3:23
((_2 as Rec).0: &S) = move _3; // scope 1 at $DIR/recursive.rs:+3:13: +3:23
((_2 as Rec).0: &S<'_>) = move _3; // scope 1 at $DIR/recursive.rs:+3:13: +3:23
discriminant(_2) = 0; // scope 1 at $DIR/recursive.rs:+3:13: +3:23
StorageDead(_3); // scope 1 at $DIR/recursive.rs:+3:22: +3:23
StorageDead(_4); // scope 1 at $DIR/recursive.rs:+3:23: +3:24
@ -65,7 +65,7 @@
_7 = &_2; // scope 2 at $DIR/recursive.rs:+4:20: +4:22
_6 = &(*_7); // scope 2 at $DIR/recursive.rs:+4:20: +4:22
Deinit(_5); // scope 2 at $DIR/recursive.rs:+4:13: +4:23
((_5 as Rec).0: &S) = move _6; // scope 2 at $DIR/recursive.rs:+4:13: +4:23
((_5 as Rec).0: &S<'_>) = move _6; // scope 2 at $DIR/recursive.rs:+4:13: +4:23
discriminant(_5) = 0; // scope 2 at $DIR/recursive.rs:+4:13: +4:23
StorageDead(_6); // scope 2 at $DIR/recursive.rs:+4:22: +4:23
StorageDead(_7); // scope 2 at $DIR/recursive.rs:+4:23: +4:24
@ -84,7 +84,7 @@
bb2: {
StorageLive(_10); // scope 3 at $DIR/recursive.rs:+6:16: +6:17
_10 = ((_5 as Rec).0: &S); // scope 3 at $DIR/recursive.rs:+6:16: +6:17
_10 = ((_5 as Rec).0: &S<'_>); // scope 3 at $DIR/recursive.rs:+6:16: +6:17
_11 = discriminant((*_10)); // scope 5 at $DIR/recursive.rs:+6:28: +6:29
switchInt(move _11) -> [0_isize: bb4, otherwise: bb3]; // scope 5 at $DIR/recursive.rs:+6:22: +6:29
}
@ -99,7 +99,7 @@
bb4: {
StorageLive(_12); // scope 5 at $DIR/recursive.rs:+7:20: +7:21
_12 = &(((*_10) as Rec).0: &S); // scope 5 at $DIR/recursive.rs:+7:20: +7:21
_12 = &(((*_10) as Rec).0: &S<'_>); // scope 5 at $DIR/recursive.rs:+7:20: +7:21
_18 = deref_copy (*_12); // scope 6 at $DIR/recursive.rs:+7:32: +7:33
_13 = discriminant((*_18)); // scope 6 at $DIR/recursive.rs:+7:32: +7:33
switchInt(move _13) -> [1_isize: bb6, otherwise: bb5]; // scope 6 at $DIR/recursive.rs:+7:26: +7:33

View file

@ -52,7 +52,7 @@
_6 = &mut _5; // scope 5 at $DIR/ref_mut.rs:+8:13: +8:19
StorageLive(_7); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12
StorageLive(_8); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12
_11 = const main::promoted[0]; // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12
_11 = const _; // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12
// mir::Constant
// + span: $DIR/ref_mut.rs:13:10: 13:12
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }