-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_codegen_ssa: streamline interactions between Builder's and CodegenCx, layout, etc. #56122
Comments
eddyb
added
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
A-codegen
Area: Code generation
labels
Nov 21, 2018
I tried to add (The end of the first line is a reproducable glitch error[E0391]: cycle detected when computing the supertraits of `traits::HasCodegen`tc_codegen_ssa
--> src/librustc_codegen_ssa/traits/mod.rs:88:1
|
88 | pub trait HasCodegen<'tcx>: Backend<'tcx> + ::std::ops::Deref<Target = Self::CodegenCx> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which again requires computing the supertraits of `traits::HasCodegen`, completing the cycle
note: cycle used when computing the supertraits of `traits::type_::ArgTypeMethods`
--> src/librustc_codegen_ssa/traits/type_.rs:186:33
|
186| pub trait ArgTypeMethods<'tcx>: HasCodegen<'tcx> {
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error |
I think it's because of |
That fixes it! Thanks. |
Fixed in #56198. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice if
Builder
deref'd toCodegenCx
to avoid typingbx.cx()
everywhere.Also, since
Builder
now has to implement all the layout traits itself, we could start writing e.g.layout.field(bx, i)
instead oflayout.field(bx.cx(), i)
.There are probably a few more ergonomics / cleanup things we could do here as well.
cc @nikomatsakis @sunfishcode @denismerigoux @bjorn3
The text was updated successfully, but these errors were encountered: