Skip to content

Rollup of 8 pull requests #129900

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

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
102997a
Update Tests
veera-sivarajan Jul 13, 2024
764675e
Add Tests
veera-sivarajan Aug 6, 2024
f003e92
Don't Suggest Labeling `const` and `unsafe` Blocks
veera-sivarajan Aug 6, 2024
9a29081
call `Cargo::configure_linker` only for specific commands
onur-ozkan Aug 9, 2024
94fbe14
don't try to find target tools on certain commands
onur-ozkan Aug 9, 2024
12de141
Suggest `impl Trait` for References to Bare Trait in Function Header
veera-sivarajan Jul 13, 2024
28dc116
Don't ICE when dumping MIR of a synthetic coroutine body
compiler-errors Aug 28, 2024
8d3945d
Rename dump of coroutine by-move-body to be more consistent, adjust test
compiler-errors Aug 28, 2024
98106cf
Re-parent the by-move body
compiler-errors Aug 28, 2024
9ad8e26
rustdoc: use `LocalDefId` for inline stmt
notriddle Aug 30, 2024
a3127ca
rustdoc: use a single box to store Attributes and ItemKind
notriddle Aug 30, 2024
121e9f4
Add rust.randomize-layout config to build artifacts with -Zrandomize-…
the8472 Sep 2, 2022
f3bc08a
ignore/fix layout-sensitive tests
the8472 Sep 2, 2022
5bf8eeb
disable size asserts in the compiler when randomizing layouts
the8472 Sep 2, 2022
e3169f7
when -Zrandomize-layout is enabled disable alloc test testing interna…
the8472 Sep 2, 2022
1e377c5
enable layout randomization in x86_64-gnu-llvm-17 CI job
the8472 Sep 2, 2022
df20808
inhibit layout randomization for Box
the8472 Aug 31, 2024
c218c75
exclude tools with deps that have size asserts
the8472 Aug 31, 2024
a763f96
Pin memchr to 2.5.0 in the library rather than rustc_ast
tgross35 Aug 26, 2024
dcbe15c
Run `cargo update` in the root, library, and rustbook
tgross35 Aug 26, 2024
a57c399
Adjust allowed dependencies from the latest `cargo update`
tgross35 Aug 26, 2024
f8739f0
Port std library to RTEMS
thesummer Aug 21, 2023
55f3b01
rtems: Add spec file for arm_rtems6_eabihf
thesummer Jan 23, 2024
01b57cb
Add documentation for target armv7-rtems-eabihf
thesummer Jun 26, 2024
17f5098
Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-Simulacrum
matthiaskrgr Sep 2, 2024
44a2b5e
Rollup merge of #127021 - thesummer:1-add-target-support-for-rtems-ar…
matthiaskrgr Sep 2, 2024
b409db4
Rollup merge of #127692 - veera-sivarajan:bugfix-125139, r=estebank
matthiaskrgr Sep 2, 2024
31e63ea
Rollup merge of #128701 - veera-sivarajan:fix-128604, r=estebank
matthiaskrgr Sep 2, 2024
5416804
Rollup merge of #128871 - onur-ozkan:128180, r=Kobzol
matthiaskrgr Sep 2, 2024
4841c83
Rollup merge of #129624 - tgross35:cargo-update, r=Mark-Simulacrum
matthiaskrgr Sep 2, 2024
9cf4d3c
Rollup merge of #129706 - compiler-errors:scratch, r=estebank
matthiaskrgr Sep 2, 2024
9b2775a
Rollup merge of #129789 - notriddle:notriddle/inline-stmt-local, r=Gu…
matthiaskrgr Sep 2, 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
Prev Previous commit
Next Next commit
Rename dump of coroutine by-move-body to be more consistent, adjust test
  • Loading branch information
compiler-errors committed Aug 29, 2024
commit 8d3945d01da87b2dc2fbbadaedddb92dc7697ed1
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ pub fn coroutine_by_move_body_def_id<'tcx>(

let mut by_move_body = body.clone();
MakeByMoveBody { tcx, field_remapping, by_move_coroutine_ty }.visit_body(&mut by_move_body);
dump_mir(tcx, false, "coroutine_by_move", &0, &by_move_body, |_, _| Ok(()));

let body_def = tcx.create_def(coroutine_def_id, kw::Empty, DefKind::SyntheticCoroutineBody);
by_move_body.source =
mir::MirSource::from_instance(InstanceKind::Item(body_def.def_id().to_def_id()));
dump_mir(tcx, false, "built", &"after", &by_move_body, |_, _| Ok(()));

// Inherited from the by-ref coroutine.
body_def.codegen_fn_attrs(tcx.codegen_fn_attrs(coroutine_def_id).clone());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_move
// MIR for `main::{closure#0}::{closure#0}::{closure#0}::{closure#0}` after built

fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10}, _2: ResumeTy) -> ()
fn main::{closure#0}::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:55:53: 58:10}, _2: ResumeTy) -> ()
yields ()
{
debug _task_context => _2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_move
// MIR for `main::{closure#0}::{closure#0}::{closure#0}` after built

fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10}, _2: ResumeTy) -> ()
fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:55:53: 58:10}, _2: ResumeTy) -> ()
yields ()
{
debug _task_context => _2;
debug a => (_1.0: i32);
debug b => (_1.1: i32);
debug b => (*(_1.1: &i32));
let mut _0: ();
let _3: i32;
scope 1 {
Expand All @@ -28,7 +28,7 @@ yields ()
_4 = &_3;
FakeRead(ForLet(None), _4);
StorageLive(_5);
_5 = &(_1.1: i32);
_5 = &(*(_1.1: &i32));
FakeRead(ForLet(None), _5);
_0 = const ();
StorageDead(_5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_move

fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:53:33: 53:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:53:53: 56:10};
fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:55:33: 55:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:55:53: 58:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:55:53: 58:10};

bb0: {
_0 = {coroutine@$DIR/async_closure_shims.rs:53:53: 56:10 (#0)} { a: move _2, b: move (_1.0: i32) };
_0 = {coroutine@$DIR/async_closure_shims.rs:55:53: 58:10 (#0)} { a: move _2, b: move (_1.0: i32) };
return;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIR for `main::{closure#0}::{closure#1}::{closure#0}` 0 coroutine_by_move
// MIR for `main::{closure#0}::{closure#1}::{closure#0}::{closure#0}` after built

fn main::{closure#0}::{closure#1}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}, _2: ResumeTy) -> ()
fn main::{closure#0}::{closure#1}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10}, _2: ResumeTy) -> ()
yields ()
{
debug _task_context => _2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIR for `main::{closure#0}::{closure#1}::{closure#0}` 0 coroutine_by_move
// MIR for `main::{closure#0}::{closure#1}::{closure#0}` after built

fn main::{closure#0}::{closure#1}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}, _2: ResumeTy) -> ()
fn main::{closure#0}::{closure#1}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10}, _2: ResumeTy) -> ()
yields ()
{
debug _task_context => _2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_move

fn main::{closure#0}::{closure#1}(_1: {async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};
fn main::{closure#0}::{closure#1}(_1: {async closure@$DIR/async_closure_shims.rs:64:33: 64:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10};

bb0: {
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: move (_1.0: &i32) };
_0 = {coroutine@$DIR/async_closure_shims.rs:64:48: 67:10 (#0)} { a: move _2, b: move (_1.0: &i32) };
return;
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_ref

fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.rs:62:33: 62:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};
fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.rs:64:33: 64:47}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10} {
let mut _0: {async closure body@$DIR/async_closure_shims.rs:64:48: 67:10};

bb0: {
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
_0 = {coroutine@$DIR/async_closure_shims.rs:64:48: 67:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
return;
}
}
10 changes: 6 additions & 4 deletions tests/mir-opt/async_closure_shims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn block_on<T>(fut: impl Future<Output = T>) -> T {
}
}

async fn call(f: &mut impl AsyncFn(i32)) {
async fn call(f: &impl AsyncFn(i32)) {
f(0).await;
}

Expand All @@ -43,18 +43,20 @@ async fn call_normal_mut<F: Future<Output = ()>>(f: &mut impl FnMut(i32) -> F) {
}

// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.built.after.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}-{closure#0}.built.after.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_move.0.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.built.after.mir
// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}-{closure#0}.built.after.mir
pub fn main() {
block_on(async {
let b = 2i32;
let mut async_closure = async move |a: i32| {
let a = &a;
let b = &b;
};
call(&mut async_closure).await;
call(&async_closure).await;
call_mut(&mut async_closure).await;
call_once(async_closure).await;

Expand Down