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 8 pull requests #122365

Merged
merged 19 commits into from
Mar 12, 2024
Merged
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3ab6936
mir-opt unnamed-fields filecheck annotations
Kirandevraj Mar 1, 2024
6f1156a
fixing mir pass name to text comment
Kirandevraj Mar 9, 2024
3af28f0
Fix 32-bit overflows in LLVM composite constants
erer1243 Mar 4, 2024
cfbc1b9
Enable creating backtraces via -Ztreat-err-as-bug when stashing errors
oli-obk Mar 8, 2024
b66d7f5
Update books
rustbot Mar 11, 2024
779ac69
Update Windows platform support
ChrisDenton Mar 10, 2024
aeec0d1
Update /NODEFAUTLIB comment for msvc
ChrisDenton Mar 11, 2024
2a1d4dd
Don't ICE when non-self part of trait goal is constrained in new solver
compiler-errors Mar 11, 2024
0b6b330
Move project -> normalize, move normalize tests
compiler-errors Mar 11, 2024
f614eae
Remove some unnecessary allow(incomplete_features)
compiler-errors Mar 11, 2024
ba70528
updating variable names in CHECK
Kirandevraj Mar 11, 2024
60ab300
Rollup merge of #115141 - ChrisDenton:windows-support, r=wesleywiser
matthiaskrgr Mar 12, 2024
b4cbc88
Rollup merge of #121865 - Kirandevraj:unnamed-fields-filecheck, r=oli…
matthiaskrgr Mar 12, 2024
60f4b7a
Rollup merge of #122000 - erer1243:issue-121868, r=nikic
matthiaskrgr Mar 12, 2024
0b127d8
Rollup merge of #122194 - oli-obk:stash_delay_bug, r=nnethercote
matthiaskrgr Mar 12, 2024
cd2efff
Rollup merge of #122319 - compiler-errors:next-solver-normalizing-sel…
matthiaskrgr Mar 12, 2024
3d5d839
Rollup merge of #122339 - rustbot:docs-update, r=ehuss
matthiaskrgr Mar 12, 2024
7b29381
Rollup merge of #122342 - ChrisDenton:defautlib, r=petrochenkov
matthiaskrgr Mar 12, 2024
39e0076
Rollup merge of #122343 - compiler-errors:rando, r=fmease
matthiaskrgr Mar 12, 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
21 changes: 20 additions & 1 deletion tests/mir-opt/unnamed-fields/field_access.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// skip-filecheck
// Tests the correct handling of unnamed fields within structs and unions marked with #[repr(C)].

// EMIT_MIR field_access.foo.SimplifyCfg-initial.after.mir
// EMIT_MIR field_access.bar.SimplifyCfg-initial.after.mir

Expand Down Expand Up @@ -36,18 +37,36 @@ union Bar {

fn access<T>(_: T) {}

// CHECK-LABEL: fn foo(
fn foo(foo: Foo) {
// CHECK [[a:_.*]] = (_1.0: u8);
// CHECK _.* = access::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
access(foo.a);
// CHECK [[b:_.*]] = ((_1.1: Foo::{anon_adt#0}).0: i8);
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
access(foo.b);
// CHECK [[c:_.*]] = ((_1.1: Foo::{anon_adt#0}).1: bool);
// CHECK _.* = access::<bool>(move [[c]]) -> [return: bb3, unwind: bb5];
access(foo.c);
// CHECK [[d:_.*]] = (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]);
// CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5];
access(foo.d);
}

// CHECK-LABEL: fn bar(
fn bar(bar: Bar) {
unsafe {
// CHECK [[a:_.*]] = (_1.0: u8);
// CHECK _.* = access::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
access(bar.a);
// CHECK [[b:_.*]] = ((_1.1: Bar::{anon_adt#0}).0: i8);
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
access(bar.b);
// CHECK [[c:_.*]] = ((_1.1: Bar::{anon_adt#0}).1: bool);
// CHECK _.* = access::<bool>(move [[c]]) -> [return: bb3, unwind: bb5];
access(bar.c);
// CHECK [[d:_.*]] = (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]);
// CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5];
access(bar.d);
}
}
Expand Down