Closed jackh726 closed 2 months ago
@jackh726 I would like to give this a shot, any hints on where I could begin
@sladyn98 sure!
Okay, so we have a concept of known-bug
tests. Here's an example: https://github.com/rust-lang/rust/blob/18a6d911caba59605eb03db1452848a85d2e5879/tests/ui/coherence/coherence-overlap-negative-impls.rs
Note the // known-bug: #101350
at the top. There is also // check-pass
, which means that this test currently passes under during check (though that test shouldn't pass, hence the known-bug)
The goal for this issue is to go through the open I-unsound issues (https://github.com/rust-lang/rust/issues?page=1&q=is%3Aopen+is%3Aissue+label%3AI-unsound), identify a minimal reproduction that shouldn't pass, but does, and add a known-bug
test for each one.
Nearly all of the issues should have a minimal repro in the comments somewhere, so I would start with those. Tests should go in src/test/ui
in an appropriate directory. Test names should likely be meaningful compared to the open issue. Any comments at the top of the file briefly explaining the problem would also be helpful.
Let me know if that helps!
https://github.com/rust-lang/rust/issues/105084 I found this issue, and planning to a PR with a known test bug
is there anything a new contributor can do for this? any help still needed @sladyn98 @jackh726
My previous comment still applies; there haven't been any PRs opened for this.
If anything is confusing, please let me know.
If it helps, the listing I was able to scrape is:
TypeId
collisions)rg
ing for the list of I-Unsound issues makes it seem that there're no tests for any of these ATM, so I left them unpopulated. I added a few tests while I was in the area, which I'll build a PR for now. :)
NOTE: #105084 is already added
Big thanks to @gburgessiv for the big checklist! Very useful.
@jackh726 Thanks for adding the test labels and updating the issue. Looking through the remaining issues, I'm a bit lost for most of these.
I'm comfortable adding tests where the mcve compiles but shouldn't, but I'm wondering what to do for mcves that don't quite follow this pattern or have other variations: multiple crates, llvm/asm/etc, panic/warning/error, etc.
Below, I've organized the remaining issues as I see them, hopefully useful for other contributors as well. (Currently only 44 issues in my list vs 55 actual, so missing 11 issues as of 2023.04.28)
Let me know if there's anything else sort of bookkeeping that would be useful here.
Wondering if the specialization tracking issue (issue 31844) needs a test, since it's sort of multiple issues in 1 issue.
Okay, so we have a concept of
known-bug
tests. Here's an example:
That link is dead.
I'm also not sure I understand what to do with the MCVEs. Are they to be used for writing the tests?
That link is dead.
Fixed
I'm also not sure I understand what to do with the MCVEs. Are they to be used for writing the tests?
The test is essentially the MCVE, with some comments describing the issue.
For a somewhat different approach, there is a pull request for a clippy lint for three of these issues #25860 #84591 and #100051 :
https://github.com/rust-lang/rust-clippy/pull/12471
The lint looks for nested references and suggests to add a lifetimes bound that is implied by the nested reference. After adding this bound, the compiler currently gives an error message. Since the added bound is implied, the error message should have been given before adding it.
I'm going to go ahead and close this. While there are still many issues (75 as of writing this!) that don't have a known-bug test, I don't expect keeping this issue open to meaningful make progress on reducing that number.
The remaining relevant issues are mixed in the reasoning for why they don't have a known-bug test, but it's most often because either 1) there is no MCVE because the unsoundness is either "theoretical" or just hard to test, or 2) the unsoundness is only for some select targets.
Thanks all who've helped make progress on this though!
I'll come back at some point and create an actual list. However, we should aim to add
known-bug
tests (or work to finding MCVEs) for all the I-unsound issues.The list of issues remaining: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AI-unsound+-label%3AS-bug-has-test+
The list of completed issues: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AI-unsound+label%3AS-bug-has-test+