Skip to content

feat: highlight unsafe operations #19687

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

Merged
merged 4 commits into from
May 18, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor: format
  • Loading branch information
gohome001 committed Apr 25, 2025
commit 1d4602e2b08997e2c555fb5f00f9c816fcce6738
10 changes: 4 additions & 6 deletions crates/ide/src/highlight_related.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,24 +816,22 @@ mod tests {
check(
r#"
fn foo() {
unsafe fn this_is_unsafe_function() {
}
unsafe fn this_is_unsafe_function() {}
unsa$0fe {
//^^^^^^
let raw_ptr = &42 as *const i32;
let val = *raw_ptr;
//^^^^^^^^
let mut_ptr = &mut 5 as *mut i32;
*mut_ptr = 10;
//^^^^^^^^
this_is_unsafe_function();
//^^^^^^^^^^^^^^^^^^^^^^^^^
}
}
"#,
);
Expand Down