Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 85a4d2a

Browse files
committed
Tweak and explain the BuilderMethods/CodegenMethods connection.
1 parent 108f8c8 commit 85a4d2a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_codegen_ssa/src/traits/builder.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use super::debuginfo::DebugInfoBuilderMethods;
1717
use super::intrinsic::IntrinsicCallBuilderMethods;
1818
use super::misc::MiscMethods;
1919
use super::type_::{ArgAbiBuilderMethods, BaseTypeMethods, LayoutTypeMethods};
20-
use super::{BackendTypes, CodegenMethods, StaticBuilderMethods};
20+
use super::{CodegenMethods, StaticBuilderMethods};
2121
use crate::common::{
2222
AtomicOrdering, AtomicRmwBinOp, IntPredicate, RealPredicate, SynchronizationScope, TypeKind,
2323
};
@@ -45,8 +45,11 @@ pub trait BuilderMethods<'a, 'tcx>:
4545
+ AsmBuilderMethods<'tcx>
4646
+ StaticBuilderMethods
4747
{
48-
type CodegenCx: CodegenMethods<'tcx>
49-
+ BackendTypes<
48+
// `BackendTypes` is a supertrait of both `CodegenMethods` and
49+
// `BuilderMethods`. This bound ensures all impls agree on the associated
50+
// types within.
51+
type CodegenCx: CodegenMethods<
52+
'tcx,
5053
Value = Self::Value,
5154
Function = Self::Function,
5255
BasicBlock = Self::BasicBlock,

0 commit comments

Comments
 (0)