Skip to content

Commit 5f7b624

Browse files
committed
Auto merge of #17732 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
2 parents 7a5fed6 + c1cabe8 commit 5f7b624

9 files changed

+29
-14
lines changed

tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _
1010
error: deadlock: the evaluated program deadlocked
1111
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
1212
|
13-
LL | let ret = libc::pthread_join(self.id, ptr::null_mut());
13+
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
1414
| ^ the evaluated program deadlocked
1515
|
1616
= note: BACKTRACE:

tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mu
1010
error: deadlock: the evaluated program deadlocked
1111
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
1212
|
13-
LL | let ret = libc::pthread_join(self.id, ptr::null_mut());
13+
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
1414
| ^ the evaluated program deadlocked
1515
|
1616
= note: BACKTRACE:

tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mu
1010
error: deadlock: the evaluated program deadlocked
1111
--> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
1212
|
13-
LL | let ret = libc::pthread_join(self.id, ptr::null_mut());
13+
LL | let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
1414
| ^ the evaluated program deadlocked
1515
|
1616
= note: BACKTRACE:

tests/fail/dyn-upcast-trait-mismatch.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ impl Baz for i32 {
5959
}
6060

6161
fn main() {
62-
let baz: &dyn Baz = &1;
63-
let baz_fake: *const dyn Bar = unsafe { std::mem::transmute(baz) };
64-
let _err = baz_fake as *const dyn Foo;
65-
//~^ERROR: using vtable for trait `Baz` but trait `Bar` was expected
62+
unsafe {
63+
let baz: &dyn Baz = &1;
64+
let baz_fake: *const dyn Bar = std::mem::transmute(baz);
65+
let _err = baz_fake as *const dyn Foo;
66+
//~^ERROR: using vtable for trait `Baz` but trait `Bar` was expected
67+
}
6668
}

tests/fail/dyn-upcast-trait-mismatch.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: using vtable for trait `Baz` but trait `Bar` was expected
22
--> $DIR/dyn-upcast-trait-mismatch.rs:LL:CC
33
|
4-
LL | let _err = baz_fake as *const dyn Foo;
5-
| ^^^^^^^^ using vtable for trait `Baz` but trait `Bar` was expected
4+
LL | let _err = baz_fake as *const dyn Foo;
5+
| ^^^^^^^^ using vtable for trait `Baz` but trait `Bar` was expected
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/extern_static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ extern "C" {
55
}
66

77
fn main() {
8-
let _val = unsafe { std::ptr::addr_of!(FOO) }; //~ ERROR: is not supported by Miri
8+
let _val = std::ptr::addr_of!(FOO); //~ ERROR: is not supported by Miri
99
}

tests/fail/extern_static.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: unsupported operation: extern static `FOO` is not supported by Miri
22
--> $DIR/extern_static.rs:LL:CC
33
|
4-
LL | let _val = unsafe { std::ptr::addr_of!(FOO) };
5-
| ^^^ extern static `FOO` is not supported by Miri
4+
LL | let _val = std::ptr::addr_of!(FOO);
5+
| ^^^ extern static `FOO` is not supported by Miri
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
88
= note: BACKTRACE:

tests/pass/intrinsics/portable-simd.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
//@compile-flags: -Zmiri-strict-provenance
2-
#![feature(portable_simd, adt_const_params, core_intrinsics, repr_simd)]
2+
#![feature(
3+
portable_simd,
4+
unsized_const_params,
5+
adt_const_params,
6+
rustc_attrs,
7+
intrinsics,
8+
core_intrinsics,
9+
repr_simd
10+
)]
311
#![allow(incomplete_features, internal_features)]
412
use std::intrinsics::simd as intrinsics;
513
use std::ptr;
614
use std::simd::{prelude::*, StdFloat};
715

16+
extern "rust-intrinsic" {
17+
#[rustc_nounwind]
18+
pub fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
19+
}
20+
821
fn simd_ops_f32() {
922
let a = f32x4::splat(10.0);
1023
let b = f32x4::from_array([1.0, 2.0, 3.0, -4.0]);

tests/pass/static_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::ptr::addr_of;
22

33
static mut FOO: i32 = 42;
44

5-
static BAR: Foo = Foo(unsafe { addr_of!(FOO) });
5+
static BAR: Foo = Foo(addr_of!(FOO));
66

77
#[allow(dead_code)]
88
struct Foo(*const i32);

0 commit comments

Comments
 (0)