Replace some Option<Span> with Span and use DUMMY_SP instead of None
This commit is contained in:
@@ -145,7 +145,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
// malloc some memory of suitable size and align:
|
||||
let exchange_malloc = Operand::function_handle(
|
||||
tcx,
|
||||
tcx.require_lang_item(LangItem::ExchangeMalloc, Some(expr_span)),
|
||||
tcx.require_lang_item(LangItem::ExchangeMalloc, expr_span),
|
||||
[],
|
||||
expr_span,
|
||||
);
|
||||
|
||||
@@ -307,7 +307,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
} else if this.infcx.type_is_use_cloned_modulo_regions(this.param_env, ty) {
|
||||
// Convert `expr.use` to a call like `Clone::clone(&expr)`
|
||||
let success = this.cfg.start_new_block();
|
||||
let clone_trait = this.tcx.require_lang_item(LangItem::Clone, None);
|
||||
let clone_trait = this.tcx.require_lang_item(LangItem::Clone, span);
|
||||
let clone_fn = this.tcx.associated_item_def_ids(clone_trait)[0];
|
||||
let func = Operand::function_handle(this.tcx, clone_fn, [ty.into()], expr_span);
|
||||
let ref_ty = Ty::new_imm_ref(this.tcx, this.tcx.lifetimes.re_erased, ty);
|
||||
|
||||
@@ -364,7 +364,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
let borrow_kind = super::util::ref_pat_borrow_kind(mutability);
|
||||
let source_info = self.source_info(span);
|
||||
let re_erased = self.tcx.lifetimes.re_erased;
|
||||
let trait_item = self.tcx.require_lang_item(trait_item, None);
|
||||
let trait_item = self.tcx.require_lang_item(trait_item, span);
|
||||
let method = trait_method(self.tcx, trait_item, method, [ty]);
|
||||
let ref_src = self.temp(Ty::new_ref(self.tcx, re_erased, ty, mutability), span);
|
||||
// `let ref_src = &src_place;`
|
||||
@@ -437,7 +437,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
val: Operand<'tcx>,
|
||||
) {
|
||||
let str_ty = self.tcx.types.str_;
|
||||
let eq_def_id = self.tcx.require_lang_item(LangItem::PartialEq, Some(source_info.span));
|
||||
let eq_def_id = self.tcx.require_lang_item(LangItem::PartialEq, source_info.span);
|
||||
let method = trait_method(self.tcx, eq_def_id, sym::eq, [str_ty, str_ty]);
|
||||
|
||||
let bool_ty = self.tcx.types.bool;
|
||||
|
||||
Reference in New Issue
Block a user