Browse Source

Silence `mismatched_lifetime_syntaxes` lint (#1837)

I think the PR name is self-explanatory.

Signed-off-by: Samuel Moelius <samuel.moelius@trailofbits.com>
Co-authored-by: salaheldinsoliman <49910731+salaheldinsoliman@users.noreply.github.com>
Samuel Moelius 1 month ago
parent
commit
e2b90b2f18

+ 1 - 1
src/abi/anchor.rs

@@ -220,7 +220,7 @@ struct TypeManager<'a> {
 }
 
 impl TypeManager<'_> {
-    fn new(ns: &Namespace, contract_no: usize) -> TypeManager {
+    fn new(ns: &Namespace, contract_no: usize) -> TypeManager<'_> {
         TypeManager {
             namespace: ns,
             added_types: HashSet::new(),

+ 1 - 1
src/codegen/encoding/buffer_validator.rs

@@ -25,7 +25,7 @@ pub(crate) struct BufferValidator<'a> {
 }
 
 impl BufferValidator<'_> {
-    pub fn new(buffer_size_var: usize, types: &[Type]) -> BufferValidator {
+    pub fn new(buffer_size_var: usize, types: &[Type]) -> BufferValidator<'_> {
         BufferValidator {
             buffer_length: Expression::Variable {
                 loc: Loc::Codegen,

+ 1 - 1
src/codegen/subexpression_elimination/anticipated_expressions.rs

@@ -42,7 +42,7 @@ impl<'a> AnticipatedExpressions<'a> {
         dag: &Vec<Vec<usize>>,
         reverse_dag: Vec<Vec<usize>>,
         traversing_order: Vec<(usize, bool)>,
-    ) -> AnticipatedExpressions {
+    ) -> AnticipatedExpressions<'_> {
         let mut depth: Vec<u16> = vec![u16::MAX; dag.len()];
         AnticipatedExpressions::blocks_depth(dag, 0, 0, &mut depth);
         AnticipatedExpressions {

+ 2 - 2
src/sema/diagnostics.rs

@@ -27,11 +27,11 @@ impl Diagnostics {
         self.contents.len()
     }
 
-    pub fn iter(&self) -> Iter<Diagnostic> {
+    pub fn iter(&self) -> Iter<'_, Diagnostic> {
         self.contents.iter()
     }
 
-    pub fn iter_mut(&mut self) -> IterMut<Diagnostic> {
+    pub fn iter_mut(&mut self) -> IterMut<'_, Diagnostic> {
         self.contents.iter_mut()
     }