Skip to content
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

Rollup of 6 pull requests #113505

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
05503b3
Correct the Android stat struct definitions
chriswailes Jun 20, 2023
ccb3328
Bashy Mc Bashface
oli-obk Jun 29, 2023
2039e7c
Checking for a cached value without having a cache is useless
oli-obk Jun 29, 2023
d061edd
Auto merge of #2947 - oli-obk:gha_mk_pr, r=RalfJung
bors Jun 29, 2023
db76154
add codegen-test: wasm-exceptions
mirkootter Jul 1, 2023
65aeac6
add assembly-test: wasm-exceptions
mirkootter Jul 1, 2023
6144130
test-various: update nodejs to 18.12 (LTS)
mirkootter Jul 1, 2023
211946c
add run-make test for wasm-exceptions
mirkootter Jul 1, 2023
a0bd381
test-various: run codegen and assembly tests
mirkootter Jul 1, 2023
5fa7403
cronjob auto-PR: make sure we are on a branch
RalfJung Jul 2, 2023
9e49f53
Auto merge of #2948 - RalfJung:cron, r=RalfJung
bors Jul 2, 2023
04db677
cronjob auto-PR: fetch more of the history
RalfJung Jul 2, 2023
7adf8dd
CI cleanup
RalfJung Jul 2, 2023
918f393
Auto merge of #2949 - RalfJung:cron, r=RalfJung
bors Jul 2, 2023
cc4670f
cargo-miri: better error message when RUSTC is not set
icewind1991 Jul 2, 2023
f2ce230
cron auto-PR: need to set upstream branch
RalfJung Jul 2, 2023
a6eb25a
Auto merge of #2951 - rust-lang:cron, r=RalfJung
bors Jul 2, 2023
7d12d2f
Auto merge of #2950 - icewind1991:cargo-miri-rustc-error, r=RalfJung
bors Jul 2, 2023
32168b7
cronjob auto-PR: try to fix setting the remote branch
RalfJung Jul 2, 2023
0bf13a4
Auto merge of #2952 - RalfJung:cron, r=RalfJung
bors Jul 2, 2023
2c5e076
sadly 'gh' doesnt support all git upstream branch configs
RalfJung Jul 2, 2023
f037471
Auto merge of #2953 - RalfJung:cron, r=RalfJung
bors Jul 2, 2023
4c7fbf8
more CI yml cleanup
RalfJung Jul 2, 2023
352180b
can't seem to avoid repeating the branch name...
RalfJung Jul 2, 2023
7d63d70
Auto merge of #2954 - RalfJung:cron, r=RalfJung
bors Jul 2, 2023
17e17e1
Preparing for merge from rustc
Jul 3, 2023
1505dd8
Merge from rustc
Jul 3, 2023
707afc3
fmt
Jul 3, 2023
6a21b2d
Silence clippy on FIXME'd code and fix the new lints otherwise
oli-obk Jul 3, 2023
a8b6ec1
Auto merge of #2955 - rust-lang:rustup2023-07-03, r=oli-obk
bors Jul 3, 2023
46c1e61
send link to PR to Zulip
RalfJung Jul 3, 2023
4951d5f
remove outdated comment
RalfJung Jul 3, 2023
a68afa2
vec tets: ensure pointer is still writeable
RalfJung Jul 3, 2023
89c2596
Auto merge of #2959 - RalfJung:vectest, r=RalfJung
bors Jul 3, 2023
2b3fae1
Auto merge of #2957 - RalfJung:zulip, r=oli-obk
bors Jul 4, 2023
812f9b2
better error on missing #[start]
RalfJung Jul 4, 2023
da98baa
Restore test filtering by substring.
oli-obk Jul 4, 2023
8fa4894
Auto merge of #2963 - RalfJung:start, r=RalfJung
bors Jul 4, 2023
7591c51
Auto merge of #2960 - oli-obk:run_filter, r=oli-obk
bors Jul 4, 2023
a4b7e14
C "memcpy" shim: ensure the pointers are valid
RalfJung Jul 5, 2023
a811ada
Ignore test on apple
oli-obk Jul 6, 2023
c8b3992
Auto merge of #2968 - RalfJung:memcpy, r=RalfJung
bors Jul 6, 2023
822feaa
Stop parsing ui_test annotations in `run-dep` mode
oli-obk Jul 6, 2023
a5286fc
Preparing for merge from rustc
Jul 7, 2023
b13a9fa
Merge from rustc
Jul 7, 2023
536c910
fmt
Jul 7, 2023
fa6cf3f
Auto merge of #2970 - rust-lang:rustup2023-07-07, r=oli-obk
bors Jul 7, 2023
813b56b
Silence all the boilerplate around `./miri run` and `./miri run-dep`
oli-obk Jul 7, 2023
48fe0df
Remove a now-useless flag
oli-obk Jul 7, 2023
c6f5b5f
MIRIFLAGS are already passed in the `./miri` wrapper
oli-obk Jul 7, 2023
2323ecb
Auto merge of #2969 - oli-obk:run-dep, r=RalfJung
bors Jul 7, 2023
a088e79
Remove `default_free_fn` feature
JohnTitor Jul 8, 2023
2c3cf5a
Preparing for merge from rustc
Jul 8, 2023
c182669
Merge from rustc
Jul 8, 2023
dfe0d21
Auto merge of #2971 - rust-lang:rustup2023-07-08, r=RalfJung
bors Jul 8, 2023
9ed4669
update lockfile
RalfJung Jul 8, 2023
6f8ba51
additional io::copy specializations
the8472 Jul 8, 2023
92b5d0c
Use String or Int to set the opt level
Rustin170506 Jul 3, 2023
7087164
Rollup merge of #113130 - chriswailes:android-library-defs, r=thomcc
matthiaskrgr Jul 9, 2023
1fcbe52
Rollup merge of #113247 - mirkootter:test-wasm-exceptions-nostd, r=Ma…
matthiaskrgr Jul 9, 2023
733611d
Rollup merge of #113273 - hi-rustin:rustin-patch-opt-level, r=Kobzol
matthiaskrgr Jul 9, 2023
28ed0ec
Rollup merge of #113469 - JohnTitor:rm-default-free-fn, r=Amanieu
matthiaskrgr Jul 9, 2023
80a0bdd
Rollup merge of #113488 - RalfJung:miri, r=RalfJung
matthiaskrgr Jul 9, 2023
1fce13a
Rollup merge of #113493 - the8472:spec-iocopy-slice, r=Mark-Simulacrum
matthiaskrgr Jul 9, 2023
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
4 changes: 2 additions & 2 deletions src/tools/miri/cargo-miri/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub enum MiriCommand {
pub fn escape_for_toml(s: &str) -> String {
// We want to surround this string in quotes `"`. So we first escape all quotes,
// and also all backslashes (that are used to escape quotes).
let s = s.replace('\\', r#"\\"#).replace('"', r#"\""#);
let s = s.replace('\\', r"\\").replace('"', r#"\""#);
format!("\"{s}\"")
}

Expand Down Expand Up @@ -130,7 +130,7 @@ pub fn exec(mut cmd: Command) -> ! {
{
use std::os::unix::process::CommandExt;
let error = cmd.exec();
Err(error).expect("failed to run command")
panic!("failed to run command: {error}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
75726cae37317c7262b69d3e9fd11a3496a88d04
d5a74249c843e06b502fb097ebea2383b9a5d9b8
29 changes: 19 additions & 10 deletions src/tools/miri/src/borrow_tracker/stacked_borrows/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ impl AllocHistory {
impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
pub fn start_grant(&mut self, perm: Permission) {
let Operation::Retag(op) = &mut self.operation else {
unreachable!("start_grant must only be called during a retag, this is: {:?}", self.operation)
unreachable!(
"start_grant must only be called during a retag, this is: {:?}",
self.operation
)
};
op.permission = Some(perm);

Expand Down Expand Up @@ -286,7 +289,8 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
tag: BorTag,
protector_tag: Option<BorTag>,
) -> Option<TagHistory> {
let Some(created) = self.history
let Some(created) = self
.history
.creations
.iter()
.rev()
Expand Down Expand Up @@ -315,22 +319,27 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
None
}
})
}).or_else(|| {
})
.or_else(|| {
// If we didn't find a retag that created this tag, it might be the base tag of
// this allocation.
if self.history.base.0.tag() == tag {
Some((
format!("{tag:?} was created here, as the base tag for {:?}", self.history.id),
self.history.base.1.data()
format!(
"{tag:?} was created here, as the base tag for {:?}",
self.history.id
),
self.history.base.1.data(),
))
} else {
None
}
}) else {
// But if we don't have a creation event, this is related to a wildcard, and there
// is really nothing we can do to help.
return None;
};
})
else {
// But if we don't have a creation event, this is related to a wildcard, and there
// is really nothing we can do to help.
return None;
};

let invalidated = self.history.invalidations.iter().rev().find_map(|event| {
if event.tag == tag { Some(event.generate_diagnostic()) } else { None }
Expand Down
7 changes: 5 additions & 2 deletions src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,15 @@ impl<'tcx> Stack {
.find_granting(AccessKind::Write, derived_from, exposed_tags)
.map_err(|()| dcx.grant_error(self))?;

let (Some(granting_idx), ProvenanceExtra::Concrete(_)) = (granting_idx, derived_from) else {
let (Some(granting_idx), ProvenanceExtra::Concrete(_)) = (granting_idx, derived_from)
else {
// The parent is a wildcard pointer or matched the unknown bottom.
// This is approximate. Nobody knows what happened, so forget everything.
// The new thing is SRW anyway, so we cannot push it "on top of the unknown part"
// (for all we know, it might join an SRW group inside the unknown).
trace!("reborrow: forgetting stack entirely due to SharedReadWrite reborrow from wildcard or unknown");
trace!(
"reborrow: forgetting stack entirely due to SharedReadWrite reborrow from wildcard or unknown"
);
self.set_unknown_bottom(global.next_ptr_tag);
return Ok(());
};
Expand Down
26 changes: 13 additions & 13 deletions src/tools/miri/src/borrow_tracker/stacked_borrows/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,19 @@ impl<'tcx> Stack {
let ProvenanceExtra::Concrete(tag) = tag else {
// Handle the wildcard case.
// Go search the stack for an exposed tag.
if let Some(idx) =
self.borrows
.iter()
.enumerate() // we also need to know *where* in the stack
.rev() // search top-to-bottom
.find_map(|(idx, item)| {
// If the item fits and *might* be this wildcard, use it.
if item.perm().grants(access) && exposed_tags.contains(&item.tag()) {
Some(idx)
} else {
None
}
})
if let Some(idx) = self
.borrows
.iter()
.enumerate() // we also need to know *where* in the stack
.rev() // search top-to-bottom
.find_map(|(idx, item)| {
// If the item fits and *might* be this wildcard, use it.
if item.perm().grants(access) && exposed_tags.contains(&item.tag()) {
Some(idx)
} else {
None
}
})
{
return Ok(Some(idx));
}
Expand Down
8 changes: 6 additions & 2 deletions src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,13 @@ impl DisplayRepr {
extraction_aux(tree, tree.root, show_unnamed, &mut v);
let Some(root) = v.pop() else {
if show_unnamed {
unreachable!("This allocation contains no tags, not even a root. This should not happen.");
unreachable!(
"This allocation contains no tags, not even a root. This should not happen."
);
}
eprintln!("This allocation does not contain named tags. Use `miri_print_borrow_state(_, true)` to also print unnamed tags.");
eprintln!(
"This allocation does not contain named tags. Use `miri_print_borrow_state(_, true)` to also print unnamed tags."
);
return None;
};
assert!(v.is_empty());
Expand Down
4 changes: 3 additions & 1 deletion src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
ptr_size.bytes()
);

let Some(new_perm) = new_perm else { return Ok(Some((alloc_id, orig_tag))); };
let Some(new_perm) = new_perm else {
return Ok(Some((alloc_id, orig_tag)));
};

if let Some(protect) = new_perm.protector {
// We register the protection in two different places.
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#![feature(local_key_cell_methods)]
#![feature(round_ties_even)]
#![feature(os_str_bytes)]
#![feature(lint_reasons)]
// Configure clippy and other lints
#![allow(
clippy::collapsible_else_if,
Expand Down
14 changes: 7 additions & 7 deletions src/tools/miri/src/shims/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {

// `index` is an array, not a SIMD type
let ty::Array(_, index_len) = index.layout.ty.kind() else {
span_bug!(this.cur_span(), "simd_shuffle index argument has non-array type {}", index.layout.ty)
span_bug!(
this.cur_span(),
"simd_shuffle index argument has non-array type {}",
index.layout.ty
)
};
let index_len = index_len.eval_target_usize(*this.tcx, this.param_env());

Expand Down Expand Up @@ -622,9 +626,7 @@ fn fmax_op<'tcx>(
right: &ImmTy<'tcx, Provenance>,
) -> InterpResult<'tcx, Scalar<Provenance>> {
assert_eq!(left.layout.ty, right.layout.ty);
let ty::Float(float_ty) = left.layout.ty.kind() else {
bug!("fmax operand is not a float")
};
let ty::Float(float_ty) = left.layout.ty.kind() else { bug!("fmax operand is not a float") };
let left = left.to_scalar();
let right = right.to_scalar();
Ok(match float_ty {
Expand All @@ -638,9 +640,7 @@ fn fmin_op<'tcx>(
right: &ImmTy<'tcx, Provenance>,
) -> InterpResult<'tcx, Scalar<Provenance>> {
assert_eq!(left.layout.ty, right.layout.ty);
let ty::Float(float_ty) = left.layout.ty.kind() else {
bug!("fmin operand is not a float")
};
let ty::Float(float_ty) = left.layout.ty.kind() else { bug!("fmin operand is not a float") };
let left = left.to_scalar();
let right = right.to_scalar();
Ok(match float_ty {
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/src/shims/unix/linux/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
/// `EFD_SEMAPHORE` - miri does not support semaphore-like semantics.
///
/// <https://linux.die.net/man/2/eventfd>
#[expect(clippy::needless_if)]
fn eventfd(
&mut self,
val: &OpTy<'tcx, Provenance>,
Expand Down