This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rust/20171] New: rewrite rust operators in terms of traits


https://sourceware.org/bugzilla/show_bug.cgi?id=20171

            Bug ID: 20171
           Summary: rewrite rust operators in terms of traits
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: rust
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

Basic operators like + should work by looking for the appropriate trait and
making a call via the trait.

An open question in gdb terms is whether this should be integrated into the
existing operator overloading (value_x_binop and friends), or whether a
rust-specific eval branch is sufficient. Mostly this distinction would affect
the Python Value API.

This can almost be done by looking up the name using the trait namespace, e.g.,
overload::S.Add::add. However there's no way to know if this Add refers to
std::ops::Add.

There's a rustc issue for this already.

We should also implement the Deref trait, and maybe even deal with Copy.

Implementing this properly also means handling structure construction more
intelligently.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]