Skip to content

Commit 6ecaca1

Browse files
committed
Merge HasCodegen into BuilderMethods.
It has `Backend` and `Deref` boudns, plus an associated type `CodegenCx`, and it has a single use. This commit "inlines" it into `BuilderMethods`, which makes the complicated backend trait situation a little simpler.
1 parent ec1545d commit 6ecaca1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/builder.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use rustc_codegen_ssa::common::{
1414
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
1515
use rustc_codegen_ssa::mir::place::PlaceRef;
1616
use rustc_codegen_ssa::traits::{
17-
BackendTypes, BaseTypeMethods, BuilderMethods, ConstMethods, HasCodegen, LayoutTypeMethods,
18-
OverflowOp, StaticBuilderMethods,
17+
BackendTypes, BaseTypeMethods, BuilderMethods, ConstMethods, LayoutTypeMethods, OverflowOp,
18+
StaticBuilderMethods,
1919
};
2020
use rustc_codegen_ssa::MemFlags;
2121
use rustc_data_structures::fx::FxHashSet;
@@ -460,10 +460,6 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
460460
}
461461
}
462462

463-
impl<'gcc, 'tcx> HasCodegen<'tcx> for Builder<'_, 'gcc, 'tcx> {
464-
type CodegenCx = CodegenCx<'gcc, 'tcx>;
465-
}
466-
467463
impl<'tcx> HasTyCtxt<'tcx> for Builder<'_, '_, 'tcx> {
468464
fn tcx(&self) -> TyCtxt<'tcx> {
469465
self.cx.tcx()
@@ -531,6 +527,8 @@ fn set_rvalue_location<'a, 'gcc, 'tcx>(
531527
}
532528

533529
impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
530+
type CodegenCx = CodegenCx<'gcc, 'tcx>;
531+
534532
fn build(cx: &'a CodegenCx<'gcc, 'tcx>, block: Block<'gcc>) -> Builder<'a, 'gcc, 'tcx> {
535533
Builder::with_cx(cx, block)
536534
}

0 commit comments

Comments
 (0)