refactor: Remove -Awarnings from snapshot tests and fix fix_unused_unsafe test#1603
refactor: Remove -Awarnings from snapshot tests and fix fix_unused_unsafe test#1603randomPoison merged 3 commits intomasterfrom
-Awarnings from snapshot tests and fix fix_unused_unsafe test#1603Conversation
-Awarnings from snapshot tests and restore fix_unused_unsafe test-Awarnings from snapshot tests and restore fix_unused_unsafe test
-Awarnings from snapshot tests and restore fix_unused_unsafe test-Awarnings from snapshot tests and fix fix_unused_unsafe test
kkysen
left a comment
There was a problem hiding this comment.
Ahh, that's what was happening. I added -Awarnings because when c2rust-refactor runs rustc, a ton of warnings are printed and these were very noisy (c2rust transpile emits code with a ton of warnings). cargo test shows all of these and doesn't capture the output for some reason like it normally does. However, cargo nextest run does, so it's not that big of an issue if we're using that. So I think removing -Awarnings is okay here.
Could you add to fix_unused_unsafe's docs that it relies on the warnings? That's unexpected, so it's useful to know and call that out.
|
Ah yeah, if I run |
kkysen
left a comment
There was a problem hiding this comment.
LGTM except for the one minor nit.
Co-authored-by: Khyber Sen <kkysen@gmail.com>
So turns out the reason
fix_unused_unsafewasn't working is because we were suppressing warnings, and the transform relies on the warning analysis to determine what unsafe is unused. I don't really like this, but it doesn't seem like removing-Awarningsbreaks anything, and I don't think it's worth building our own unused-unsafe analysis to avoid this.@kkysen what was the reason for having
-Awarningsin there to begin with? Is removing that going to cause any problems I'm not seeing?