How to Process AST JSON file in Rust for Clippy Lints

  1. I have started to write new lints for clippy. For that I have to analyse some rust wrong code using clippy lints. I am confused as there are lot functions/method in syntax::ast and other related crates, which function is useful for which scenario.For example in my following code , if i want to detect that is there any unsafe or *mut or variable name “x”, so on so forth. So, how to detect this matter. I think ident.name = “unsafe” would not work.

unsafe {
let p: *const i32 = &x;
let q: *mut i32 = p as *mut i32;
*q = 12;
}

  1. Is there any tutorial for LateLintPass which explain some basic and details.

Actually, I want to know that is there any detailed tutorial or Book (like rust stable book) which could guide me for above scenarios.