diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/debuginfo/unsized.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/debuginfo/unsized.rs')
-rw-r--r-- | src/test/debuginfo/unsized.rs | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/test/debuginfo/unsized.rs b/src/test/debuginfo/unsized.rs deleted file mode 100644 index b1ec9b068..000000000 --- a/src/test/debuginfo/unsized.rs +++ /dev/null @@ -1,93 +0,0 @@ -// compile-flags:-g - -// === GDB TESTS =================================================================================== - -// gdb-command:run - -// gdb-command:print a -// gdbg-check:$1 = {data_ptr = [...], length = 4} -// gdbr-check:$1 = &unsized::Foo<[u8]> {data_ptr: [...], length: 4} - -// gdb-command:print b -// gdbg-check:$2 = {data_ptr = [...], length = 4} -// gdbr-check:$2 = &unsized::Foo<unsized::Foo<[u8]>> {data_ptr: [...], length: 4} - -// gdb-command:print c -// gdbg-check:$3 = {pointer = [...], vtable = [...]} -// gdbr-check:$3 = &unsized::Foo<dyn core::fmt::Debug> {pointer: [...], vtable: [...]} - -// gdb-command:print _box -// gdbg-check:$4 = {pointer = [...], vtable = [...]} -// gdbr-check:$4 = alloc::boxed::Box<unsized::Foo<dyn core::fmt::Debug>, alloc::alloc::Global> {pointer: [...], vtable: [...]} - -// gdb-command:print tuple_slice -// gdbg-check:$5 = {data_ptr = [...], length = 2} -// gdbr-check:$5 = &(i32, i32, [i32]) {data_ptr: [...], length: 2} - -// gdb-command:print tuple_dyn -// gdbg-check:$6 = {pointer = [...], vtable = [...]} -// gdbr-check:$6 = &(i32, i32, dyn core::fmt::Debug) {pointer: [...], vtable: [...]} - -// === CDB TESTS =================================================================================== - -// cdb-command: g -// cdb-command:dx a -// cdb-check:a [Type: ref$<unsized::Foo<slice2$<u8> > >] -// cdb-check: [+0x000] data_ptr : 0x[...] [Type: unsized::Foo<slice2$<u8> > *] -// cdb-check: [...] length : 0x4 [Type: unsigned [...]int[...] - -// cdb-command:dx b -// cdb-check:b [Type: ref$<unsized::Foo<unsized::Foo<slice2$<u8> > > >] -// cdb-check: [+0x000] data_ptr : 0x[...] [Type: unsized::Foo<unsized::Foo<slice2$<u8> > > *] -// cdb-check: [...] length : 0x4 [Type: unsigned [...]int[...] - -// cdb-command:dx c -// cdb-check:c [Type: ref$<unsized::Foo<dyn$<core::fmt::Debug> > >] -// cdb-check: [+0x000] pointer : 0x[...] [Type: unsized::Foo<dyn$<core::fmt::Debug> > *] -// cdb-check: [...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[3]] - -// cdb-command:dx _box -// cdb-check: -// cdb-check:_box [Type: alloc::boxed::Box<unsized::Foo<dyn$<core::fmt::Debug> >,alloc::alloc::Global>] -// cdb-check:[+0x000] pointer : 0x[...] [Type: unsized::Foo<dyn$<core::fmt::Debug> > *] -// cdb-check:[...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[3]] - -// cdb-command:dx tuple_slice -// cdb-check:tuple_slice [Type: ref$<tuple$<i32,i32,slice2$<i32> > >] -// cdb-check: [+0x000] data_ptr : 0x[...] [Type: tuple$<i32,i32,slice2$<i32> > *] -// cdb-check: [...] length : 0x2 [Type: unsigned [...]int[...] - -// cdb-command:dx tuple_dyn -// cdb-check:tuple_dyn [Type: ref$<tuple$<i32,i32,dyn$<core::fmt::Debug> > >] -// cdb-check: [+0x000] pointer : 0x[...] [Type: tuple$<i32,i32,dyn$<core::fmt::Debug> > *] -// cdb-check: [...] vtable : 0x[...] [Type: unsigned [...]int[...] (*)[3]] - -#![feature(unsized_tuple_coercion)] -#![feature(omit_gdb_pretty_printer_section)] -#![omit_gdb_pretty_printer_section] - -struct Foo<T: ?Sized> { - value: T, -} - -fn main() { - let foo: Foo<Foo<[u8; 4]>> = Foo { value: Foo { value: *b"abc\0" } }; - - // We expect `a`, `b`, and `c` to all be fat pointers. - // `a` and `b` should be slice-like and thus have a `data_ptr` and `length` field. - // `c` should be trait-object-like and thus have a `pointer` and `vtable` field. - let a: &Foo<[u8]> = &foo.value; - let b: &Foo<Foo<[u8]>> = &foo; - let c: &Foo<dyn std::fmt::Debug> = &Foo { value: 7i32 }; - let _box: Box<Foo<dyn std::fmt::Debug>> = Box::new(Foo { value: 8i32 }); - - // Also check unsized tuples - let tuple_slice: &(i32, i32, [i32]) = &(0, 1, [2, 3]); - let tuple_dyn: &(i32, i32, dyn std::fmt::Debug) = &(0, 1, &3u64); - - zzz(); // #break -} - -fn zzz() { - () -} |