Skip to content

Commit 0bf1a80

Browse files
Rename sty to kind
Picks up changes made in rust-lang#64513
1 parent ff4158a commit 0bf1a80

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc_mir/transform/check_consts/qualifs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub trait Qualif {
164164
if let box [proj_base @ .., elem] = &place.projection {
165165
if ProjectionElem::Deref == *elem {
166166
let base_ty = Place::ty_from(&place.base, proj_base, cx.body, cx.tcx).ty;
167-
if let ty::Ref(..) = base_ty.sty {
167+
if let ty::Ref(..) = base_ty.kind {
168168
return Self::in_place(cx, per_local, PlaceRef {
169169
base: &place.base,
170170
projection: proj_base,
@@ -223,7 +223,7 @@ impl Qualif for HasMutInterior {
223223
if let BorrowKind::Mut { .. } = kind {
224224
// In theory, any zero-sized value could be borrowed
225225
// mutably without consequences.
226-
match ty.sty {
226+
match ty.kind {
227227
// Inside a `static mut`, &mut [...] is also allowed.
228228
ty::Array(..) | ty::Slice(_) if cx.mode == Mode::StaticMut => {},
229229

src/librustc_mir/transform/check_consts/validation.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
247247
if let box [proj_base @ .., elem] = &place.projection {
248248
if *elem == ProjectionElem::Deref {
249249
let base_ty = Place::ty_from(&place.base, proj_base, self.body, self.tcx).ty;
250-
if let ty::Ref(..) = base_ty.sty {
250+
if let ty::Ref(..) = base_ty.kind {
251251
reborrow_place = Some(proj_base);
252252
}
253253
}
@@ -302,7 +302,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
302302
}
303303

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

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

511-
let def_id = match fn_ty.sty {
511+
let def_id = match fn_ty.kind {
512512
ty::FnDef(def_id, _) => def_id,
513513

514514
ty::FnPtr(_) => {

0 commit comments

Comments
 (0)