use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
-use rustc_hir::lang_items::{CoerceUnsizedTraitLangItem, CopyTraitLangItem, SizedTraitLangItem};
+use rustc_hir::lang_items::LangItem;
use rustc_index::vec::{Idx, IndexVec};
use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::infer::outlives::env::RegionBoundPairs;
if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context {
let tcx = self.tcx();
let trait_ref = ty::TraitRef {
- def_id: tcx.require_lang_item(CopyTraitLangItem, Some(self.last_span)),
+ def_id: tcx.require_lang_item(LangItem::Copy, Some(self.last_span)),
substs: tcx.mk_substs_trait(place_ty.ty, &[]),
};
PlaceTy::from_ty(match base_ty.kind {
ty::Array(inner, _) => {
assert!(!from_end, "array subslices should not use from_end");
- tcx.mk_array(inner, (to - from) as u64)
+ tcx.mk_array(inner, to - from)
}
ty::Slice(..) => {
assert!(from_end, "slice subslices should use from_end");
self.check_rvalue(body, rv, location);
if !self.tcx().features().unsized_locals {
let trait_ref = ty::TraitRef {
- def_id: tcx.require_lang_item(SizedTraitLangItem, Some(self.last_span)),
+ def_id: tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
substs: tcx.mk_substs_trait(place_ty, &[]),
};
self.prove_trait_ref(
| StatementKind::StorageDead(..)
| StatementKind::LlvmInlineAsm { .. }
| StatementKind::Retag { .. }
+ | StatementKind::Coverage(..)
| StatementKind::Nop => {}
}
}
self.param_env,
ty::Binder::bind(ty::TraitRef::new(
self.tcx().require_lang_item(
- CopyTraitLangItem,
+ LangItem::Copy,
Some(self.last_span),
),
tcx.mk_substs_trait(ty, &[]),
}
let trait_ref = ty::TraitRef {
- def_id: tcx.require_lang_item(SizedTraitLangItem, Some(self.last_span)),
+ def_id: tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
substs: tcx.mk_substs_trait(ty, &[]),
};
CastKind::Pointer(PointerCast::Unsize) => {
let &ty = ty;
let trait_ref = ty::TraitRef {
- def_id: tcx.require_lang_item(
- CoerceUnsizedTraitLangItem,
- Some(self.last_span),
- ),
+ def_id: tcx
+ .require_lang_item(LangItem::CoerceUnsized, Some(self.last_span)),
substs: tcx.mk_substs_trait(op.ty(body, tcx), &[ty.into()]),
};