Skip to content

Commit 827954c

Browse files
author
The rustc-dev-guide Cronjob Bot
committed
Merge from rustc
2 parents b9befb5 + f51a3f5 commit 827954c

File tree

11 files changed

+14
-33
lines changed

11 files changed

+14
-33
lines changed

cargo-miri/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn main() {
5353
// with `RustcPhase::Rustdoc`. There we perform a check-build (needed to get the expected
5454
// build failures for `compile_fail` doctests) and then store a JSON file with the
5555
// information needed to run this test.
56-
// - We also set `--runtool` to ourselves, which ends up in `phase_runner` with
56+
// - We also set `--test-runtool` to ourselves, which ends up in `phase_runner` with
5757
// `RunnerPhase::Rustdoc`. There we parse the JSON file written in `phase_rustc` and invoke
5858
// the Miri driver for interpretation.
5959

cargo-miri/src/phases.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
666666
if arg == "--extern" {
667667
// Patch --extern arguments to use *.rmeta files, since phase_cargo_rustc only creates stub *.rlib files.
668668
forward_patched_extern_arg(&mut args, &mut cmd);
669-
} else if arg == "--runtool" {
670-
// An existing --runtool flag indicates cargo is running in cross-target mode, which we don't support.
669+
} else if arg == "--test-runtool" {
670+
// An existing --test-runtool flag indicates cargo is running in cross-target mode, which we don't support.
671671
// Note that this is only passed when cargo is run with the unstable -Zdoctest-xcompile flag;
672672
// otherwise, we won't be called as rustdoc at all.
673673
show_error!("cross-interpreting doctests is not currently supported by Miri.");
@@ -693,8 +693,8 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
693693
// to let phase_cargo_rustc know to expect that. We'll use this environment variable as a flag:
694694
cmd.env("MIRI_CALLED_FROM_RUSTDOC", "1");
695695

696-
// The `--test-builder` and `--runtool` arguments are unstable rustdoc features,
697-
// which are disabled by default. We first need to enable them explicitly:
696+
// The `--test-builder` is an unstable rustdoc features,
697+
// which is disabled by default. We first need to enable them explicitly:
698698
cmd.arg("-Zunstable-options");
699699

700700
// rustdoc needs to know the right sysroot.
@@ -705,7 +705,7 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
705705
// Make rustdoc call us back.
706706
let cargo_miri_path = env::current_exe().expect("current executable path invalid");
707707
cmd.arg("--test-builder").arg(&cargo_miri_path); // invoked by forwarding most arguments
708-
cmd.arg("--runtool").arg(&cargo_miri_path); // invoked with just a single path argument
708+
cmd.arg("--test-runtool").arg(&cargo_miri_path); // invoked with just a single path argument
709709

710710
debug_cmd("[cargo-miri rustdoc]", verbose, &cmd);
711711
exec(cmd)

src/intrinsics/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -391,32 +391,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
391391
this.write_scalar(res, dest)?;
392392
}
393393

394-
#[rustfmt::skip]
395-
| "fadd_algebraic"
396-
| "fsub_algebraic"
397-
| "fmul_algebraic"
398-
| "fdiv_algebraic"
399-
| "frem_algebraic"
400-
=> {
401-
let [a, b] = check_intrinsic_arg_count(args)?;
402-
let a = this.read_immediate(a)?;
403-
let b = this.read_immediate(b)?;
404-
let op = match intrinsic_name {
405-
"fadd_algebraic" => mir::BinOp::Add,
406-
"fsub_algebraic" => mir::BinOp::Sub,
407-
"fmul_algebraic" => mir::BinOp::Mul,
408-
"fdiv_algebraic" => mir::BinOp::Div,
409-
"frem_algebraic" => mir::BinOp::Rem,
410-
_ => bug!(),
411-
};
412-
let res = this.binary_op(op, &a, &b)?;
413-
// `binary_op` already called `generate_nan` if needed.
414-
// Apply a relative error of 4ULP to simulate non-deterministic precision loss
415-
// due to optimizations.
416-
let res = apply_random_float_error_to_imm(this, res, 2 /* log2(4) */)?;
417-
this.write_immediate(*res, dest)?;
418-
}
419-
420394
#[rustfmt::skip]
421395
| "fadd_fast"
422396
| "fsub_fast"

tests/fail/validity/invalid_bool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unnecessary_transmutes)]
12
fn main() {
23
let _b = unsafe { std::mem::transmute::<u8, bool>(2) }; //~ ERROR: expected a boolean
34
}

tests/fail/validity/invalid_bool_op.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Make sure we find these even with many checks disabled.
33
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
44

5+
#![allow(unnecessary_transmutes)]
56
fn main() {
67
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
78
let _x = b == std::hint::black_box(true); //~ ERROR: interpreting an invalid 8-bit value as a bool

tests/fail/validity/invalid_char.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unnecessary_transmutes)]
12
fn main() {
23
assert!(std::char::from_u32(-1_i32 as u32).is_none());
34
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } {

tests/fail/validity/invalid_char_op.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Make sure we find these even with many checks disabled.
33
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
44

5+
#![allow(unnecessary_transmutes)]
56
fn main() {
67
let c = 0xFFFFFFu32;
78
assert!(std::char::from_u32(c).is_none());

tests/pass/float.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![feature(f16)]
77
#![allow(arithmetic_overflow)]
88
#![allow(internal_features)]
9+
#![allow(unnecessary_transmutes)]
910

1011
use std::any::type_name;
1112
use std::cmp::min;

tests/pass/issues/issue-miri-184.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unnecessary_transmutes)]
12
pub fn main() {
23
let bytes: [u8; 8] = unsafe { ::std::mem::transmute(0u64) };
34
let _val: &[u8] = &bytes;

tests/pass/shims/x86/intrinsics-x86-gfni.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ unsafe fn load_m256i_word<T>(data: &[T], word_index: usize) -> __m256i {
368368
#[target_feature(enable = "avx512f")]
369369
unsafe fn load_m512i_word<T>(data: &[T], word_index: usize) -> __m512i {
370370
let byte_offset = word_index * 64 / size_of::<T>();
371-
let pointer = data.as_ptr().add(byte_offset) as *const i32;
371+
let pointer = data.as_ptr().add(byte_offset) as *const __m512i;
372372
_mm512_loadu_si512(black_box(pointer))
373373
}
374374

0 commit comments

Comments
 (0)