rustc_lint: only query typeck_tables_of
when a lint needs it.
This commit is contained in:
parent
80bcbf521c
commit
f5ce0e5fe9
100 changed files with 361 additions and 366 deletions
|
@ -36,8 +36,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OverflowCheckConditional {
|
|||
if let ExprKind::Path(QPath::Resolved(_, ref path2)) = ident2.kind;
|
||||
if let ExprKind::Path(QPath::Resolved(_, ref path3)) = second.kind;
|
||||
if eq(&path1.segments[0], &path3.segments[0]) || eq(&path2.segments[0], &path3.segments[0]);
|
||||
if cx.tables.expr_ty(ident1).is_integral();
|
||||
if cx.tables.expr_ty(ident2).is_integral();
|
||||
if cx.tables().expr_ty(ident1).is_integral();
|
||||
if cx.tables().expr_ty(ident2).is_integral();
|
||||
then {
|
||||
if let BinOpKind::Lt = op.node {
|
||||
if let BinOpKind::Add = op2.node {
|
||||
|
@ -61,8 +61,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OverflowCheckConditional {
|
|||
if let ExprKind::Path(QPath::Resolved(_, ref path2)) = ident2.kind;
|
||||
if let ExprKind::Path(QPath::Resolved(_, ref path3)) = first.kind;
|
||||
if eq(&path1.segments[0], &path3.segments[0]) || eq(&path2.segments[0], &path3.segments[0]);
|
||||
if cx.tables.expr_ty(ident1).is_integral();
|
||||
if cx.tables.expr_ty(ident2).is_integral();
|
||||
if cx.tables().expr_ty(ident1).is_integral();
|
||||
if cx.tables().expr_ty(ident2).is_integral();
|
||||
then {
|
||||
if let BinOpKind::Gt = op.node {
|
||||
if let BinOpKind::Add = op2.node {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue