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 #129841

Merged
merged 20 commits into from
Sep 1, 2024
Merged
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
88fda58
core: use `compare_bytes` for more slice element types
joboet Aug 1, 2024
32d6d0e
bless miri tests
joboet Aug 1, 2024
341511a
refactor: standardize duplicate processes in parser
Konippi Aug 4, 2024
8301dd4
core: make documentation clearer, rename slice comparison specializat…
joboet Aug 12, 2024
1a2ec26
Make option-like-enum.rs UB-free and portable
saethlin Aug 27, 2024
ea6df5c
Update stacker to 0.1.17
sunshowers Aug 26, 2024
fff063e
add crashtests for several old unfixed ICEs
cyrgani Aug 30, 2024
5d04472
Implement `elided_named_lifetimes` lint
GrigorenkoPV Aug 15, 2024
f7b0b22
Fix `elided_named_lifetimes` in code
GrigorenkoPV Aug 17, 2024
a9b959a
elided_named_lifetimes: bless & add tests
GrigorenkoPV Aug 31, 2024
d4e708f
Remove stray dot in `std::char::from_u32_unchecked` documentation
eduardosm Aug 31, 2024
f68f665
Create opaque definitions in resolver.
cjgillot Aug 24, 2024
a073004
Rollup merge of #128495 - joboet:more_memcmp, r=scottmcm
matthiaskrgr Sep 1, 2024
da65b90
Rollup merge of #128641 - Konippi:standardize-duplicate-processes-in-…
matthiaskrgr Sep 1, 2024
1063c0d
Rollup merge of #129207 - GrigorenkoPV:elided-is-named, r=cjgillot
matthiaskrgr Sep 1, 2024
07d5c25
Rollup merge of #129493 - cjgillot:early-opaque-def, r=petrochenkov
matthiaskrgr Sep 1, 2024
62b8fdb
Rollup merge of #129619 - sunshowers:update-stacker, r=Mark-Simulacrum
matthiaskrgr Sep 1, 2024
d24336b
Rollup merge of #129672 - saethlin:enum-debuginfo-tests, r=Mark-Simul…
matthiaskrgr Sep 1, 2024
f040e68
Rollup merge of #129780 - cyrgani:master, r=compiler-errors
matthiaskrgr Sep 1, 2024
2261ffa
Rollup merge of #129832 - eduardosm:stray-dot, r=jhpratt
matthiaskrgr Sep 1, 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
39 changes: 14 additions & 25 deletions tests/debuginfo/option-like-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
// gdb-command:run

// gdb-command:print some
// gdb-check:$1 = core::option::Option<&u32>::Some(0x12345678)
// gdb-check:$1 = core::option::Option<&u32>::Some(0x[...])

// gdb-command:print none
// gdb-check:$2 = core::option::Option<&u32>::None

// gdb-command:print full
// gdb-check:$3 = option_like_enum::MoreFields::Full(454545, 0x87654321, 9988)
// gdb-check:$3 = option_like_enum::MoreFields::Full(454545, 0x[...], 9988)

// gdb-command:print empty_gdb.discr
// gdb-check:$4 = (*mut isize) 0x1
// gdb-command:print empty
// gdb-check:$4 = option_like_enum::MoreFields::Empty

// gdb-command:print droid
// gdb-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x43218765}
// gdb-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x[...]}

// gdb-command:print void_droid_gdb.internals
// gdb-check:$6 = (*mut isize) 0x1
// gdb-command:print void_droid
// gdb-check:$6 = option_like_enum::NamedFields::Void

// gdb-command:print nested_non_zero_yep
// gdb-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...]})
Expand All @@ -39,19 +39,19 @@
// lldb-command:run

// lldb-command:v some
// lldb-check:[...] Some(&0x12345678)
// lldb-check:[...] Some(&0x[...])

// lldb-command:v none
// lldb-check:[...] None

// lldb-command:v full
// lldb-check:[...] Full(454545, &0x87654321, 9988)
// lldb-check:[...] Full(454545, &0x[...], 9988)

// lldb-command:v empty
// lldb-check:[...] Empty

// lldb-command:v droid
// lldb-check:[...] Droid { id: 675675, range: 10000001, internals: &0x43218765 }
// lldb-check:[...] Droid { id: 675675, range: 10000001, internals: &0x[...] }

// lldb-command:v void_droid
// lldb-check:[...] Void
Expand All @@ -76,11 +76,6 @@
// contains a non-nullable pointer, then this value is used as the discriminator.
// The test cases in this file make sure that something readable is generated for
// this kind of types.
// If the non-empty variant contains a single non-nullable pointer than the whole
// item is represented as just a pointer and not wrapped in a struct.
// Unfortunately (for these test cases) the content of the non-discriminant fields
// in the null-case is not defined. So we just read the discriminator field in
// this case (by casting the value to a memory-equivalent struct).

enum MoreFields<'a> {
Full(u32, &'a isize, i16),
Expand Down Expand Up @@ -120,32 +115,26 @@ fn main() {
let some_str: Option<&'static str> = Some("abc");
let none_str: Option<&'static str> = None;

let some: Option<&u32> = Some(unsafe { std::mem::transmute(0x12345678_usize) });
let some: Option<&u32> = Some(&1234);
let none: Option<&u32> = None;

let full = MoreFields::Full(454545, unsafe { std::mem::transmute(0x87654321_usize) }, 9988);

let full = MoreFields::Full(454545, &1234, 9988);
let empty = MoreFields::Empty;
let empty_gdb: &MoreFieldsRepr = unsafe { std::mem::transmute(&MoreFields::Empty) };

let droid = NamedFields::Droid {
id: 675675,
range: 10000001,
internals: unsafe { std::mem::transmute(0x43218765_usize) }
internals: &1234,
};

let void_droid = NamedFields::Void;
let void_droid_gdb: &NamedFieldsRepr = unsafe { std::mem::transmute(&NamedFields::Void) };

let x = 'x';
let nested_non_zero_yep = NestedNonZero::Yep(
10.5,
NestedNonZeroField {
a: 10,
b: 20,
c: &x
c: &'x',
});

let nested_non_zero_nope = NestedNonZero::Nope;

zzz(); // #break
Expand Down