Skip to content

Rustup #3320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Feb 25, 2024
Merged

Rustup #3320

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ebec6f5
Auto merge of #121223 - RalfJung:simd-intrinsics, r=Amanieu
bors Feb 22, 2024
65679ac
Auto merge of #117174 - Ayush1325:uefi-stdio-improve, r=workingjubilee
bors Feb 22, 2024
7233729
Auto merge of #121129 - nnethercote:codegen-Diags, r=estebank
bors Feb 22, 2024
498f5a0
Auto merge of #121225 - RalfJung:simd-extract-insert-const-idx, r=oli…
bors Feb 22, 2024
7123f8e
Auto merge of #121309 - Nilstrieb:inline-all-the-fallbacks, r=oli-obk
bors Feb 22, 2024
ef18fde
Auto merge of #121372 - clubby789:test-all-tests, r=onur-ozkan
bors Feb 22, 2024
7352740
Auto merge of #121341 - GrigorenkoPV:bootstrap-rustup-cargo, r=onur-o…
bors Feb 23, 2024
c4c1126
Auto merge of #121448 - klensy:bump-22-02-24, r=clubby789
bors Feb 23, 2024
1120433
Get rid of some `#[allow(static_mut_refs)]`
GrigorenkoPV Feb 23, 2024
4cea356
interpret: do no ICE on OOB shuffle/insert/extract indices
RalfJung Feb 23, 2024
c2f7232
Auto merge of #121303 - GrigorenkoPV:static_mut_refs, r=oli-obk,RalfJung
bors Feb 23, 2024
6807d48
Auto merge of #119536 - Jules-Bertholet:const-barrier, r=dtolnay
bors Feb 23, 2024
072f5a4
Rollup merge of #121435 - estebank:rpitit-static-119773, r=compiler-e…
matthiaskrgr Feb 24, 2024
c5ba0cd
Rollup merge of #121490 - gurry:121106-broken-usize-link-in-docs, r=n…
matthiaskrgr Feb 24, 2024
3eea1d1
Rollup merge of #121520 - matthiaskrgr:cloned, r=jackh726
matthiaskrgr Feb 24, 2024
0341df5
Rollup merge of #121522 - RalfJung:insert-extract-boundscheck, r=oli-obk
matthiaskrgr Feb 24, 2024
b4b5741
Rollup merge of #121531 - saethlin:ignore-less-debug, r=compiler-errors
matthiaskrgr Feb 24, 2024
d16a4b0
Rollup merge of #121539 - Enselic:fix-large-move, r=Nilstrieb
matthiaskrgr Feb 24, 2024
058b4b1
Rollup merge of #121542 - RalfJung:stdarch, r=Amanieu
matthiaskrgr Feb 24, 2024
f00f27a
Auto merge of #121523 - matthiaskrgr:comp_comp, r=Nilstrieb
bors Feb 24, 2024
86dc7b7
Auto merge of #121549 - matthiaskrgr:rollup-1hvu3lb, r=matthiaskrgr
bors Feb 24, 2024
73937dd
Rollup merge of #121343 - Takashiidobe:takashi/examples-for-slice, r=…
matthiaskrgr Feb 24, 2024
0fe7932
Rollup merge of #121374 - Nadrieril:factor-explain, r=matthewjasper
matthiaskrgr Feb 24, 2024
d3aea33
Rollup merge of #121474 - jieyouxu:ignore-directives-migration, r=Mar…
matthiaskrgr Feb 24, 2024
a37bfef
Rollup merge of #121530 - wgslr:master, r=Mark-Simulacrum
matthiaskrgr Feb 24, 2024
cbd6240
Auto merge of #121569 - matthiaskrgr:rollup-awglrax, r=matthiaskrgr
bors Feb 24, 2024
aea5b8e
Auto merge of #120650 - clubby789:switchint-const, r=saethlin
bors Feb 25, 2024
acefb26
Auto merge of #121114 - Nilstrieb:no-inline!, r=saethlin
bors Feb 25, 2024
b0086f2
Auto merge of #117107 - zachs18:mapped-mutex-guard, r=Amanieu
bors Feb 25, 2024
fd65260
Preparing for merge from rustc
RalfJung Feb 25, 2024
c703c7a
Merge from rustc
RalfJung Feb 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c5f69bdd5173a948e0131f934fa7c4cbf5e0b55f
a2f3c0cf880ad819c4eab2b320525b6a31ac6513
10 changes: 4 additions & 6 deletions src/shims/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
let right_idx = src_index.checked_sub(left_len).unwrap();
this.read_immediate(&this.project_index(&right, right_idx)?)?
} else {
span_bug!(
this.cur_span(),
"simd_shuffle index {src_index} is out of bounds for 2 vectors of size {left_len}",
throw_ub_format!(
"`simd_shuffle_generic` index {src_index} is out-of-bounds for 2 vectors with length {dest_len}"
);
};
this.write_immediate(*val, &dest)?;
Expand Down Expand Up @@ -604,9 +603,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
let right_idx = src_index.checked_sub(left_len).unwrap();
this.read_immediate(&this.project_index(&right, right_idx)?)?
} else {
span_bug!(
this.cur_span(),
"simd_shuffle index {src_index} is out of bounds for 2 vectors of size {left_len}",
throw_ub_format!(
"`simd_shuffle` index {src_index} is out-of-bounds for 2 vectors with length {dest_len}"
);
};
this.write_immediate(*val, &dest)?;
Expand Down
8 changes: 8 additions & 0 deletions tests/fail/intrinsics/simd-extract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![feature(portable_simd, core_intrinsics)]
use std::simd::*;

fn main() {
let v = i32x4::splat(0);
let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) };
//~^ERROR: index 4 is out-of-bounds
}
15 changes: 15 additions & 0 deletions tests/fail/intrinsics/simd-extract.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error: Undefined Behavior: `simd_extract` index 4 is out-of-bounds of vector with length 4
--> $DIR/simd-extract.rs:LL:CC
|
LL | let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `simd_extract` index 4 is out-of-bounds of vector with length 4
|
= 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
= note: BACKTRACE:
= note: inside `main` at $DIR/simd-extract.rs:LL:CC

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error

6 changes: 3 additions & 3 deletions tests/fail/tls/tls_static_dealloc.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Ensure that thread-local statics get deallocated when the thread dies.

#![feature(thread_local)]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
#![allow(static_mut_refs)]

use std::ptr::addr_of;

#[thread_local]
static mut TLS: u8 = 0;
Expand All @@ -12,7 +12,7 @@ unsafe impl Send for SendRaw {}

fn main() {
unsafe {
let dangling_ptr = std::thread::spawn(|| SendRaw(&TLS as *const u8)).join().unwrap();
let dangling_ptr = std::thread::spawn(|| SendRaw(addr_of!(TLS))).join().unwrap();
let _val = *dangling_ptr.0; //~ ERROR: has been freed
}
}
6 changes: 3 additions & 3 deletions tests/pass/static_mut.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::ptr::addr_of;

static mut FOO: i32 = 42;

// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
#[allow(static_mut_refs)]
static BAR: Foo = Foo(unsafe { &FOO as *const _ });
static BAR: Foo = Foo(unsafe { addr_of!(FOO) });

#[allow(dead_code)]
struct Foo(*const i32);
Expand Down
17 changes: 8 additions & 9 deletions tests/pass/tls/tls_static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
//! test, we also check that thread-locals act as per-thread statics.

#![feature(thread_local)]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
#![allow(static_mut_refs)]

use std::ptr::addr_of_mut;
use std::thread;

#[thread_local]
Expand All @@ -23,8 +22,8 @@ static mut C: u8 = 0;
#[thread_local]
static READ_ONLY: u8 = 42;

unsafe fn get_a_ref() -> *mut u8 {
&mut A
unsafe fn get_a_ptr() -> *mut u8 {
addr_of_mut!(A)
}

struct Sender(*mut u8);
Expand All @@ -35,12 +34,12 @@ fn main() {
let _val = READ_ONLY;

let ptr = unsafe {
let x = get_a_ref();
let x = get_a_ptr();
*x = 5;
assert_eq!(A, 5);
B = 15;
C = 25;
Sender(&mut A)
Sender(addr_of_mut!(A))
};

thread::spawn(move || unsafe {
Expand All @@ -51,18 +50,18 @@ fn main() {
assert_eq!(C, 25);
B = 14;
C = 24;
let y = get_a_ref();
let y = get_a_ptr();
assert_eq!(*y, 0);
*y = 4;
assert_eq!(*ptr.0, 5);
assert_eq!(A, 4);
assert_eq!(*get_a_ref(), 4);
assert_eq!(*get_a_ptr(), 4);
})
.join()
.unwrap();

unsafe {
assert_eq!(*get_a_ref(), 5);
assert_eq!(*get_a_ptr(), 5);
assert_eq!(A, 5);
assert_eq!(B, 15);
assert_eq!(C, 24);
Expand Down