Skip to content
New issue

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

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

Already on GitHub? # to your account

Automatic Rustup #3427

Merged
merged 26 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
285e880
Codegen const panic messages as function calls
Mark-Simulacrum Mar 18, 2024
ff2ef05
enable cargo miri test doctests
onur-ozkan Mar 25, 2024
873b9a4
Auto merge of #121387 - oli-obk:eager_const_failures_regression, r=lcnr
bors Mar 26, 2024
7de4c34
Auto merge of #122939 - joboet:proc_macro_bridge_state, r=petrochenkov
bors Mar 26, 2024
4bf56fa
In ConstructCoroutineInClosureShim, pass receiver by ref, not pointer
compiler-errors Mar 25, 2024
3643dc4
Auto merge of #118644 - madsmtm:macos-weak-linking-test, r=compiler-e…
bors Mar 26, 2024
a8821c0
Rollup merge of #108675 - Shadlock0133:adt_const_params, r=compiler-e…
matthiaskrgr Mar 26, 2024
d7fd8ad
Rollup merge of #122120 - fmease:sugg-assoc-ty-bound-on-eq-bound, r=c…
matthiaskrgr Mar 26, 2024
1c2abf2
Rollup merge of #122589 - wutchzone:121547, r=compiler-errors
matthiaskrgr Mar 26, 2024
860b63e
Rollup merge of #122835 - compiler-errors:deref-pure, r=Nadrieril
matthiaskrgr Mar 26, 2024
dfb5b89
Rollup merge of #123049 - compiler-errors:coroutine-closure-rcvr, r=o…
matthiaskrgr Mar 26, 2024
169663d
Rollup merge of #123055 - onur-ozkan:miri-rustdoc, r=RalfJung
matthiaskrgr Mar 26, 2024
8492f3d
Rollup merge of #123057 - sthibaul:systemtime, r=jhpratt
matthiaskrgr Mar 26, 2024
c7f688e
Rollup merge of #123087 - tgross35:clippy-f16-f128-check-stubs, r=bly…
matthiaskrgr Mar 26, 2024
bcf48de
Rollup merge of #123103 - compiler-errors:inherited-is-a-weird-name, …
matthiaskrgr Mar 26, 2024
ba70527
Auto merge of #123108 - matthiaskrgr:rollup-zossklv, r=matthiaskrgr
bors Mar 26, 2024
aa84f5c
Auto merge of #122958 - jieyouxu:port-backtrace-dylib-dep, r=workingj…
bors Mar 27, 2024
84967dd
Auto merge of #116016 - jhpratt:kill-rustc-serialize, r=ehuss
bors Mar 27, 2024
8988e5b
Auto merge of #122460 - jieyouxu:rmake-example-refactor, r=Nilstrieb
bors Mar 27, 2024
d913063
Auto merge of #122205 - onur-ozkan:incorrect-sysroot-for-target, r=al…
bors Mar 27, 2024
b901ffb
Auto merge of #116891 - aliemjay:opaque-region-infer-rework-2, r=comp…
bors Mar 28, 2024
0c0894c
Auto merge of #123178 - Nilstrieb:🥷-build, r=Mark-Simulacrum
bors Mar 28, 2024
d81b233
Auto merge of #122671 - Mark-Simulacrum:const-panic-msg, r=Nilstrieb
bors Mar 29, 2024
5d3a71b
Auto merge of #122975 - DianQK:simplify_ub_check, r=saethlin
bors Mar 29, 2024
8c2b112
Preparing for merge from rustc
Mar 29, 2024
f697b30
Merge from rustc
Mar 29, 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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ binaries, and as such worth documenting:
* `MIRI_LOCAL_CRATES` is set by `cargo-miri` to tell the Miri driver which
crates should be given special treatment in diagnostics, in addition to the
crate currently being compiled.
* `MIRI_ORIG_RUSTDOC` is set and read by different phases of `cargo-miri` to remember the
value of `RUSTDOC` from before it was overwritten.
* `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to
perform verbose logging.
* `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*
Expand Down
10 changes: 7 additions & 3 deletions cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
cmd.env("MIRI_BE_RUSTC", "target"); // we better remember to *unset* this in the other phases!

// Set rustdoc to us as well, so we can run doctests.
if let Some(orig_rustdoc) = env::var_os("RUSTDOC") {
cmd.env("MIRI_ORIG_RUSTDOC", orig_rustdoc);
}
cmd.env("RUSTDOC", &cargo_miri_path);

cmd.env("MIRI_LOCAL_CRATES", local_crates(&metadata));
Expand Down Expand Up @@ -581,9 +584,10 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
let verbose = std::env::var("MIRI_VERBOSE")
.map_or(0, |verbose| verbose.parse().expect("verbosity flag must be an integer"));

// phase_cargo_miri sets the RUSTDOC env var to ourselves, so we can't use that here;
// just default to a straight-forward invocation for now:
let mut cmd = Command::new("rustdoc");
// phase_cargo_miri sets the RUSTDOC env var to ourselves, and puts a backup
// of the old value into MIRI_ORIG_RUSTDOC. So that's what we have to invoke now.
let rustdoc = env::var("MIRI_ORIG_RUSTDOC").unwrap_or("rustdoc".to_string());
let mut cmd = Command::new(rustdoc);

while let Some(arg) = args.next() {
if arg == "--extern" {
Expand Down
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b13a71a2e77f4625d1a2b8a5b9488414686ebca9
760e567af5398a0d8c512f904e551e1f38e00d79
12 changes: 10 additions & 2 deletions src/shims/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,16 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
}

_ => {
// Forward everything else to `panic` lang item.
this.start_panic(msg.description(), unwind)?;
// Call the lang item associated with this message.
let fn_item = this.tcx.require_lang_item(msg.panic_function(), None);
let instance = ty::Instance::mono(this.tcx.tcx, fn_item);
this.call_function(
instance,
Abi::Rust,
&[],
None,
StackPopCleanup::Goto { ret: None, unwind },
)?;
}
}
Ok(())
Expand Down
40 changes: 40 additions & 0 deletions tests/pass/async-closure-drop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#![feature(async_closure, noop_waker, async_fn_traits)]

use std::future::Future;
use std::pin::pin;
use std::task::*;

pub fn block_on<T>(fut: impl Future<Output = T>) -> T {
let mut fut = pin!(fut);
let ctx = &mut Context::from_waker(Waker::noop());

loop {
match fut.as_mut().poll(ctx) {
Poll::Pending => {}
Poll::Ready(t) => break t,
}
}
}

async fn call_once(f: impl async FnOnce(DropMe)) {
f(DropMe("world")).await;
}

#[derive(Debug)]
struct DropMe(&'static str);

impl Drop for DropMe {
fn drop(&mut self) {
println!("{}", self.0);
}
}

pub fn main() {
block_on(async {
let b = DropMe("hello");
let async_closure = async move |a: DropMe| {
println!("{a:?} {b:?}");
};
call_once(async_closure).await;
});
}
3 changes: 3 additions & 0 deletions tests/pass/async-closure-drop.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DropMe("world") DropMe("hello")
world
hello
34 changes: 23 additions & 11 deletions tests/pass/async-closure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![feature(async_closure, noop_waker, async_fn_traits)]

use std::future::Future;
use std::ops::{AsyncFnMut, AsyncFnOnce};
use std::pin::pin;
use std::task::*;

Expand All @@ -16,25 +17,36 @@ pub fn block_on<T>(fut: impl Future<Output = T>) -> T {
}
}

async fn call_once(f: impl async FnOnce(DropMe)) {
f(DropMe("world")).await;
async fn call_mut(f: &mut impl AsyncFnMut(i32)) {
f(0).await;
}

#[derive(Debug)]
struct DropMe(&'static str);
async fn call_once(f: impl AsyncFnOnce(i32)) {
f(1).await;
}

impl Drop for DropMe {
fn drop(&mut self) {
println!("{}", self.0);
}
async fn call_normal<F: Future<Output = ()>>(f: &impl Fn(i32) -> F) {
f(0).await;
}

async fn call_normal_once<F: Future<Output = ()>>(f: impl FnOnce(i32) -> F) {
f(1).await;
}

pub fn main() {
block_on(async {
let b = DropMe("hello");
let async_closure = async move |a: DropMe| {
println!("{a:?} {b:?}");
let b = 2i32;
let mut async_closure = async move |a: i32| {
println!("{a} {b}");
};
call_mut(&mut async_closure).await;
call_once(async_closure).await;

// No-capture closures implement `Fn`.
let async_closure = async move |a: i32| {
println!("{a}");
};
call_normal(&async_closure).await;
call_normal_once(async_closure).await;
});
}
7 changes: 4 additions & 3 deletions tests/pass/async-closure.stdout
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DropMe("world") DropMe("hello")
world
hello
0 2
1 2
0
1