Change ty.kind to a method
This commit is contained in:
@@ -91,7 +91,7 @@ impl Visitor<'tcx> for OptimizationFinder<'b, 'tcx> {
|
||||
{
|
||||
// The dereferenced place must have type `&_`.
|
||||
let ty = Place::ty_from(local, proj_base, self.body, self.tcx).ty;
|
||||
if let ty::Ref(_, _, Mutability::Not) = ty.kind {
|
||||
if let ty::Ref(_, _, Mutability::Not) = ty.kind() {
|
||||
self.optimizations.and_stars.insert(location);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ impl Visitor<'tcx> for OptimizationFinder<'b, 'tcx> {
|
||||
|
||||
if let Rvalue::Len(ref place) = *rvalue {
|
||||
let place_ty = place.ty(&self.body.local_decls, self.tcx).ty;
|
||||
if let ty::Array(_, len) = place_ty.kind {
|
||||
if let ty::Array(_, len) = place_ty.kind() {
|
||||
let span = self.body.source_info(location).span;
|
||||
let constant = Constant { span, literal: len, user_ty: None };
|
||||
self.optimizations.arrays_lengths.insert(location, constant);
|
||||
|
||||
Reference in New Issue
Block a user