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 test for 62220 #70539

Merged
merged 1 commit into from
Mar 29, 2020
Merged

add test for 62220 #70539

merged 1 commit into from
Mar 29, 2020

Conversation

DutchGhost
Copy link
Contributor

@DutchGhost DutchGhost commented Mar 29, 2020

Closes #62220

Adds a test for #62220.

Im not sure whether check-pass is sufficient here. I didn't put run-pass in, as I'm afraid that'll fail due to the unimplemented!() return in the code.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 29, 2020
@Centril Centril added the F-const_generics `#![feature(const_generics)]` label Mar 29, 2020
src/test/ui/const-generics/issues/issue-62220.rs Outdated Show resolved Hide resolved
#![feature(const_generics)]
pub struct Vector<T, const N: usize>([T; N]);

pub type TruncatedVector<T, const N: usize> = Vector<T, { N - 1 }>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyb @varkor Shouldn't error: constant expression depends on a generic parameter happen here or is this cause we're not applying WF for type aliases... but then why won't it happen for the usage below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not doing const WF at all except for array types, today.
#70107 aims to fix that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah; forgot that hadn't landed yet. Let's merge this PR like this then once the other comment has been addressed and we can make adjustments later in the other.

@Centril
Copy link
Contributor

Centril commented Mar 29, 2020

r? @Centril @bors r+

@bors
Copy link
Contributor

bors commented Mar 29, 2020

📌 Commit 3fa3c7a19a883ceeeecea5273520b569a959057e has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 29, 2020
@varkor
Copy link
Member

varkor commented Mar 29, 2020

@DutchGhost: could you flatten the two commits (as the second just undoes something in the first)? Thanks!

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 29, 2020
@DutchGhost
Copy link
Contributor Author

How do I flatten commits?

@varkor
Copy link
Member

varkor commented Mar 29, 2020

In this case, the easiest option is probably to do git reset HEAD~2, which will undo the last 2 commits, and then commit all the changes as one commit, then force push. In general, you can do this with an interactive rebase for more fine-grained control. See this StackOverflow question, for instance.

@Dylan-DPC-zz
Copy link

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 29, 2020

📌 Commit 61d4193 has been approved by Dylan-DPC

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 29, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 29, 2020
Rollup of 4 pull requests

Successful merges:

 - rust-lang#69702 (Rename TyLayout to TyAndLayout.)
 - rust-lang#70539 (add test for 62220)
 - rust-lang#70540 (#[link]: mention wasm_import_module instead of cfg)
 - rust-lang#70541 (prohibit_generics: update has_err for consts)

Failed merges:

r? @ghost
@bors bors merged commit 5a7b377 into rust-lang:master Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-const_generics `#![feature(const_generics)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler panics when trying to calculate layout of const generic based type
8 participants