This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug rust/20171] New: rewrite rust operators in terms of traits
- From: "tromey at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 27 May 2016 20:48:39 +0000
- Subject: [Bug rust/20171] New: rewrite rust operators in terms of traits
- Auto-submitted: auto-generated
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.