File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
compiler/base/orchestrator/src Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -3857,8 +3857,7 @@ mod tests {
38573857 let req = MiriRequest {
38583858 code : r#"
38593859 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() };
38623861 }
38633862 "#
38643863 . into ( ) ,
@@ -3870,10 +3869,8 @@ mod tests {
38703869 assert ! ( !response. success, "stderr: {}" , response. stderr) ;
38713870
38723871 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" ) ;
38773874
38783875 coordinator. shutdown ( ) . await ?;
38793876
Original file line number Diff line number Diff line change @@ -42,15 +42,14 @@ def code_with_lint_warnings
4242 in_tools_menu { click_on ( "Miri" ) }
4343
4444 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
4646 end
4747 end
4848
4949 def code_with_undefined_behavior
5050 <<~EOF
5151 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() };
5453 }
5554 EOF
5655 end
You can’t perform that action at this time.
0 commit comments