Fix clippy::needless_borrow
in the compiler
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
This commit is contained in:
parent
0ff8610964
commit
21a870515b
304 changed files with 1101 additions and 1174 deletions
|
@ -231,13 +231,13 @@ fn dump_graph(query: &DepGraphQuery) {
|
|||
// Expect one of: "-> target", "source -> target", or "source ->".
|
||||
let edge_filter =
|
||||
EdgeFilter::new(&string).unwrap_or_else(|e| bug!("invalid filter: {}", e));
|
||||
let sources = node_set(&query, &edge_filter.source);
|
||||
let targets = node_set(&query, &edge_filter.target);
|
||||
filter_nodes(&query, &sources, &targets)
|
||||
let sources = node_set(query, &edge_filter.source);
|
||||
let targets = node_set(query, &edge_filter.target);
|
||||
filter_nodes(query, &sources, &targets)
|
||||
}
|
||||
Err(_) => query.nodes().into_iter().map(|n| n.kind).collect(),
|
||||
};
|
||||
let edges = filter_edges(&query, &nodes);
|
||||
let edges = filter_edges(query, &nodes);
|
||||
|
||||
{
|
||||
// dump a .txt file with just the edges:
|
||||
|
|
|
@ -378,15 +378,15 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
|
|||
};
|
||||
self.checked_attrs.insert(attr.id);
|
||||
for label in assertion.clean.items().into_sorted_stable_ord() {
|
||||
let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
|
||||
let dep_node = DepNode::from_label_string(self.tcx, label, def_path_hash).unwrap();
|
||||
self.assert_clean(item_span, dep_node);
|
||||
}
|
||||
for label in assertion.dirty.items().into_sorted_stable_ord() {
|
||||
let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
|
||||
let dep_node = DepNode::from_label_string(self.tcx, label, def_path_hash).unwrap();
|
||||
self.assert_dirty(item_span, dep_node);
|
||||
}
|
||||
for label in assertion.loaded_from_disk.items().into_sorted_stable_ord() {
|
||||
let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
|
||||
let dep_node = DepNode::from_label_string(self.tcx, label, def_path_hash).unwrap();
|
||||
self.assert_loaded_from_disk(item_span, dep_node);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ fn lock_directory(
|
|||
}
|
||||
|
||||
fn delete_session_dir_lock_file(sess: &Session, lock_file_path: &Path) {
|
||||
if let Err(err) = safe_remove_file(&lock_file_path) {
|
||||
if let Err(err) = safe_remove_file(lock_file_path) {
|
||||
sess.emit_warning(errors::DeleteLock { path: lock_file_path, err });
|
||||
}
|
||||
}
|
||||
|
@ -847,10 +847,10 @@ pub(crate) fn garbage_collect_session_directories(sess: &Session) -> io::Result<
|
|||
fn delete_old(sess: &Session, path: &Path) {
|
||||
debug!("garbage_collect_session_directories() - deleting `{}`", path.display());
|
||||
|
||||
if let Err(err) = safe_remove_dir_all(&path) {
|
||||
sess.emit_warning(errors::SessionGcFailed { path: &path, err });
|
||||
if let Err(err) = safe_remove_dir_all(path) {
|
||||
sess.emit_warning(errors::SessionGcFailed { path: path, err });
|
||||
} else {
|
||||
delete_session_dir_lock_file(sess, &lock_file_path(&path));
|
||||
delete_session_dir_lock_file(sess, &lock_file_path(path));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ fn load_dep_graph(sess: &Session) -> LoadResult<(SerializedDepGraph, WorkProduct
|
|||
|
||||
// Calling `sess.incr_comp_session_dir()` will panic if `sess.opts.incremental.is_none()`.
|
||||
// Fortunately, we just checked that this isn't the case.
|
||||
let path = dep_graph_path(&sess);
|
||||
let path = dep_graph_path(sess);
|
||||
let expected_hash = sess.opts.dep_tracking_hash(false);
|
||||
|
||||
let mut prev_work_products = UnordMap::default();
|
||||
|
|
|
@ -31,7 +31,7 @@ pub fn copy_cgu_workproduct_to_incr_comp_cache_dir(
|
|||
}
|
||||
Err(err) => {
|
||||
sess.emit_warning(errors::CopyWorkProductToCache {
|
||||
from: &path,
|
||||
from: path,
|
||||
to: &path_in_incr_dir,
|
||||
err,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue