TyKind
This commit is contained in:
parent
5d4102ee78
commit
12ded030b6
18 changed files with 55 additions and 55 deletions
|
|
@ -283,8 +283,8 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
|
|||
let qp_label = self.next("qp");
|
||||
|
||||
println!("Cast(ref {}, ref {}) = {};", cast_pat, cast_ty, current);
|
||||
if let Ty_::TyPath(ref qp) = ty.node {
|
||||
println!(" if let Ty_::TyPath(ref {}) = {}.node;", qp_label, cast_ty);
|
||||
if let TyKind::Path(ref qp) = ty.node {
|
||||
println!(" if let TyKind::Path(ref {}) = {}.node;", qp_label, cast_ty);
|
||||
self.current = qp_label;
|
||||
self.print_qpath(qp);
|
||||
}
|
||||
|
|
@ -674,7 +674,7 @@ fn print_path(path: &QPath, first: &mut bool) {
|
|||
print!("{:?}", segment.ident.as_str());
|
||||
},
|
||||
QPath::TypeRelative(ref ty, ref segment) => match ty.node {
|
||||
hir::Ty_::TyPath(ref inner_path) => {
|
||||
hir::TyKind::Path(ref inner_path) => {
|
||||
print_path(inner_path, first);
|
||||
if *first {
|
||||
*first = false;
|
||||
|
|
|
|||
|
|
@ -246,10 +246,10 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
|
|||
self.eq_ty_kind(&left.node, &right.node)
|
||||
}
|
||||
|
||||
pub fn eq_ty_kind(&mut self, left: &Ty_, right: &Ty_) -> bool {
|
||||
pub fn eq_ty_kind(&mut self, left: &TyKind, right: &TyKind) -> bool {
|
||||
match (left, right) {
|
||||
(&TySlice(ref l_vec), &TySlice(ref r_vec)) => self.eq_ty(l_vec, r_vec),
|
||||
(&TyArray(ref lt, ref ll_id), &TyArray(ref rt, ref rl_id)) => {
|
||||
(&TyKind::Slice(ref l_vec), &TyKind::Slice(ref r_vec)) => self.eq_ty(l_vec, r_vec),
|
||||
(&TyKind::Array(ref lt, ref ll_id), &TyKind::Array(ref rt, ref rl_id)) => {
|
||||
let full_table = self.tables;
|
||||
|
||||
let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(ll_id.body));
|
||||
|
|
@ -264,13 +264,13 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
|
|||
self.tables = full_table;
|
||||
eq_ty && ll == rl
|
||||
},
|
||||
(&TyPtr(ref l_mut), &TyPtr(ref r_mut)) => l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty),
|
||||
(&TyRptr(_, ref l_rmut), &TyRptr(_, ref r_rmut)) => {
|
||||
(&TyKind::Ptr(ref l_mut), &TyKind::Ptr(ref r_mut)) => l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty),
|
||||
(&TyKind::Rptr(_, ref l_rmut), &TyKind::Rptr(_, ref r_rmut)) => {
|
||||
l_rmut.mutbl == r_rmut.mutbl && self.eq_ty(&*l_rmut.ty, &*r_rmut.ty)
|
||||
},
|
||||
(&TyPath(ref l), &TyPath(ref r)) => self.eq_qpath(l, r),
|
||||
(&TyTup(ref l), &TyTup(ref r)) => over(l, r, |l, r| self.eq_ty(l, r)),
|
||||
(&TyInfer, &TyInfer) => true,
|
||||
(&TyKind::Path(ref l), &TyKind::Path(ref r)) => self.eq_qpath(l, r),
|
||||
(&TyKind::Tup(ref l), &TyKind::Tup(ref r)) => over(l, r, |l, r| self.eq_ty(l, r)),
|
||||
(&TyKind::Infer, &TyKind::Infer) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
|
|||
|
||||
|
||||
fn is_lint_ref_type(ty: &Ty) -> bool {
|
||||
if let TyRptr(
|
||||
if let TyKind::Rptr(
|
||||
_,
|
||||
MutTy {
|
||||
ty: ref inner,
|
||||
|
|
@ -170,7 +170,7 @@ fn is_lint_ref_type(ty: &Ty) -> bool {
|
|||
},
|
||||
) = ty.node
|
||||
{
|
||||
if let TyPath(ref path) = inner.node {
|
||||
if let TyKind::Path(ref path) = inner.node {
|
||||
return match_qpath(path, &paths::LINT);
|
||||
}
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ fn is_lint_ref_type(ty: &Ty) -> bool {
|
|||
|
||||
|
||||
fn is_lint_array_type(ty: &Ty) -> bool {
|
||||
if let TyPath(ref path) = ty.node {
|
||||
if let TyKind::Path(ref path) = ty.node {
|
||||
match_qpath(path, &paths::LINT_ARRAY)
|
||||
} else {
|
||||
false
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ pub fn match_qpath(path: &QPath, segments: &[&str]) -> bool {
|
|||
match *path {
|
||||
QPath::Resolved(_, ref path) => match_path(path, segments),
|
||||
QPath::TypeRelative(ref ty, ref segment) => match ty.node {
|
||||
TyPath(ref inner_path) => {
|
||||
TyKind::Path(ref inner_path) => {
|
||||
!segments.is_empty() && match_qpath(inner_path, &segments[..(segments.len() - 1)])
|
||||
&& segment.ident.name == segments[segments.len() - 1]
|
||||
},
|
||||
|
|
@ -667,7 +667,7 @@ where
|
|||
/// Return the base type for HIR references and pointers.
|
||||
pub fn walk_ptrs_hir_ty(ty: &hir::Ty) -> &hir::Ty {
|
||||
match ty.node {
|
||||
TyPtr(ref mut_ty) | TyRptr(_, ref mut_ty) => walk_ptrs_hir_ty(&mut_ty.ty),
|
||||
TyKind::Ptr(ref mut_ty) | TyKind::Rptr(_, ref mut_ty) => walk_ptrs_hir_ty(&mut_ty.ty),
|
||||
_ => ty,
|
||||
}
|
||||
}
|
||||
|
|
@ -998,7 +998,7 @@ pub fn is_self(slf: &Arg) -> bool {
|
|||
|
||||
pub fn is_self_ty(slf: &hir::Ty) -> bool {
|
||||
if_chain! {
|
||||
if let TyPath(ref qp) = slf.node;
|
||||
if let TyKind::Path(ref qp) = slf.node;
|
||||
if let QPath::Resolved(None, ref path) = *qp;
|
||||
if let Def::SelfTy(..) = path.def;
|
||||
then {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue