-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
where clause in generic associated types causes no output #47206
Copy link
Copy link
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsP-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm working on implementing generic associated types in the compiler with mentoring by @nikomatsakis. He recently discovered an interesting issue that we're haven't found the source of yet. It seems that having a where clause like the one below results in a compilation error but no output.
The feature isn't actually fully finished yet, so we expect a compilation error. It just isn't clear why the compiler isn't actually reporting any specific problems. The message says that it failed due to a previous error but doesn't list any errors at all.
Here's the code that reproduces the issue: (Playground link)
Here's the output:
This is on the nightly compiler because the feature is gated while we're still working on it. If you try to run this on stable or beta, you get a normal error message.
If you delete the
where T: Iteratoryou get an ICE which I think is expected given what I still have left to implement for the generic associated types feature.It might be that this gets fixed while we keep implementing generic associated types. Creating this issue will make sure that this doesn't get forgotten along the way.