Skip to content

Commit fd3da4b

Browse files
committed
Replace some Option<Span> with Span and use DUMMY_SP instead of None
1 parent 81a964c commit fd3da4b

File tree

77 files changed

+250
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+250
-250
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
732732
span: Span,
733733
args: Option<&'hir hir::GenericArgs<'hir>>,
734734
) -> &'hir hir::Path<'hir> {
735-
let def_id = self.tcx.require_lang_item(lang_item, Some(span));
735+
let def_id = self.tcx.require_lang_item(lang_item, span);
736736
let def_kind = self.tcx.def_kind(def_id);
737737
let res = Res::Def(def_kind, def_id);
738738
self.arena.alloc(hir::Path {

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
263263
// something that already has `Fn`-like bounds (or is a closure), so we can't
264264
// restrict anyways.
265265
} else {
266-
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, Some(span));
266+
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, span);
267267
self.suggest_adding_bounds(&mut err, ty, copy_did, span);
268268
}
269269

@@ -1915,7 +1915,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
19151915

19161916
let local_ty = self.body.local_decls[place.local].ty;
19171917
let typeck_results = tcx.typeck(self.mir_def_id());
1918-
let clone = tcx.require_lang_item(LangItem::Clone, Some(body.span));
1918+
let clone = tcx.require_lang_item(LangItem::Clone, body.span);
19191919
for expr in expr_finder.clones {
19201920
if let hir::ExprKind::MethodCall(_, rcvr, _, span) = expr.kind
19211921
&& let Some(rcvr_ty) = typeck_results.node_type_opt(rcvr.hir_id)

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
688688
if !self.unsized_feature_enabled() {
689689
let trait_ref = ty::TraitRef::new(
690690
tcx,
691-
tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
691+
tcx.require_lang_item(LangItem::Sized, self.last_span),
692692
[place_ty],
693693
);
694694
self.prove_trait_ref(
@@ -1010,7 +1010,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10101010
let ty = place.ty(self.body, tcx).ty;
10111011
let trait_ref = ty::TraitRef::new(
10121012
tcx,
1013-
tcx.require_lang_item(LangItem::Copy, Some(span)),
1013+
tcx.require_lang_item(LangItem::Copy, span),
10141014
[ty],
10151015
);
10161016

@@ -1025,11 +1025,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10251025
}
10261026

10271027
&Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => {
1028-
let trait_ref = ty::TraitRef::new(
1029-
tcx,
1030-
tcx.require_lang_item(LangItem::Sized, Some(span)),
1031-
[ty],
1032-
);
1028+
let trait_ref =
1029+
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [ty]);
10331030

10341031
self.prove_trait_ref(
10351032
trait_ref,
@@ -1041,11 +1038,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
10411038
&Rvalue::NullaryOp(NullOp::UbChecks, _) => {}
10421039

10431040
Rvalue::ShallowInitBox(_operand, ty) => {
1044-
let trait_ref = ty::TraitRef::new(
1045-
tcx,
1046-
tcx.require_lang_item(LangItem::Sized, Some(span)),
1047-
[*ty],
1048-
);
1041+
let trait_ref =
1042+
ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [*ty]);
10491043

10501044
self.prove_trait_ref(
10511045
trait_ref,
@@ -1222,7 +1216,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
12221216
let &ty = ty;
12231217
let trait_ref = ty::TraitRef::new(
12241218
tcx,
1225-
tcx.require_lang_item(LangItem::CoerceUnsized, Some(span)),
1219+
tcx.require_lang_item(LangItem::CoerceUnsized, span),
12261220
[op.ty(self.body, tcx), ty],
12271221
);
12281222

@@ -1811,7 +1805,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
18111805
if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context {
18121806
let trait_ref = ty::TraitRef::new(
18131807
tcx,
1814-
tcx.require_lang_item(LangItem::Copy, Some(self.last_span)),
1808+
tcx.require_lang_item(LangItem::Copy, self.last_span),
18151809
[place_ty.ty],
18161810
);
18171811

compiler/rustc_borrowck/src/universal_regions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,10 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
544544
// (as it's created inside the body itself, not passed in from outside).
545545
if let DefiningTy::FnDef(def_id, _) = defining_ty {
546546
if self.infcx.tcx.fn_sig(def_id).skip_binder().c_variadic() {
547-
let va_list_did = self.infcx.tcx.require_lang_item(
548-
LangItem::VaList,
549-
Some(self.infcx.tcx.def_span(self.mir_def)),
550-
);
547+
let va_list_did = self
548+
.infcx
549+
.tcx
550+
.require_lang_item(LangItem::VaList, self.infcx.tcx.def_span(self.mir_def));
551551

552552
let reg_vid = self
553553
.infcx

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
380380
rustc_hir::LangItem::PanicBoundsCheck,
381381
&[index, len, location],
382382
*unwind,
383-
Some(source_info.span),
383+
source_info.span,
384384
);
385385
}
386386
AssertKind::MisalignedPointerDereference { ref required, ref found } => {
@@ -393,7 +393,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
393393
rustc_hir::LangItem::PanicMisalignedPointerDereference,
394394
&[required, found, location],
395395
*unwind,
396-
Some(source_info.span),
396+
source_info.span,
397397
);
398398
}
399399
AssertKind::NullPointerDereference => {
@@ -404,7 +404,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
404404
rustc_hir::LangItem::PanicNullPointerDereference,
405405
&[location],
406406
*unwind,
407-
Some(source_info.span),
407+
source_info.span,
408408
)
409409
}
410410
_ => {
@@ -415,7 +415,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
415415
msg.panic_function(),
416416
&[location],
417417
*unwind,
418-
Some(source_info.span),
418+
source_info.span,
419419
);
420420
}
421421
}
@@ -531,7 +531,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
531531
);
532532
}
533533
TerminatorKind::UnwindTerminate(reason) => {
534-
codegen_unwind_terminate(fx, Some(source_info.span), *reason);
534+
codegen_unwind_terminate(fx, source_info.span, *reason);
535535
}
536536
TerminatorKind::UnwindResume => {
537537
// FIXME implement unwinding
@@ -1074,7 +1074,7 @@ pub(crate) fn codegen_operand<'tcx>(
10741074
pub(crate) fn codegen_panic_nounwind<'tcx>(
10751075
fx: &mut FunctionCx<'_, '_, 'tcx>,
10761076
msg_str: &str,
1077-
span: Option<Span>,
1077+
span: Span,
10781078
) {
10791079
let msg_ptr = fx.anonymous_str(msg_str);
10801080
let msg_len = fx.bcx.ins().iconst(fx.pointer_type, i64::try_from(msg_str.len()).unwrap());
@@ -1091,7 +1091,7 @@ pub(crate) fn codegen_panic_nounwind<'tcx>(
10911091

10921092
pub(crate) fn codegen_unwind_terminate<'tcx>(
10931093
fx: &mut FunctionCx<'_, '_, 'tcx>,
1094-
span: Option<Span>,
1094+
span: Span,
10951095
reason: UnwindTerminateReason,
10961096
) {
10971097
codegen_panic_inner(fx, reason.lang_item(), &[], UnwindAction::Unreachable, span);
@@ -1102,7 +1102,7 @@ fn codegen_panic_inner<'tcx>(
11021102
lang_item: rustc_hir::LangItem,
11031103
args: &[Value],
11041104
_unwind: UnwindAction,
1105-
span: Option<Span>,
1105+
span: Span,
11061106
) {
11071107
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
11081108

compiler/rustc_codegen_cranelift/src/intrinsics/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub(crate) fn codegen_llvm_intrinsic_call<'tcx>(
7171
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
7272
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
7373
);
74-
crate::base::codegen_panic_nounwind(fx, &msg, None);
74+
crate::base::codegen_panic_nounwind(fx, &msg, span);
7575
return;
7676
}
7777
}

compiler/rustc_codegen_cranelift/src/intrinsics/llvm_aarch64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ pub(super) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
512512
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
513513
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
514514
);
515-
crate::base::codegen_panic_nounwind(fx, &msg, None);
515+
crate::base::codegen_panic_nounwind(fx, &msg, fx.mir.span);
516516
return;
517517
}
518518
}

compiler/rustc_codegen_cranelift/src/intrinsics/llvm_x86.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
13211321
See https://github.com/rust-lang/rustc_codegen_cranelift/issues/171\n\
13221322
Please open an issue at https://github.com/rust-lang/rustc_codegen_cranelift/issues"
13231323
);
1324-
crate::base::codegen_panic_nounwind(fx, &msg, None);
1324+
crate::base::codegen_panic_nounwind(fx, &msg, span);
13251325
return;
13261326
}
13271327
}

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
785785
}
786786
})
787787
});
788-
crate::base::codegen_panic_nounwind(fx, &msg_str, Some(source_info.span));
788+
crate::base::codegen_panic_nounwind(fx, &msg_str, source_info.span);
789789
return Ok(());
790790
}
791791
}
@@ -884,7 +884,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
884884
crate::base::codegen_panic_nounwind(
885885
fx,
886886
"128bit atomics not yet supported",
887-
None,
887+
source_info.span,
888888
);
889889
return Ok(());
890890
} else {
@@ -919,7 +919,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
919919
crate::base::codegen_panic_nounwind(
920920
fx,
921921
"128bit atomics not yet supported",
922-
None,
922+
source_info.span,
923923
);
924924
return Ok(());
925925
} else {

compiler/rustc_codegen_cranelift/src/main_shim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) fn maybe_create_entry_wrapper(
101101
let call_inst = bcx.ins().call(main_func_ref, &[]);
102102
let call_results = bcx.func.dfg.inst_results(call_inst).to_owned();
103103

104-
let termination_trait = tcx.require_lang_item(LangItem::Termination, None);
104+
let termination_trait = tcx.require_lang_item(LangItem::Termination, DUMMY_SP);
105105
let report = tcx
106106
.associated_items(termination_trait)
107107
.find_by_ident_and_kind(
@@ -136,7 +136,7 @@ pub(crate) fn maybe_create_entry_wrapper(
136136
}
137137
} else {
138138
// Regular main fn invoked via start lang item.
139-
let start_def_id = tcx.require_lang_item(LangItem::Start, None);
139+
let start_def_id = tcx.require_lang_item(LangItem::Start, DUMMY_SP);
140140
let start_instance = Instance::expect_resolve(
141141
tcx,
142142
ty::TypingEnv::fully_monomorphized(),

compiler/rustc_codegen_cranelift/src/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn codegen_three_way_compare<'tcx>(
5454
let gt = fx.bcx.ins().icmp(gt_cc, lhs, rhs);
5555
let lt = fx.bcx.ins().icmp(lt_cc, lhs, rhs);
5656
let val = fx.bcx.ins().isub(gt, lt);
57-
CValue::by_val(val, fx.layout_of(fx.tcx.ty_ordering_enum(Some(fx.mir.span))))
57+
CValue::by_val(val, fx.layout_of(fx.tcx.ty_ordering_enum(fx.mir.span)))
5858
}
5959

6060
fn codegen_compare_bin_op<'tcx>(

compiler/rustc_codegen_cranelift/src/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub(crate) fn size_and_align_of<'tcx>(
240240
})
241241
});
242242

243-
codegen_panic_nounwind(fx, &msg_str, None);
243+
codegen_panic_nounwind(fx, &msg_str, fx.mir.span);
244244

245245
fx.bcx.switch_to_block(next_block);
246246

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
561561

562562
let EntryFnType::Main { sigpipe } = entry_type;
563563
let (start_fn, start_ty, args, instance) = {
564-
let start_def_id = cx.tcx().require_lang_item(LangItem::Start, None);
564+
let start_def_id = cx.tcx().require_lang_item(LangItem::Start, DUMMY_SP);
565565
let start_instance = ty::Instance::expect_resolve(
566566
cx.tcx(),
567567
cx.typing_env(),

compiler/rustc_codegen_ssa/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mod temp_stable_hash_impls {
110110

111111
pub(crate) fn build_langcall<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
112112
bx: &Bx,
113-
span: Option<Span>,
113+
span: Span,
114114
li: LangItem,
115115
) -> (Bx::FnAbiOfResult, Bx::Value, Instance<'tcx>) {
116116
let tcx = bx.tcx();

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
783783
}
784784
};
785785

786-
let (fn_abi, llfn, instance) = common::build_langcall(bx, Some(span), lang_item);
786+
let (fn_abi, llfn, instance) = common::build_langcall(bx, span, lang_item);
787787

788788
// Codegen the actual panic invoke/call.
789789
let merging_succ =
@@ -803,7 +803,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
803803
self.set_debug_loc(bx, terminator.source_info);
804804

805805
// Obtain the panic entry point.
806-
let (fn_abi, llfn, instance) = common::build_langcall(bx, Some(span), reason.lang_item());
806+
let (fn_abi, llfn, instance) = common::build_langcall(bx, span, reason.lang_item());
807807

808808
// Codegen the actual panic invoke/call.
809809
let merging_succ = helper.do_call(
@@ -871,7 +871,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
871871

872872
// Obtain the panic entry point.
873873
let (fn_abi, llfn, instance) =
874-
common::build_langcall(bx, Some(source_info.span), LangItem::PanicNounwind);
874+
common::build_langcall(bx, source_info.span, LangItem::PanicNounwind);
875875

876876
// Codegen the actual panic invoke/call.
877877
Some(helper.do_call(
@@ -1830,7 +1830,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
18301830

18311831
self.set_debug_loc(&mut bx, mir::SourceInfo::outermost(self.mir.span));
18321832

1833-
let (fn_abi, fn_ptr, instance) = common::build_langcall(&bx, None, reason.lang_item());
1833+
let (fn_abi, fn_ptr, instance) =
1834+
common::build_langcall(&bx, self.mir.span, reason.lang_item());
18341835
if is_call_from_compiler_builtins_to_upstream_monomorphization(bx.tcx(), instance) {
18351836
bx.abort();
18361837
} else {

compiler/rustc_codegen_ssa/src/size_of_val.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustc_hir::LangItem;
55
use rustc_middle::bug;
66
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
77
use rustc_middle::ty::{self, Ty};
8+
use rustc_span::DUMMY_SP;
89
use tracing::{debug, trace};
910

1011
use crate::common::IntPredicate;
@@ -62,7 +63,7 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
6263

6364
// Obtain the panic entry point.
6465
let (fn_abi, llfn, _instance) =
65-
common::build_langcall(bx, None, LangItem::PanicNounwind);
66+
common::build_langcall(bx, DUMMY_SP, LangItem::PanicNounwind);
6667

6768
// Generate the call. Cannot use `do_call` since we don't have a MIR terminator so we
6869
// can't create a `TerminationCodegenHelper`. (But we are in good company, this code is

compiler/rustc_const_eval/src/check_consts/ops.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,7 @@ fn build_error_for_const_call<'tcx>(
345345
non_or_conditionally,
346346
});
347347

348-
note_trait_if_possible(
349-
&mut err,
350-
self_ty,
351-
tcx.require_lang_item(LangItem::Deref, Some(span)),
352-
);
348+
note_trait_if_possible(&mut err, self_ty, tcx.require_lang_item(LangItem::Deref, span));
353349
err
354350
}
355351
_ if tcx.opt_parent(callee) == tcx.get_diagnostic_item(sym::FmtArgumentsNew) => {

compiler/rustc_const_eval/src/check_consts/qualifs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl Qualif for HasMutInterior {
9999
// requires borrowck, which in turn will invoke mir_const_qualifs again, causing a cycle error.
100100
// Instead we invoke an obligation context manually, and provide the opaque type inference settings
101101
// that allow the trait solver to just error out instead of cycling.
102-
let freeze_def_id = cx.tcx.require_lang_item(LangItem::Freeze, Some(cx.body.span));
102+
let freeze_def_id = cx.tcx.require_lang_item(LangItem::Freeze, cx.body.span);
103103
// FIXME(#132279): Once we've got a typing mode which reveals opaque types using the HIR
104104
// typeck results without causing query cycles, we should use this here instead of defining
105105
// opaque types.
@@ -180,7 +180,7 @@ impl Qualif for NeedsNonConstDrop {
180180
// that the components of this type are also `~const Destruct`. This
181181
// amounts to verifying that there are no values in this ADT that may have
182182
// a non-const drop.
183-
let destruct_def_id = cx.tcx.require_lang_item(LangItem::Destruct, Some(cx.body.span));
183+
let destruct_def_id = cx.tcx.require_lang_item(LangItem::Destruct, cx.body.span);
184184
let (infcx, param_env) = cx.tcx.infer_ctxt().build_with_typing_env(cx.typing_env);
185185
let ocx = ObligationCtxt::new(&infcx);
186186
ocx.register_obligation(Obligation::new(

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl<'tcx> CompileTimeInterpCx<'tcx> {
249249
return Err(ConstEvalErrKind::Panic { msg, file, line, col }).into();
250250
} else if self.tcx.is_lang_item(def_id, LangItem::PanicFmt) {
251251
// For panic_fmt, call const_panic_fmt instead.
252-
let const_def_id = self.tcx.require_lang_item(LangItem::ConstPanicFmt, None);
252+
let const_def_id = self.tcx.require_lang_item(LangItem::ConstPanicFmt, self.tcx.span);
253253
let new_instance = ty::Instance::expect_resolve(
254254
*self.tcx,
255255
self.typing_env(),

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout};
1212
use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter};
1313
use rustc_middle::ty::{ConstInt, ScalarInt, Ty, TyCtxt};
1414
use rustc_middle::{bug, mir, span_bug, ty};
15+
use rustc_span::DUMMY_SP;
1516
use tracing::trace;
1617

1718
use super::{
@@ -307,7 +308,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
307308
#[inline]
308309
pub fn from_ordering(c: std::cmp::Ordering, tcx: TyCtxt<'tcx>) -> Self {
309310
// Can use any typing env, since `Ordering` is always monomorphic.
310-
let ty = tcx.ty_ordering_enum(None);
311+
let ty = tcx.ty_ordering_enum(DUMMY_SP);
311312
let layout =
312313
tcx.layout_of(ty::TypingEnv::fully_monomorphized().as_query_input(ty)).unwrap();
313314
Self::from_scalar(Scalar::Int(c.into()), layout)

0 commit comments

Comments
 (0)