Closed kazimuth closed 7 years ago
Thanks so much for doing this!
I just tried to compile it on my machine, and I got the following error:
error: no method named `visit_all_items` found for type `&rustc::hir::Crate` in the current scope
--> src/trans.rs:100:21
|
100 | tcx.map.krate().visit_all_items(v);
| ^^^^^^^^^^^^^^^
error: aborting due to previous error
I assume this is related to the new HIR visiting framework? Looking at the page you linked, it seems like we're likely to need the full nested visit, but we might be able to get away with a deep visit.
For the emit_assign_fields
issue, also suspect it still does the right thing. I think the best thing to do here would be to see if the tests still pass. I think the tests are in a bit of a broken state right now (I have a PR in-progress to fix this), so I'd be fine with taking your change without the tests passing and we can fix it later.
That is,
1.16.0-nightly (1a2ed98d3 2017-01-13)
.This was mostly simple mechanical changes; rustc sure likes to tweak its accessors.
I left TODOs where I'm not sure about the changes. Specifically:
ty::layout::Struct
switched from having a vector of offset-after-fields to offset-of-fields. That is, for a struct with twou32
s, it used to contain[4, 8]
, but now contains[0, 4]
... I think. I'm not sureemit_assign_fields
still works correctly when passed a new vector of offsets.If I can get feedback on how to fix those I can make the changes and get the tests actually running.
Also, keep in mind that I'm not really a compiler person, just somebody who thinks this is a cool project, so I may have made other glaring mistakes.