Skip to content

Commit 135a98f

Browse files
committed
update code generation
1 parent ffeec17 commit 135a98f

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
6464
err
6565
);
6666
}
67-
ErrorHandled::Silent => {
67+
ErrorHandled::Silent(_) => {
6868
span_bug!(
6969
constant.span,
7070
"codegen encountered silent error",

compiler/rustc_codegen_gcc/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub fn const_alloc_to_gcc<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, alloc: &Alloca
334334
cx.const_struct(&llvals, true)
335335
}
336336

337-
pub fn codegen_static_initializer<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, def_id: DefId) -> Result<(RValue<'gcc>, &'tcx Allocation), ErrorHandled> {
337+
pub fn codegen_static_initializer<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, def_id: DefId) -> Result<(RValue<'gcc>, &'tcx Allocation), ErrorHandled<'tcx>> {
338338
let alloc = cx.tcx.eval_static_initializer(def_id)?;
339339
Ok((const_alloc_to_gcc(cx, alloc), alloc))
340340
}

compiler/rustc_codegen_llvm/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn const_alloc_to_llvm<'ll>(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) ->
130130
pub fn codegen_static_initializer<'ll, 'tcx>(
131131
cx: &CodegenCx<'ll, 'tcx>,
132132
def_id: DefId,
133-
) -> Result<(&'ll Value, &'tcx Allocation), ErrorHandled> {
133+
) -> Result<(&'ll Value, &'tcx Allocation), ErrorHandled<'tcx>> {
134134
let alloc = cx.tcx.eval_static_initializer(def_id)?;
135135
Ok((const_alloc_to_llvm(cx, alloc), alloc))
136136
}

compiler/rustc_codegen_ssa/src/mir/constant.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1414
&self,
1515
bx: &mut Bx,
1616
constant: &mir::Constant<'tcx>,
17-
) -> Result<OperandRef<'tcx, Bx::Value>, ErrorHandled> {
17+
) -> Result<OperandRef<'tcx, Bx::Value>, ErrorHandled<'tcx>> {
1818
let val = self.eval_mir_constant(constant)?;
1919
let ty = self.monomorphize(constant.ty());
2020
Ok(OperandRef::from_const(bx, val, ty))
@@ -23,7 +23,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
2323
pub fn eval_mir_constant(
2424
&self,
2525
constant: &mir::Constant<'tcx>,
26-
) -> Result<ConstValue<'tcx>, ErrorHandled> {
26+
) -> Result<ConstValue<'tcx>, ErrorHandled<'tcx>> {
2727
let ct = self.monomorphize(constant.literal);
2828
let ct = match ct {
2929
mir::ConstantKind::Ty(ct) => ct,
@@ -53,7 +53,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
5353
bx: &Bx,
5454
span: Span,
5555
ty: Ty<'tcx>,
56-
constant: Result<ConstValue<'tcx>, ErrorHandled>,
56+
constant: Result<ConstValue<'tcx>, ErrorHandled<'tcx>>,
5757
) -> (Bx::Value, Ty<'tcx>) {
5858
constant
5959
.map(|val| {

compiler/rustc_codegen_ssa/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
191191
ErrorHandled::TooGeneric => {
192192
span_bug!(const_.span, "codegen encountered polymorphic constant: {:?}", err)
193193
}
194-
ErrorHandled::Silent => {
194+
ErrorHandled::Silent(_) => {
195195
span_bug!(const_.span, "silent error during codegen")
196196
}
197197
}

0 commit comments

Comments
 (0)