Skip to content
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

Add tests for macro-based impls #28561

Closed
Manishearth opened this issue Sep 21, 2015 · 2 comments
Closed

Add tests for macro-based impls #28561

Manishearth opened this issue Sep 21, 2015 · 2 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@Manishearth
Copy link
Member

A lot of impls for primitives in libcore are done via macros, in lieu of variadic generics. This is done for tuples, function pointers, and arrays.

However, tweaking these macros can sometimes lead to regressions like these (caused by this tweak).

We should have some run-pass tests that ensure that the relevant traits are indeed implemented. Something like

#[derive(Copy,Clone, Eq,PartialEq,Hash,Ord,Debug)]
struct Fn {
    fn0: fn(),
    fn1: fn(u8),
    fn2: fn(u8, u8),
    ...
    fn12: fn(u8, u8, u8 ....)
}

for fn, and similar for the other macro-impld primitives.

@Manishearth Manishearth added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Sep 21, 2015
@Manishearth
Copy link
Member Author

@apasel422 Interested in working on this?

@apasel422
Copy link
Contributor

@Manishearth Sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants