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

Use revisions to test min_const_generics #75279

Closed
lcnr opened this issue Aug 8, 2020 · 5 comments · Fixed by #76514 or #76599
Closed

Use revisions to test min_const_generics #75279

lcnr opened this issue Aug 8, 2020 · 5 comments · Fixed by #76514 or #76599
Labels
A-const-generics Area: const generics (parameters and arguments) A-testsuite Area: The testsuite used to check the correctness of rustc E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. F-const_generics `#![feature(const_generics)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Aug 8, 2020

cc #74878

#74877 implemented feature(min_const_generics) which is split off from feature(const_generics).

As these two features have some meaningful differences it is desirable to run try and run all const generics tests with both features.

This can be done usingrevisions. Some tests were already updated in #74877:

// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995.
// revisions: full min
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
#![cfg_attr(min, feature(min_const_generics))]
#![crate_type = "lib"]
use std::marker::PhantomData;
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
//~^ ERROR: use of non-static lifetime `'a` in const generic
//[min]~| ERROR: using `&'static str` as const
impl Bug<'_, ""> {}

If you want to work on this feel free to ask for help here or on zulip.

@lcnr lcnr added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` F-min_const_generics labels Aug 8, 2020
@JohnTitor JohnTitor added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 8, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 13, 2020
Add a bunch of const-generic revisions for `min_const_generics`

This adds a bunch of revisions to `const-generic` tests which is part of rust-lang#75279, but doesn't cover everything.

r? @lcnr
@Amjad50
Copy link
Contributor

Amjad50 commented Aug 26, 2020

I'll work on part of it

matklad added a commit to matklad/rust that referenced this issue Aug 31, 2020
…visions, r=lcnr

Added some `min_const_generics` revisions into `const_generics` tests

Help in rust-lang#75279. still a lot more to cover though

r? @lcnr
@bors bors closed this as completed in 7565ccc Sep 10, 2020
@Amjad50
Copy link
Contributor

Amjad50 commented Sep 10, 2020

Are all the tests done? Or is this being closed because of using the word "fixes" in #76514 ?

@lcnr
Copy link
Contributor Author

lcnr commented Sep 11, 2020

because of the keyword "fixes". Don't think that all tests have been migrated yet

@lcnr lcnr reopened this Sep 11, 2020
@hameerabbasi
Copy link
Contributor

hameerabbasi commented Sep 11, 2020

I migrated all of the relevant tests I could find. I could go back and look.

There are a few that simply didn't need revisions. Examples include things that test for the features being unstable and that const_generics and min_const_generics cannot be used together.

I changed "partially addresses" to "fixes" only when I believed I'd gotten through all of them.

@hameerabbasi
Copy link
Contributor

I missed type_dependent and const_evaluatable_checked. I apologize for the confusion. PR incoming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-testsuite Area: The testsuite used to check the correctness of rustc E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. F-const_generics `#![feature(const_generics)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
4 participants