Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Friis Vindum <[email protected]>
  • Loading branch information
hvitved and paldepind authored Dec 18, 2024
1 parent 025a673 commit 843e0a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust/ql/test/library-tests/dataflow/global/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl Add for MyInt {
type Output = MyInt;

fn add(self, other: MyInt) -> MyInt {

Check notice

Code scanning / CodeQL

Unused variable Note test

Variable 'other' is not used.
// Ignore `other` to get value flow for `self.value`
MyInt { value: self.value }
}
}
Expand All @@ -111,9 +112,9 @@ pub fn test_operator_overloading() {
let c = a + b;
sink(c.value); // $ MISSING: hasValueFlow=5

let a = MyInt { value: source(6) };
let b = MyInt { value: 2 };
let d = b + a;
let a = MyInt { value: 2 };
let b = MyInt { value: source(6) };
let d = a + b;
sink(d.value);

let a = MyInt { value: source(7) };
Expand Down

0 comments on commit 843e0a2

Please sign in to comment.