Skip to content

Commit

Permalink
Silence a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Sep 9, 2024
1 parent 6683ad3 commit f7b7774
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/paralegal-flow/tests/stub-tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fn pass<T>(t: T) -> T {
#[paralegal::marker(target, arguments = [0])]
fn target(i: usize) {}

#[allow(dead_code)]
#[paralegal::analyze]
fn thread_spawn() {
let src = source();
Expand All @@ -20,6 +21,7 @@ fn thread_spawn() {

fn main() {}

#[allow(dead_code)]
#[paralegal::analyze]
async fn async_spawn() {
let src = source();
Expand All @@ -31,11 +33,13 @@ fn to_block() -> Result<usize, actix_web::error::BlockingError> {
Ok(source())
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn block_fn() -> Result<(), actix_web::error::BlockingError> {
Ok(target(actix_web::web::block(to_block).await?? + 1))
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn block_closure(to_close_over: usize) -> Result<(), actix_web::error::BlockingError> {
Ok(target(
Expand All @@ -54,13 +58,15 @@ where
res
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn test_blocking_with_let_bound_closure(to_close_over: &str) {
let from_scope = 10;
let the_closure = move |u| u + source() + from_scope;
target(blocking(to_close_over, the_closure).await);
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn strategic_overtaint(to_close_over: usize) -> Result<(), actix_web::error::BlockingError> {
Ok(target(
Expand All @@ -70,6 +76,7 @@ async fn strategic_overtaint(to_close_over: usize) -> Result<(), actix_web::erro
))
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn strategic_overtaint_2(
to_close_over: usize,
Expand All @@ -81,6 +88,7 @@ async fn strategic_overtaint_2(
))
}

#[allow(dead_code)]
#[paralegal::analyze]
async fn no_taint_without_connection(
to_close_over: usize,
Expand Down

0 comments on commit f7b7774

Please sign in to comment.