/// assert_eq!(x, PathBuf::from("/foo/bar"));
/// ```
pub PATH_BUF_PUSH_OVERWRITE,
- correctness,
+ nursery,
"calling `push` with file system root on `PathBuf` can overwrite it"
}
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
if_chain! {
if let ExprKind::MethodCall(ref path, _, ref args) = expr.node;
- if path.ident.name == "push";
+ if path.ident.name == sym!(push);
if args.len() == 2;
if match_type(cx, walk_ptrs_ty(cx.tables.expr_ty(&args[0])), &paths::PATH_BUF);
if let Some(get_index_arg) = args.get(1);