Skip to content

Commit

Permalink
a less laborious way to define Default
Browse files Browse the repository at this point in the history
  • Loading branch information
tshepang committed Oct 10, 2019
1 parent 0a65ede commit 94152e0
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions polonius-engine/src/facts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt::Debug;
use std::hash::Hash;

/// The "facts" which are the basis of the NLL borrow analysis.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct AllFacts<T: FactTypes> {
/// `borrow_region(origin, loan, point)` -- the `origin` may refer to data
/// from `loan` starting at `point` (this is usually the
Expand Down Expand Up @@ -64,29 +64,6 @@ pub struct AllFacts<T: FactTypes> {
pub path_accessed_at: Vec<(T::Path, T::Point)>,
}

impl<T: FactTypes> Default for AllFacts<T> {
fn default() -> Self {
AllFacts {
borrow_region: Vec::default(),
universal_region: Vec::default(),
cfg_edge: Vec::default(),
killed: Vec::default(),
outlives: Vec::default(),
invalidates: Vec::default(),
var_used: Vec::default(),
var_defined: Vec::default(),
var_drop_used: Vec::default(),
var_uses_region: Vec::default(),
var_drops_region: Vec::default(),
child: Vec::default(),
path_belongs_to_var: Vec::default(),
initialized_at: Vec::default(),
moved_out_at: Vec::default(),
path_accessed_at: Vec::default(),
}
}
}

pub trait Atom:
From<usize> + Into<usize> + Copy + Clone + Debug + Eq + Ord + Hash + 'static
{
Expand Down

0 comments on commit 94152e0

Please sign in to comment.