fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyLayout {
self.tcx.layout_of(self.param_env.and(ty))
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
impl<'a, 'tcx, T: LateLintPass<'a, 'tcx>> LateContextAndPass<'a, 'tcx, T> {
use syntax::ast::{self, Ident, IntTy, UintTy};
use syntax::attr;
-use syntax_pos::{DUMMY_SP, Span};
+use syntax_pos::DUMMY_SP;
use std::cmp;
use std::fmt;
Ok(layout)
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
impl LayoutOf for LayoutCx<'tcx, ty::query::TyCtxtAt<'tcx>> {
Ok(layout)
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
// Helper (inherent) `layout_of` methods to avoid pushing `LayoutCx` to users.
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use syntax::symbol::LocalInternedString;
-use syntax::source_map::Span;
use rustc_codegen_ssa::common::{IntPredicate, TypeKind, RealPredicate};
use rustc_codegen_ssa::MemFlags;
use libc::{c_uint, c_char};
fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyLayout {
self.cx.layout_of(ty)
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.cx.layout_of(ty)
- }
}
impl Deref for Builder<'_, 'll, 'tcx> {
let ty = rvalue.ty(self.mir, self.cx.tcx());
let ty = self.monomorphize(&ty);
self.cx.spanned_layout_of(ty, span).is_zst()
- // self.cx.layout_of(ty).is_zst()
}
}
.layout_of(self.param_env.and(ty))
.map_err(|layout| err_inval!(Layout(layout)).into())
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
pub fn push_stack_frame(
&mut self,
instance: ty::Instance<'tcx>,
- span: source_map::Span,
+ span: Span,
body: &'mir mir::Body<'tcx>,
return_place: Option<PlaceTy<'tcx, M::PointerTag>>,
return_to_block: StackPopCleanup,
fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyLayout {
self.tcx.layout_of(self.param_env.and(ty))
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
impl<'mir, 'tcx> HasDataLayout for ConstPropagator<'mir, 'tcx> {
use rustc::ty::TyCtxt;
use syntax::ast::Attribute;
use syntax::symbol::sym;
-use syntax::source_map::Span;
pub fn test_layout(tcx: TyCtxt<'_>) {
if tcx.features().rustc_attrs {
fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyLayout {
self.tcx.layout_of(self.param_env.and(ty)).unwrap()
}
- fn spanned_layout_of(&self, ty: Ty<'tcx>, _: Option<Span>) -> Self::TyLayout {
- self.layout_of(ty)
- }
}
impl HasTyCtxt<'tcx> for UnwrapLayoutCx<'tcx> {
type TyLayout;
fn layout_of(&self, ty: Self::Ty) -> Self::TyLayout;
- fn spanned_layout_of(&self, ty: Self::Ty, span: Option<Span>) -> Self::TyLayout;
+ fn spanned_layout_of(&self, ty: Self::Ty, _span: Option<Span>) -> Self::TyLayout {
+ self.layout_of(ty)
+ }
}
#[derive(Copy, Clone, PartialEq, Eq)]