Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Some enums not displayed properly #14

Open
tromey opened this issue Jun 13, 2018 · 0 comments
Open

Some enums not displayed properly #14

tromey opened this issue Jun 13, 2018 · 0 comments

Comments

@tromey
Copy link
Collaborator

tromey commented Jun 13, 2018

Consider the test case from rust-lang/rust#51347:

// a.rs
use std::option::Option;

enum Enum {A, B}
enum Union { A(usize), B(usize) }
enum Mixed { A(usize), B }
enum Field { A { field: usize }, B { field: usize } }

fn main() {
    let enum_a = Enum::A;
    let enum_b = Enum::B;
    let enum_some_a = Option::Some(Enum::A);
    let enum_some_b = Option::Some(Enum::B);
    let enum_none: Option<Enum> = Option::None;
    
    let union_a = Union::A(42);
    let union_b = Union::B(84);
    let union_some_a = Option::Some(Union::A(42));
    let union_some_b = Option::Some(Union::B(84));
    let union_none: Option<Union> = Option::None;

    let mixed_a = Mixed::A(42);
    let mixed_b = Mixed::B;
    let mixed_some_a = Option::Some(Mixed::A(42));
    let mixed_some_b = Option::Some(Mixed::B);
    let mixed_none: Option<Mixed> = Option::None;

    let field_a = Field::A { field: 42 };
    let field_b = Field::B { field: 84 };
    let field_some_a = Option::Some(Field::A { field: 42 });
    let field_some_b = Option::Some(Field::B { field: 84 });
    let field_none: Option<Field> = Option::None;

    let number = 42;
    let number_some = Option::Some(42);
    let number_none: Option<i32> = Option::None;

    println!("yay");
}

With the compiler patch, the debuginfo here is no longer wrong, but lldb still displays some enums incorrectly:

(lldb) fr v
(a::Enum) enum_a = a::Enum::A
(a::Enum) enum_b = a::Enum::B
(core::option::Option<a::Enum>) enum_some_a = {}
(core::option::Option<a::Enum>) enum_some_b = {}
(core::option::Option<a::Enum>) enum_none = {}
(a::Union) union_a = {}
(a::Union) union_b = {}
(core::option::Option<a::Union>) union_some_a = {}
(core::option::Option<a::Union>) union_some_b = {}
(core::option::Option<a::Union>) union_none = {}
(a::Mixed) mixed_a = {}
(a::Mixed) mixed_b = {}
(core::option::Option<a::Mixed>) mixed_some_a = {}
(core::option::Option<a::Mixed>) mixed_some_b = {}
(core::option::Option<a::Mixed>) mixed_none = {}
(a::Field) field_a = {}
(a::Field) field_b = {}
(core::option::Option<a::Field>) field_some_a = {}
(core::option::Option<a::Field>) field_some_b = {}
(core::option::Option<a::Field>) field_none = {}
(i32) number = 42
(core::option::Option<i32>) number_some = {}
(core::option::Option<i32>) number_none = {}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant