Skip to content

Rollup of 10 pull requests #121131

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 23 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cd7c161
Add known issue of let binding to format_args doc
Stargateur May 2, 2023
2137487
Add APIs for fetching foreign items including foreign modules, their …
momvart Feb 12, 2024
a261f8e
Move windows_sys.lst to bindings.txt
ChrisDenton Nov 15, 2023
adcbeb7
Add windows_sys readme
ChrisDenton Dec 8, 2023
846315d
Automatically sort windows_sys bindings
ChrisDenton Dec 8, 2023
55f9aed
Move all the heavy lifting from `TyCtxtAt::create_def` into `TyCtxt::…
oli-obk Feb 14, 2024
fa1e35c
Remove unnecessary else block from `thread_local!` expanded code
ShoyuVanilla Feb 14, 2024
2e691a5
Rewrite foreign item kind query using `DefKind`
momvart Feb 14, 2024
01c974f
Do not report overflow errors on ConstArgHasType goals
compiler-errors Feb 14, 2024
9cccf20
Clarified docs on non-atomic oprations on owned/mut refs to atomics
peterjoel Feb 14, 2024
64a9c9c
Reinstate some delayed bugs.
nnethercote Feb 14, 2024
a8d869e
rustdoc: cross-crate re-exports: correctly render late-bound params i…
fmease Feb 13, 2024
e6a21f5
Enforce coroutine-closure layouts are identical
compiler-errors Feb 15, 2024
0238d26
Rollup merge of #111106 - Stargateur:doc/format_args, r=m-ou-se
matthiaskrgr Feb 15, 2024
0977600
Rollup merge of #118749 - ChrisDenton:winsys, r=cuviper
matthiaskrgr Feb 15, 2024
71466ca
Rollup merge of #120982 - momvart:smir-61-foreign_kind, r=oli-obk
matthiaskrgr Feb 15, 2024
f9a0675
Rollup merge of #121022 - fmease:rustdoc-x-crate-late-bound-lt-src-or…
matthiaskrgr Feb 15, 2024
e5186aa
Rollup merge of #121082 - peterjoel:atomic-docs, r=cuviper
matthiaskrgr Feb 15, 2024
f62d981
Rollup merge of #121084 - oli-obk:create_def_forever_red2, r=WaffleLa…
matthiaskrgr Feb 15, 2024
15d9e2c
Rollup merge of #121098 - ShoyuVanilla:thread-local-unnecessary-else,…
matthiaskrgr Feb 15, 2024
888fe70
Rollup merge of #121105 - compiler-errors:no-const-ty-overflow, r=oli…
matthiaskrgr Feb 15, 2024
4899108
Rollup merge of #121116 - nnethercote:fix-121103-121108, r=oli-obk
matthiaskrgr Feb 15, 2024
829b59a
Rollup merge of #121122 - compiler-errors:identical-layouts, r=oli-obk
matthiaskrgr Feb 15, 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
20 changes: 20 additions & 0 deletions compiler/rustc_const_eval/src/transform/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ impl<'tcx> MirPass<'tcx> for Validator {
}
}
}

// Enforce that coroutine-closure layouts are identical.
if let Some(layout) = body.coroutine_layout()
&& let Some(by_move_body) = body.coroutine_by_move_body()
&& let Some(by_move_layout) = by_move_body.coroutine_layout()
{
if layout != by_move_layout {
// If this turns out not to be true, please let compiler-errors know.
// It is possible to support, but requires some changes to the layout
// computation code.
cfg_checker.fail(
Location::START,
format!(
"Coroutine layout differs from by-move coroutine layout:\n\
layout: {layout:#?}\n\
by_move_layout: {by_move_layout:#?}",
),
);
}
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_middle/src/mir/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ rustc_index::newtype_index! {
pub struct CoroutineSavedLocal {}
}

#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
pub struct CoroutineSavedTy<'tcx> {
pub ty: Ty<'tcx>,
/// Source info corresponding to the local in the original MIR body.
Expand All @@ -96,7 +97,8 @@ pub struct CoroutineSavedTy<'tcx> {
}

/// The layout of coroutine state.
#[derive(Clone, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
#[derive(Clone, PartialEq, Eq)]
#[derive(TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
pub struct CoroutineLayout<'tcx> {
/// The type of every local stored inside the coroutine.
pub field_tys: IndexVec<CoroutineSavedLocal, CoroutineSavedTy<'tcx>>,
Expand Down