Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion c2rust-refactor/src/transform/funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ impl Transform for ToMethod {
///
/// Usage: `fix_unused_unsafe`
///
/// Find unused `unsafe` blocks and turn them into ordinary blocks.
/// Find unused `unsafe` blocks and turn them into ordinary blocks. This relies
/// on the compiler's `#[warn(unused_unsafe)]` warnings, and will not work with warnings
/// suppressed.
pub struct FixUnusedUnsafe;

impl Transform for FixUnusedUnsafe {
Expand Down
2 changes: 1 addition & 1 deletion c2rust-refactor/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn test_refactor_named(command: &str, path: &str) {
let edition = "2021";

let old_path = old_path.to_str().unwrap();
let rustc_args = [old_path, "--edition", edition, "-Awarnings"];
let rustc_args = [old_path, "--edition", edition];

lib_main(Options {
rewrite_modes: vec![OutputMode::Alongside],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ fn main() {
let _safe_val = *ptr;
}

unsafe {
{
let x = 42;
}

unsafe {}
{}

let _ = unsafe { 5 + 5 };
let _ = { 5 + 5 };
}