pub struct PatternDetector;Expand description
Pattern detector for identifying Box<T> candidates.
Implementations§
Source§impl PatternDetector
impl PatternDetector
Sourcepub fn find_box_candidates(&self, func: &HirFunction) -> Vec<BoxCandidate>
pub fn find_box_candidates(&self, func: &HirFunction) -> Vec<BoxCandidate>
Analyze a function to find Box<T> candidates.
Detects patterns like:
T* ptr = malloc(sizeof(T));
// ... use ptr ...
free(ptr);Sourcepub fn find_vec_candidates(&self, func: &HirFunction) -> Vec<VecCandidate>
pub fn find_vec_candidates(&self, func: &HirFunction) -> Vec<VecCandidate>
Analyze a function to find Vec<T> candidates.
Detects patterns like:
T* arr = malloc(n * sizeof(T));
// ... use arr as array ...
free(arr);Trait Implementations§
Source§impl Clone for PatternDetector
impl Clone for PatternDetector
Source§fn clone(&self) -> PatternDetector
fn clone(&self) -> PatternDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternDetector
impl Debug for PatternDetector
Auto Trait Implementations§
impl Freeze for PatternDetector
impl RefUnwindSafe for PatternDetector
impl Send for PatternDetector
impl Sync for PatternDetector
impl Unpin for PatternDetector
impl UnwindSafe for PatternDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more