lldb: Fix pretty printer for nullable-opt enums with fat pointers.

This commit is contained in:
Luqman Aden 2014-12-02 17:33:52 -05:00
parent 3a325c666d
commit 886ff4f3c3
2 changed files with 16 additions and 2 deletions

View file

@ -61,6 +61,12 @@
// lldb-command:print void_droid
// lldb-check:[...]$5 = Void
// lldb-command:print some_str
// lldb-check:[...]$6 = Some(&str { data_ptr: [...], length: 3 })
// lldb-command:print none_str
// lldb-check:[...]$7 = None
// If a struct has exactly two variants, one of them is empty, and the other one
// contains a non-nullable pointer, then this value is used as the discriminator.
@ -96,6 +102,9 @@ struct NamedFieldsRepr<'a> {
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(0x12345678u) });
let none: Option<&u32> = None;