]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/path_buf_push_overwrite.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / path_buf_push_overwrite.rs
index 10ca3d523abde049fd4e527c4f6a494a750ffe36..8ebb5150ab473a63a6e4af6402bcb32e12843177 100644 (file)
@@ -34,7 +34,7 @@
     /// 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"
 }
 
@@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PathBufPushOverwrite {
     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);