4

Create more accurate debuginfo for vtables. by michaelwoerister · Pull Request #...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/89597
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Before this PR all vtables would have the same name ("vtable") in debuginfo. Now they get an unambiguous name that identifies the implementing type and the trait that is being implemented.

This is only one of several possible improvements:

  • This PR describes vtables as arrays of *const u8 pointers. It would nice to describe them as structs where function pointer is represented by a field with a name indicative of the method it maps to. However, this requires coming up with a naming scheme that avoids clashes between methods with the same name (which is possible if the vtable contains multiple traits).
  • The PR does not update the debuginfo we generate for the vtable-pointer field in a fat dyn pointer. Right now there does not seem to be an easy way of getting ahold of a vtable-layout without also knowing the concrete self-type of a trait object.

r? @wesleywiser


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK