-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for improving min_const_generics
test coverage
#78433
Comments
supertraits + dyn type upcasting with supertraits in #78478. |
…aits, r=lcnr Add const generics tests for supertraits + dyn traits. Partially addresses rust-lang#78433
I ended up implementing pretty much everything that was still left over in #78916 so it does seem like my help request in #65819 was a bit unnecessary 😅 Thanks to everybody who both helped or wanted to help here, in case you are still interested in helping out in the future, feel free to join the #project-const-generics steam on zulip (https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics) |
extend const generics test suite should implement most of rust-lang#78433, especially all parts of [the hackmd](https://hackmd.io/WnFmN4MjRCqAjGmYfYcu2A?view) which I did not explicitly mention in that issue. r? `@varkor`
…ror, r=lcnr Test default values for const parameters. The last topic on rust-lang#78433 I originally intended to place these tests in a single file, however, due to them being parser errors that are fatal, they must be in separate files to be detected. Thanks, `@lcnr` for mentoring me on this PR. r? `@lcnr`
extend const generics test suite should implement most of rust-lang#78433, especially all parts of [the hackmd](https://hackmd.io/WnFmN4MjRCqAjGmYfYcu2A?view) which I did not explicitly mention in that issue. r? ``@varkor``
…ror, r=lcnr Test default values for const parameters. The last topic on rust-lang#78433 I originally intended to place these tests in a single file, however, due to them being parser errors that are fatal, they must be in separate files to be detected. Thanks, ``@lcnr`` for mentoring me on this PR. r? ``@lcnr``
With the merger of #78960, is this complete? |
yes, it is 🎉 |
This is a tracking issue for improving the test coverage of
feature(min_const_generics)
.We collected a collection of interesting test cases in a hackmd and
now have to design these tests and add them to the test suite.
Topics
For more info about these topics you can also look at the above hackmd which elaborates a bit more for some of them
rustdoc
One interested fairly self-contained topic is probably rustdoc. We pretty much want tests for values 7, params N, associated consts fn test() -> [u8; Type::ASSOC] and more complex expressions (ConstKind::Unevaluated) 3 + 4 in different positions, like ret + arg impl trait, async fn ret + impl position, type alias, and defined inside of macros. Probably also nice to test reexports and usage of associated consts defined in a different crate. Consider also adding one test for a constant which contains a lot of weird stuff, like struct definitions and so on to see how that looks
default values for const parameters should error (claimed by @ethanboxx)
I think this only needs one test which tries to use something like const N: usize = 23 and const N = 27: usize to check that the error is at least somewhat readable
ordering of const parameters (only after types)
@JulianKnodt already added quite a few tests for that, so this is probably already good enough. At least I can't think of anything missing here
supertraits + dyn type upcasting with supertraits (claimed by @hameerabbasi, added in Add const generics tests for supertraits + dyn traits. #78478)
This requires some knowledge about how all of this should work but is probably quite interesting to think about.
trait methods trait Foo { fn bar() }
I think that's already fairly well tested thanks to the interaction with type dependent paths, at least I can't think of anything specific we are still missing here
associated type bounds
hopefully one run-pass and one or two compile fail tests are enough here
invalid bool and char bit-pattern (claimed by @JulianKnodt)
A test which tries to for example use 7 as a bool and 0xFF as a char
macros (claimed by @JulianKnodt, added in Add macro test for min-const-generics #78912)
hopefully fairly self-contained, try defining a #[macro_export] macro inside of a const (which can be inside of async fn or impl trait or a repeat expression)
I think these are the more self-contained topics, for everything else it's probably easiest for someone - I expect and want this to be me - to just spend a few hours mixing stuff until it either breaks or there is a high confidence that it does not break.
The text was updated successfully, but these errors were encountered: