File tree 2 files changed +5
-9
lines changed
compiler/base/orchestrator/src
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -3857,8 +3857,7 @@ mod tests {
3857
3857
let req = MiriRequest {
3858
3858
code : r#"
3859
3859
fn main() {
3860
- let mut a: [u8; 0] = [];
3861
- unsafe { *a.get_unchecked_mut(1) = 1; }
3860
+ unsafe { core::mem::MaybeUninit::<u8>::uninit().assume_init() };
3862
3861
}
3863
3862
"#
3864
3863
. into ( ) ,
@@ -3870,10 +3869,8 @@ mod tests {
3870
3869
assert ! ( !response. success, "stderr: {}" , response. stderr) ;
3871
3870
3872
3871
assert_contains ! ( response. stderr, "Undefined Behavior" ) ;
3873
- assert_contains ! ( response. stderr, "pointer to 1 byte" ) ;
3874
- assert_contains ! ( response. stderr, "starting at offset 0" ) ;
3875
- assert_contains ! ( response. stderr, "is out-of-bounds" ) ;
3876
- assert_contains ! ( response. stderr, "has size 0" ) ;
3872
+ assert_contains ! ( response. stderr, "using uninitialized data" ) ;
3873
+ assert_contains ! ( response. stderr, "operation requires initialized memory" ) ;
3877
3874
3878
3875
coordinator. shutdown ( ) . await ?;
3879
3876
Original file line number Diff line number Diff line change @@ -42,15 +42,14 @@ def code_with_lint_warnings
42
42
in_tools_menu { click_on ( "Miri" ) }
43
43
44
44
within ( :output , :stderr ) do
45
- expect ( page ) . to have_content %r{alloc \d + has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds } , wait : 10
45
+ expect ( page ) . to have_content %r{using uninitialized data, but this operation requires initialized memory } , wait : 10
46
46
end
47
47
end
48
48
49
49
def code_with_undefined_behavior
50
50
<<~EOF
51
51
fn main() {
52
- let mut a: [u8; 0] = [];
53
- unsafe { *a.get_unchecked_mut(1) = 1; }
52
+ unsafe { core::mem::MaybeUninit::<u8>::uninit().assume_init() };
54
53
}
55
54
EOF
56
55
end
You can’t perform that action at this time.
0 commit comments