-
Notifications
You must be signed in to change notification settings - Fork 18
rust programing detecterlib added #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
syzabeer
wants to merge
1
commit into
aws-samples:main
Choose a base branch
from
syzabeer:rustdetecterlib
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=arithmetic-overflow@v1.0 defects=0} | ||
| // Compliant: Used `checked_add` for adding the numbers | ||
| fn compliant() { | ||
| let a: u32 = std::u32::MAX; | ||
| let b: u32 = 1; | ||
| let result = a.checked_add(b); | ||
| match result { | ||
| Some(val) => println!("Result: {}", val), | ||
| None => println!("Addition overflowed"), | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=arithmetic-overflow@v1.0 defects=1} | ||
| // Noncompliant: Operator used to airthmatic operation | ||
| fn noncompliant() { | ||
| let a: u32 = std::u32::MAX; | ||
| let b: u32 = 1; | ||
| let result = a + b; | ||
| println!("Result: {}", result); | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=classic-buffer-overflow@v1.0 defects=0} | ||
| // Compliant: The `to_le_bytes` method to convert a `u32` integer to a byte array | ||
| fn compliant2() { | ||
| let num: u32 = 12345; | ||
| let bytes: [u8; 4] = num.to_le_bytes(); | ||
| println!("{:?}", bytes); | ||
| } | ||
| // {/fact} |
13 changes: 13 additions & 0 deletions
13
rust/src/detectors/classic-buffer-overflow/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=classic-buffer-overflow@v1.0 defects=1} | ||
| // Noncompliant: Use of `mem::transmute(num)` | ||
| fn noncompliant() { | ||
| let num: u32 = 12345; | ||
| let bytes: [u8; 4] = unsafe { mem::transmute(num) }; | ||
| println!("{:?}", bytes); | ||
| } | ||
| // {/fact} |
38 changes: 38 additions & 0 deletions
38
rust/src/detectors/deadlock-and-lock-inconsistency/compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=deadlock-and-lock-inconsistency@v1.0 defects=0} | ||
| use std::sync::{Arc, Mutex,RwLock}; | ||
| use std::sync::atomic::{AtomicUsize, Ordering}; | ||
| use std::thread; | ||
|
|
||
| fn compliant() { | ||
| // Compliant: using `std::sync` module types `Mutex `, `RwLock` | ||
| let data = Arc::new(Mutex::new(0)); | ||
| let t1 = { | ||
| let data = Arc::clone(&data); | ||
| thread::spawn(move || { | ||
| let mut data = data.lock().unwrap(); | ||
| for _ in 0..1_000_000 { | ||
| *data += 1; | ||
| } | ||
| }) | ||
| }; | ||
|
|
||
| let t2 = { | ||
| let data = Arc::clone(&data); | ||
| thread::spawn(move || { | ||
| let mut data = data.lock().unwrap(); | ||
| for _ in 0..1_000_000 { | ||
| *data -= 1; | ||
| } | ||
| }) | ||
| }; | ||
| t1.join().unwrap(); | ||
| t2.join().unwrap(); | ||
|
|
||
| println!("Final data value: {:?}", data.lock().unwrap()); | ||
| } | ||
| // {/fact} |
33 changes: 33 additions & 0 deletions
33
rust/src/detectors/deadlock-and-lock-inconsistency/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=deadlock-and-lock-inconsistency@v1.0 defects=1} | ||
|
|
||
| use std::sync::atomic::{AtomicUsize, Ordering}; | ||
| use std::sync::{Arc, Mutex,RwLock}; | ||
| use std::thread; | ||
|
|
||
| static COUNTER: AtomicUsize = AtomicUsize::new(0); | ||
| fn noncompliant() { | ||
| let mut data = 0; | ||
| // Noncompliant: Not using sync module types `Mutex `, `RwLock` | ||
| let t1 = thread::spawn(move || { | ||
| for _ in 0..1_000_000 { | ||
| data += 1; | ||
| } | ||
| }); | ||
|
|
||
| let t2 = thread::spawn(move || { | ||
| for _ in 0..1_000_000 { | ||
| data -= 1; | ||
| } | ||
| }); | ||
|
|
||
| t1.join().unwrap(); | ||
| t2.join().unwrap(); | ||
|
|
||
| println!("Final data value: {}", data); | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=file-race-bad@v1.0 defects=0} | ||
| // Compliant: Validated symbolic links before removing | ||
| fn safe_remove_dir_all(dir_path: &str) { | ||
| if let Ok(metadata) = fs::symlink_metadata(dir_path) { | ||
| if metadata.file_type().is_dir() { | ||
| unix_fs::symlink_metadata(dir_path).map(|metadata| { | ||
| if metadata.file_type().is_symlink() { | ||
| fs::remove_file(dir_path).unwrap(); | ||
| } | ||
| }).unwrap(); | ||
| fs::remove_dir_all(dir_path).unwrap(); | ||
| } | ||
| } | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=file-race-bad@v1.0 defects=1} | ||
| // Noncompliant: Use of `remove_dir_all` without validating symbolic links | ||
|
|
||
| fn vulnerable_remove_dir_all(dir_path: &str) { | ||
| if fs::metadata(dir_path).unwrap().is_dir() { | ||
| // ruleid: rust-race-condition-remove-dir-all | ||
| fs::remove_dir_all(dir_path).unwrap(); | ||
| } | ||
| } | ||
| // {/fact} | ||
11 changes: 11 additions & 0 deletions
11
rust/src/detectors/improper-certificate-validation/compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-certificate-validation@v1.0 defects=0} | ||
| // Compliant: ssl verification is enabled | ||
| use openssl::ssl::{SslMethod, SslConnectorBuilder, SSL_VERIFY_NONE}; | ||
| let mut connector = SslConnectorBuilder::new(SslMethod::tls()).unwrap(); | ||
| connector.builder_mut().set_verify(SSL_VERIFY_PEER); | ||
| // {/fact} |
11 changes: 11 additions & 0 deletions
11
rust/src/detectors/improper-certificate-validation/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-certificate-validation@v1.0 defects=1} | ||
| // Noncompliant: ssl verification is disabled | ||
| use openssl::ssl::{SslMethod, SslConnectorBuilder, SSL_VERIFY_NONE}; | ||
| let mut connector = SslConnectorBuilder::new(SslMethod::tls()).unwrap(); | ||
| connector.builder_mut().set_verify(SSL_VERIFY_NONE); | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-error-handling@v1.0 defects=0} | ||
| // Compliant: `?` operator enables more structured and graceful error handling | ||
| let mut f = std::fs::File::open(filename)?; | ||
| let mut buf = Vec::new(); | ||
| // {/fact} |
10 changes: 10 additions & 0 deletions
10
rust/src/detectors/improper-error-handling/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-error-handling@v1.0 defects=1} | ||
| // Noncompliant: Usage of `unwrap()` to handle the result of `File::open()` | ||
| let mut f = std::fs::File::open("../monsterdata_test.mon").unwrap(); | ||
| let mut buf = Vec::new(); | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-input-validation@v1.0 defects=0} | ||
| // Compliant: Used `from_utf8` to get valid UTF-8 data | ||
|
|
||
| let input_bytes: &[u8] = b"Hello, world!"; | ||
|
|
||
| fn process_input(input_bytes: &[u8]) -> Result<&str, str::Utf8Error> { | ||
| let input_str = str::from_utf8(input_bytes)?; | ||
| Ok(input_str) | ||
| } | ||
| // {/fact} |
17 changes: 17 additions & 0 deletions
17
rust/src/detectors/improper-input-validation/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-input-validation@v1.0 defects=1} | ||
| // Noncompliant: from_utf8_unchecked can cause invalid UTF-8 data | ||
|
|
||
| use std::str; | ||
|
|
||
| let input_bytes: &[u8] = b"Hello, world! \xF0"; | ||
| fn process_input_unchecked(input_bytes: &[u8]) -> &str { | ||
| unsafe { | ||
| str::from_utf8_unchecked(input_bytes); | ||
| } | ||
| } | ||
| // {/fact} |
16 changes: 16 additions & 0 deletions
16
rust/src/detectors/improper-size-of-a-memory-buffer/compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-size-of-a-memory-buffer@v1.0 defects=0} | ||
| // Compliant: Buffer initialized with size | ||
|
|
||
| fn compliant(file_path: &str, buffer: &mut Vec<u8>) -> io::Result<()>{ | ||
| let mut file = File::open(file_path)?; | ||
| let file_size = file.metadata()?.len() as usize; | ||
| buffer.reserve(file_size); | ||
| file.read_to_end(buffer)?; | ||
| Ok(()) | ||
| } | ||
| // {/fact} |
17 changes: 17 additions & 0 deletions
17
rust/src/detectors/improper-size-of-a-memory-buffer/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=improper-size-of-a-memory-buffer@v1.0 defects=1} | ||
| // Noncompliant: Buffer is not initialized with size | ||
|
|
||
| use std::fs::File; | ||
| use std::io::{self,Read}; | ||
|
|
||
| fn nonCompliant(file_path: &str, buffer: &mut Vec<u8>) -> io::Result<()>{ | ||
| let mut file = File::open(file_path)?; | ||
| file.read_to_end(buffer)?; | ||
| Ok(()) | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=incomplete-cleanup@v1.0 defects=0} | ||
| // Compliant: `match` statement to handle the result of the `TcpListener::bind("127.0.0.1:8080")` operation | ||
|
|
||
| use std::net::{TcpListener, TcpStream}; | ||
|
|
||
| fn compliant() { | ||
| let listener = match TcpListener::bind("127.0.0.1:8080") { | ||
| Ok(listener) => listener, | ||
| Err(e) => { | ||
| eprintln!("Failed to bind: {}", e); | ||
| return; | ||
| } | ||
| }; | ||
| } | ||
| // {/fact} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=incomplete-cleanup@v1.0 defects=1} | ||
| // Noncompliant: Calling `unwrap()` will cause the program to panic immediately | ||
|
|
||
| use std::net::{TcpListener, TcpStream}; | ||
|
|
||
| fn noncompliant() { | ||
| let listener = TcpListener::bind("127.0.0.1:8080").unwrap(); | ||
| } | ||
| // {/fact} |
17 changes: 17 additions & 0 deletions
17
rust/src/detectors/incorrect-conversion-of-numeric-types/compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=incorrect-conversion-of-numeric-types@v1.0 defects=0} | ||
| // Compliant: verify that the resulting rounded value | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. recheck this sentence, unclear what you wanted to conevey |
||
| fn try_floor_u64(value: f64) -> Option<u64> { | ||
| let mut rug_float = rug::Float::with_val(53, value); | ||
| rug_float = rug_float.floor(); | ||
| if rug_float >= 0.0 && rug_float <= u64::MAX as f64 { | ||
| Some(rug_float.to_u64().unwrap()) | ||
| } else { | ||
| None | ||
| } | ||
| } | ||
| // {/fact} | ||
13 changes: 13 additions & 0 deletions
13
rust/src/detectors/incorrect-conversion-of-numeric-types/non-compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=incorrect-conversion-of-numeric-types@v1.0 defects=1} | ||
| // Noncompliant: not verify that the resulting rounded value | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. recheck this sentence, unclear what you wanted to conevey |
||
|
|
||
| fn try_round_u64(value: f64) -> Option<u64> { | ||
| Some(value.round() as u64) | ||
| } | ||
|
|
||
| // {/fact} | ||
14 changes: 14 additions & 0 deletions
14
rust/src/detectors/inherently-dangerous-function/compliant.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| // {fact rule=inherently-dangerous-function@v1.0 defects=0} | ||
| // Compliant: attempts to prevent dereferencing a null pointer | ||
| unsafe fn compliant2() { | ||
| let ptr: *const i32 = std::ptr::null(); | ||
| if !ptr.is_null() { | ||
| let val = unsafe { *ptr }; | ||
| } | ||
| } | ||
| // {/fact} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line "// ruleid: rust-race-condition-remove-dir-all"