return Some(format!("{:?}", $itypes))
})*
None
- },)*
+ },)+
_ => None
}
}
}
let par_id = cx.tcx.hir().get_parent_node_by_hir_id(e.hir_id);
- if let Node::Expr(par_e) = cx.tcx.hir().get_by_hir_id(par_id) {
+ if let Node::Expr(par_e) = cx.tcx.hir().get(par_id) {
if let hir::ExprKind::Struct(..) = par_e.node {
if is_range_literal(cx.sess(), par_e)
&& lint_overflowing_range_endpoint(cx, lit, v, max, e, par_e, t)
};
if lit_val < min || lit_val > max {
let parent_id = cx.tcx.hir().get_parent_node_by_hir_id(e.hir_id);
- if let Node::Expr(par_e) = cx.tcx.hir().get_by_hir_id(parent_id) {
+ if let Node::Expr(par_e) = cx.tcx.hir().get(parent_id) {
match par_e.node {
hir::ExprKind::Cast(..) => {
if let ty::Char = cx.tables.expr_ty(par_e).sty {
declare_lint_pass!(ImproperCTypes => [IMPROPER_CTYPES]);
-struct ImproperCTypesVisitor<'a, 'tcx: 'a> {
+struct ImproperCTypesVisitor<'a, 'tcx> {
cx: &'a LateContext<'a, 'tcx>,
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImproperCTypes {
fn check_foreign_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::ForeignItem) {
let mut vis = ImproperCTypesVisitor { cx };
- let abi = cx.tcx.hir().get_foreign_abi_by_hir_id(it.hir_id);
+ let abi = cx.tcx.hir().get_foreign_abi(it.hir_id);
if abi != Abi::RustIntrinsic && abi != Abi::PlatformIntrinsic {
match it.node {
hir::ForeignItemKind::Fn(ref decl, _, _) => {