Skip to content

Commit

Permalink
Rename sty to kind
Browse files Browse the repository at this point in the history
Picks up changes made in rust-lang#64513
  • Loading branch information
ecstatic-morse committed Sep 28, 2019
1 parent ff4158a commit 0bf1a80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/transform/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub trait Qualif {
if let box [proj_base @ .., elem] = &place.projection {
if ProjectionElem::Deref == *elem {
let base_ty = Place::ty_from(&place.base, proj_base, cx.body, cx.tcx).ty;
if let ty::Ref(..) = base_ty.sty {
if let ty::Ref(..) = base_ty.kind {
return Self::in_place(cx, per_local, PlaceRef {
base: &place.base,
projection: proj_base,
Expand Down Expand Up @@ -223,7 +223,7 @@ impl Qualif for HasMutInterior {
if let BorrowKind::Mut { .. } = kind {
// In theory, any zero-sized value could be borrowed
// mutably without consequences.
match ty.sty {
match ty.kind {
// Inside a `static mut`, &mut [...] is also allowed.
ty::Array(..) | ty::Slice(_) if cx.mode == Mode::StaticMut => {},

Expand Down
8 changes: 4 additions & 4 deletions src/librustc_mir/transform/check_consts/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
if let box [proj_base @ .., elem] = &place.projection {
if *elem == ProjectionElem::Deref {
let base_ty = Place::ty_from(&place.base, proj_base, self.body, self.tcx).ty;
if let ty::Ref(..) = base_ty.sty {
if let ty::Ref(..) = base_ty.kind {
reborrow_place = Some(proj_base);
}
}
Expand Down Expand Up @@ -302,7 +302,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
}

Rvalue::BinaryOp(op, ref lhs, _) => {
if let ty::RawPtr(_) | ty::FnPtr(..) = lhs.ty(self.body, self.tcx).sty {
if let ty::RawPtr(_) | ty::FnPtr(..) = lhs.ty(self.body, self.tcx).kind {
assert!(op == BinOp::Eq || op == BinOp::Ne ||
op == BinOp::Le || op == BinOp::Lt ||
op == BinOp::Ge || op == BinOp::Gt ||
Expand Down Expand Up @@ -431,7 +431,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
}

let base_ty = Place::ty_from(place_base, proj_base, self.body, self.tcx).ty;
if let ty::RawPtr(_) = base_ty.sty {
if let ty::RawPtr(_) = base_ty.kind {
self.check_op(ops::RawPtrDeref);
}
}
Expand Down Expand Up @@ -508,7 +508,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
TerminatorKind::Call { func, .. } => {
let fn_ty = func.ty(self.body, self.tcx);

let def_id = match fn_ty.sty {
let def_id = match fn_ty.kind {
ty::FnDef(def_id, _) => def_id,

ty::FnPtr(_) => {
Expand Down

0 comments on commit 0bf1a80

Please sign in to comment.