Skip to content

Commit a6fb322

Browse files
committed
Auto merge of #108521 - matthiaskrgr:rollup-exkviev, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #108319 (Don't project specializable RPITIT projection) - #108364 (Unify validity checks into a single query) - #108463 (bootstrap: Update the output of the `check` descriptions) - #108477 (Make `match` arm comma suggestion more clear) - #108486 (Merge diagnostic_items duplicate diagnostics) - #108494 (Clean up JS files code a bit) - #108500 (update Miri) - #108502 (Don't trigger error for ReError when other region is empty.) - #108513 (Remove `@nagisa` from review rotation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9fc3c21 + e98ddb4 commit a6fb322

File tree

27 files changed

+272
-47
lines changed

27 files changed

+272
-47
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ josh-proxy --local=$HOME/.cache/josh --remote=https://github.com --no-background
242242

243243
This uses a directory `$HOME/.cache/josh` as a cache, to speed up repeated pulling/pushing.
244244

245+
To make josh push via ssh instead of https, you can add the following to your `.gitconfig`:
246+
247+
```toml
248+
[url "git@github.com:"]
249+
pushInsteadOf = https://github.com/
250+
```
251+
245252
### Importing changes from the rustc repo
246253

247254
Josh needs to be running, as described above.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ degree documented below):
213213
- The best-supported target is `x86_64-unknown-linux-gnu`. Miri releases are
214214
blocked on things working with this target. Most other Linux targets should
215215
also work well; we do run the test suite on `i686-unknown-linux-gnu` as a
216-
32bit target and `mips64-unknown-linux-gnuabi64` as a big-endian target.
216+
32bit target and `mips64-unknown-linux-gnuabi64` as a big-endian target, as
217+
well as the ARM targets `aarch64-unknown-linux-gnu` and
218+
`arm-unknown-linux-gnueabi`.
217219
- `x86_64-apple-darwin` should work basically as well as Linux. We also test
218220
`aarch64-apple-darwin`. However, we might ship Miri with a nightly even when
219221
some features on these targets regress.
@@ -590,7 +592,7 @@ extern "Rust" {
590592
/// `out` must point to at least `out_size` many bytes, and the result will be stored there
591593
/// with a null terminator.
592594
/// Returns 0 if the `out` buffer was large enough, and the required size otherwise.
593-
fn miri_host_to_target_path(path: *const i8, out: *mut i8, out_size: usize) -> usize;
595+
fn miri_host_to_target_path(path: *const std::ffi::c_char, out: *mut std::ffi::c_char, out_size: usize) -> usize;
594596
}
595597
```
596598

cargo-miri/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cargo-miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ rustc-workspace-hack = "1.0.0"
3030
serde = { version = "*", features = ["derive"] }
3131

3232
[build-dependencies]
33-
rustc_tools_util = "0.2"
33+
rustc_tools_util = "0.3"

cargo-miri/build.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,5 @@ fn main() {
22
// Don't rebuild miri when nothing changed.
33
println!("cargo:rerun-if-changed=build.rs");
44
// gather version info
5-
println!(
6-
"cargo:rustc-env=GIT_HASH={}",
7-
rustc_tools_util::get_commit_hash().unwrap_or_default()
8-
);
9-
println!(
10-
"cargo:rustc-env=COMMIT_DATE={}",
11-
rustc_tools_util::get_commit_date().unwrap_or_default()
12-
);
5+
rustc_tools_util::setup_version_info!();
136
}

ci.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ run_tests
104104
case $HOST_TARGET in
105105
x86_64-unknown-linux-gnu)
106106
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
107+
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
107108
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
108109
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
109110
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple atomic data_race env/var
@@ -118,6 +119,7 @@ case $HOST_TARGET in
118119
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
119120
;;
120121
i686-pc-windows-msvc)
122+
MIRI_TEST_TARGET=arm-unknown-linux-gnueabi run_tests
121123
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
122124
MIRI_TEST_TARGET=x86_64-pc-windows-gnu run_tests
123125
;;

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c54c8cbac882e149e04a9e1f2d146fd548ae30ae
1+
c4e0cd966062ca67daed20775f4e8a60c28e57df

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ impl NewPermission {
148148
NewPermission::Uniform {
149149
perm: Permission::Unique,
150150
access: Some(AccessKind::Write),
151-
protector: (kind == RetagKind::FnEntry)
152-
.then_some(ProtectorKind::WeakProtector),
151+
protector: (kind == RetagKind::FnEntry).then_some(ProtectorKind::WeakProtector),
153152
}
154153
} else {
155154
// `!Unpin` boxes do not get `noalias` nor `dereferenceable`.

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#![allow(
1414
clippy::collapsible_else_if,
1515
clippy::collapsible_if,
16+
clippy::if_same_then_else,
1617
clippy::comparison_chain,
1718
clippy::enum_variant_names,
1819
clippy::field_reassign_with_default,
@@ -21,7 +22,7 @@
2122
clippy::single_match,
2223
clippy::useless_format,
2324
clippy::derive_partial_eq_without_eq,
24-
clippy::derive_hash_xor_eq,
25+
clippy::derived_hash_with_manual_eq,
2526
clippy::too_many_arguments,
2627
clippy::type_complexity,
2728
clippy::single_element_loop,

src/machine.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ pub struct MiriMachine<'mir, 'tcx> {
477477

478478
impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
479479
pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Self {
480-
let local_crates = helpers::get_local_crates(layout_cx.tcx);
480+
let tcx = layout_cx.tcx;
481+
let local_crates = helpers::get_local_crates(tcx);
481482
let layouts =
482483
PrimitiveLayouts::new(layout_cx).expect("Couldn't get layouts of primitive types");
483484
let profiler = config.measureme_out.as_ref().map(|out| {
@@ -486,10 +487,13 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
486487
let rng = StdRng::seed_from_u64(config.seed.unwrap_or(0));
487488
let borrow_tracker = config.borrow_tracker.map(|bt| bt.instanciate_global_state(config));
488489
let data_race = config.data_race_detector.then(|| data_race::GlobalState::new(config));
490+
// Determinine page size, stack address, and stack size.
491+
// These values are mostly meaningless, but the stack address is also where we start
492+
// allocating physical integer addresses for all allocations.
489493
let page_size = if let Some(page_size) = config.page_size {
490494
page_size
491495
} else {
492-
let target = &layout_cx.tcx.sess.target;
496+
let target = &tcx.sess.target;
493497
match target.arch.as_ref() {
494498
"wasm32" | "wasm64" => 64 * 1024, // https://webassembly.github.io/spec/core/exec/runtime.html#memory-instances
495499
"aarch64" =>
@@ -504,10 +508,12 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
504508
_ => 4 * 1024,
505509
}
506510
};
507-
let stack_addr = page_size * 32;
508-
let stack_size = page_size * 16;
511+
// On 16bit targets, 32 pages is more than the entire address space!
512+
let stack_addr = if tcx.pointer_size().bits() < 32 { page_size } else { page_size * 32 };
513+
let stack_size =
514+
if tcx.pointer_size().bits() < 32 { page_size * 4 } else { page_size * 16 };
509515
MiriMachine {
510-
tcx: layout_cx.tcx,
516+
tcx,
511517
borrow_tracker,
512518
data_race,
513519
intptrcast: RefCell::new(intptrcast::GlobalStateInner::new(config, stack_addr)),
@@ -902,8 +908,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
902908
};
903909
let (shim_size, shim_align, _kind) = ecx.get_alloc_info(alloc_id);
904910
let def_ty = ecx.tcx.type_of(def_id).subst_identity();
905-
let extern_decl_layout =
906-
ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
911+
let extern_decl_layout = ecx.tcx.layout_of(ty::ParamEnv::empty().and(def_ty)).unwrap();
907912
if extern_decl_layout.size != shim_size || extern_decl_layout.align.abi != shim_align {
908913
throw_unsup_format!(
909914
"`extern` static `{name}` from crate `{krate}` has been declared \

0 commit comments

Comments
 (0)