2018-02-23 19:02:48 -06:00
|
|
|
if_chain! {
|
2018-07-12 03:53:53 -05:00
|
|
|
if let StmtKind::Decl(ref decl, _) = stmt.node
|
2018-07-12 03:55:41 -05:00
|
|
|
if let DeclKind::Local(ref local) = decl.node;
|
2018-05-11 12:05:34 -05:00
|
|
|
if let Some(ref init) = local.init
|
2018-07-12 02:30:57 -05:00
|
|
|
if let ExprKind::Cast(ref expr, ref cast_ty) = init.node;
|
2018-07-12 03:03:06 -05:00
|
|
|
if let TyKind::Path(ref qp) = cast_ty.node;
|
2018-02-23 19:02:48 -06:00
|
|
|
if match_qpath(qp, &["char"]);
|
2018-07-12 02:30:57 -05:00
|
|
|
if let ExprKind::Lit(ref lit) = expr.node;
|
2018-02-23 19:02:48 -06:00
|
|
|
if let LitKind::Int(69, _) = lit.node;
|
2018-05-11 12:05:34 -05:00
|
|
|
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local.pat.node;
|
|
|
|
if name.node.as_str() == "x";
|
2018-02-23 19:02:48 -06:00
|
|
|
then {
|
|
|
|
// report your lint here
|
|
|
|
}
|
|
|
|
}
|