Stream: t-compiler/help

Topic: Resolver tree?


Joshua Nelson (Jun 05 2020 at 23:24, on Zulip):

In https://github.com/rust-lang/rust/issues/65983#issuecomment-638352731, @Manish Goregaokar mentioned a 'resolver tree' in rustc_resolve. Does anyone know what that is? I see a Resolver that implements DefIdTree, is that it?

There was also something about 'self-referential arena's which I don't quite understand - is this arenas like the memory allocation strategy? What makes those self-referential?

Joshua Nelson (Jun 05 2020 at 23:25, on Zulip):

Partially related - how do I serialize a rustc data structure? I assume it's not as simple as derive(rustc_serialize::Serialize)?

Manish Goregaokar (Jun 05 2020 at 23:25, on Zulip):

https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/struct.ModuleData.html

Manish Goregaokar (Jun 05 2020 at 23:26, on Zulip):

No the whole issue here is that all the resolution information is stored in an arena, it's not something that's easy to serialize. We need to convert it to a datastructure that _is_ easy to serialize and query, one that _just_ has the list of resolutions for a given module defid.

Joshua Nelson (Jun 05 2020 at 23:28, on Zulip):

Ok, and arenas are self-referential because they use indices instead of the data itself?

Joshua Nelson (Jun 05 2020 at 23:33, on Zulip):

What's the trait I need to implement?

Joshua Nelson (Jun 05 2020 at 23:33, on Zulip):

looks like Decodable and Encodable

Joshua Nelson (Jun 05 2020 at 23:38, on Zulip):

I can't even import rustc_serialize :(

error[E0463]: can't find crate for `rustc_serialize`
  --> src/librustc_resolve/lib.rs:56:1
   |
56 | extern crate rustc_serialize;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
Last update: Sep 28 2020 at 16:30UTC