Skip to content

Commit

Permalink
Ran missing formatting (#20)
Browse files Browse the repository at this point in the history
Does the formatting that the workflow complained about
  • Loading branch information
JustusAdam authored Jul 26, 2023
1 parent 1a9b7aa commit ed2d2d2
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 143 deletions.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::process::Command;
extern crate chrono;
use std::env;

const COMPILER_DEPENDENT_BINARIES : &[&str] = &["dfpp", "cargo-dfpp", "dfpp-explorer"];
const COMPILER_DEPENDENT_BINARIES: &[&str] = &["dfpp", "cargo-dfpp", "dfpp-explorer"];

fn add_link_arg_for_compiler_binaries(s: impl std::fmt::Display) {
for bin in COMPILER_DEPENDENT_BINARIES {
Expand Down Expand Up @@ -34,7 +34,7 @@ pub fn link_rustc_lib() {
} else {
"$ORIGIN"
};
add_link_search_path_for_compiler_binaries(&format!("{origin}/../toolchain/lib"));
add_link_search_path_for_compiler_binaries(format!("{origin}/../toolchain/lib"));
if cfg!(target_os = "linux") {
println!("cargo:rustc-link-search=native={}", rustup_lib.display());
}
Expand Down
1 change: 1 addition & 0 deletions src/ana/algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ pub mod graph {
graph
}

#[allow(clippy::blocks_in_if_conditions)]
pub fn reachable<
B: Display + Copy + Hash + Eq + Ord,
F: Hash + Eq + Display + Copy,
Expand Down
1 change: 1 addition & 0 deletions src/ana/df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ impl<'a, 'tcx, 'g, 's> FlowAnalysis<'a, 'tcx, 'g, 's> {
self.tcx.hir().body_owned_by(self.def_id.expect_local())
}

#[allow(clippy::too_many_arguments)]
pub fn new(
tcx: TyCtxt<'tcx>,
gli: GLI<'g>,
Expand Down
15 changes: 4 additions & 11 deletions src/ana/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,7 @@ impl<'tcx, 'g, 's> Inliner<'tcx, 'g, 's> {
}
}

fn find_prunable_edges(
graph: &InlinedGraph<'g>,
) -> HashSet<(
Node<(GlobalLocation<'g>, DefId)>,
Node<(GlobalLocation<'g>, DefId)>,
)> {
fn find_prunable_edges(graph: &InlinedGraph<'g>) -> EdgeSet<'g> {
let graph = &graph.graph;
graph
.all_edges()
Expand Down Expand Up @@ -938,6 +933,8 @@ impl<'tcx, 'g, 's> Inliner<'tcx, 'g, 's> {
true
}

#[allow(clippy::type_complexity)]
#[allow(clippy::too_many_arguments)]
fn inline_one_function(
&self,
InlinedGraph {
Expand All @@ -952,10 +949,7 @@ impl<'tcx, 'g, 's> Inliner<'tcx, 'g, 's> {
outgoing: &[(SimpleLocation<(GlobalLocation<'g>, DefId)>, Edge)],
arguments: &[Option<mir::Local>],
return_to: Option<mir::Local>,
queue_for_pruning: &mut HashSet<(
SimpleLocation<(GlobalLocation<'g>, DefId)>,
SimpleLocation<(GlobalLocation<'g>, DefId)>,
)>,
queue_for_pruning: &mut EdgeSet<'g>,
root_location: GlobalLocation<'g>,
) {
let grw_to_inline =
Expand Down Expand Up @@ -997,7 +991,6 @@ impl<'tcx, 'g, 's> Inliner<'tcx, 'g, 's> {
.iter()
.enumerate()
.filter_map(|(a, actual_param)| Some(((*actual_param)?, (a + 1).into())))
.into_iter()
.chain(return_to.into_iter().map(|r| (r, mir::RETURN_PLACE)))
.map(|(actual_param, formal_param)| {
algebra::Equality::new(
Expand Down
2 changes: 1 addition & 1 deletion src/desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl Identifier {
pub fn as_str(&self) -> &str {
self.0.as_str()
}
pub fn from_str(s: &str) -> Self {
pub fn new_intern(s: &str) -> Self {
Self::new(Symbol::intern(s))
}
}
Expand Down
14 changes: 8 additions & 6 deletions src/discover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use hir::{
};
use rustc_middle::hir::nested_filter::OnlyBodies;
use rustc_span::{symbol::Ident, Span, Symbol};
use std::{cell::RefCell, rc::Rc, collections::hash_map::Entry};
use std::{cell::RefCell, collections::hash_map::Entry, rc::Rc};

/// Values of this type can be matched against Rust attributes
pub type AttrMatchT = Vec<Symbol>;
Expand All @@ -36,6 +36,7 @@ pub type CallSiteAnnotations = HashMap<DefId, (Vec<Annotation>, usize)>;
/// read-only.
pub type MarkedObjects = Rc<RefCell<HashMap<LocalDefId, (Vec<Annotation>, ObjectType)>>>;

#[allow(clippy::type_complexity)]
/// This visitor traverses the items in the analyzed crate to discover
/// annotations and analysis targets and store them in this struct. After the
/// discovery phase [`Self::analyze`] is used to drive the
Expand Down Expand Up @@ -302,7 +303,6 @@ impl<'tcx> intravisit::Visitor<'tcx> for CollectingVisitor<'tcx> {
return;
}


let node = self.tcx.hir().find(id).unwrap();

if let Some((def_id, obj_type, allow_prior)) = if let Some(decl) = node.fn_decl() {
Expand All @@ -324,9 +324,11 @@ impl<'tcx> intravisit::Visitor<'tcx> for CollectingVisitor<'tcx> {
| hir::Node::Ctor(hir::VariantData::Unit(..)) => {
Some((id.expect_owner().def_id, ObjectType::Type, false))
}
hir::Node::Ctor(hir::VariantData::Tuple(_, _, _)) => {
Some((self.tcx.hir().parent_id(id).expect_owner().def_id, ObjectType::Type, true))
}
hir::Node::Ctor(hir::VariantData::Tuple(_, _, _)) => Some((
self.tcx.hir().parent_id(id).expect_owner().def_id,
ObjectType::Type,
true,
)),
_ => None,
}
} {
Expand All @@ -339,7 +341,7 @@ impl<'tcx> intravisit::Visitor<'tcx> for CollectingVisitor<'tcx> {
}
Entry::Vacant(vac) => {
vac.insert(val);
},
}
}
} else {
let e = match node {
Expand Down
Loading

0 comments on commit ed2d2d2

Please sign in to comment.