Skip to content

Commit

Permalink
Auto merge of #114424 - matthiaskrgr:rollup-cegblvo, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Rollup of 8 pull requests

Successful merges:

 - #113657 (Expand, rename and improve `incorrect_fn_null_checks` lint)
 - #114237 (parser: more friendly hints for handling `async move` in the 2015 edition)
 - #114300 (Suggests turbofish in patterns)
 - #114372 (const validation: point at where we found a pointer but expected an integer)
 - #114395 ([rustc_span][perf] Hoist lookup sorted by words out of the loop.)
 - #114403 (fix the span in the suggestion of remove question mark)
 - #114408 (Temporary remove myself from review rotation)
 - #114415 (Skip checking of `rustc_codegen_gcc` with vendoring enabled)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Aug 3, 2023
2 parents f5eacdd + 533af2f commit ab46740
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ pub fn report_error<'tcx, 'mir>(
} else {
#[rustfmt::skip]
let title = match e.kind() {
UndefinedBehavior(UndefinedBehaviorInfo::ValidationError(e)) if matches!(e.kind, ValidationErrorKind::PointerAsInt { .. } | ValidationErrorKind::PartialPointer) =>
bug!("This validation error should be impossible in Miri: {:?}", e.kind),
UndefinedBehavior(_) =>
"Undefined Behavior",
ResourceExhaustion(_) =>
Expand Down Expand Up @@ -377,7 +379,7 @@ pub fn report_error<'tcx, 'mir>(
if let Some((alloc_id, access)) = extra {
eprintln!(
"Uninitialized memory occurred at {alloc_id:?}{range:?}, in this allocation:",
range = access.uninit,
range = access.bad,
);
eprintln!("{:?}", ecx.dump_alloc(alloc_id));
}
Expand Down
4 changes: 2 additions & 2 deletions tests/fail/validity/uninit_float.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized bytes
error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number
--> $DIR/uninit_float.rs:LL:CC
|
LL | let _val: [f32; 1] = unsafe { std::mem::uninitialized() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized bytes
| ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
Expand Down
4 changes: 2 additions & 2 deletions tests/fail/validity/uninit_integer.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized bytes
error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer
--> $DIR/uninit_integer.rs:LL:CC
|
LL | let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assume_init() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized bytes
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
Expand Down

0 comments on commit ab46740

Please sign in to comment.