impl_trait_in_bindings doesn't interact well with associated types yet #69476
Labels
A-associated-items
Area: Associated items (types, constants & functions)
C-bug
Category: This is a bug.
F-impl_trait_in_bindings
`#![feature(impl_trait_in_bindings)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9aed9cb362dff5db78c7af96567f31ee
I expected to see this happen: It compiles.
Instead, this happened: Compiler error:
Btw, this is an abbreviated version of a real world use case of using
impl_trait_in_bindings
.Btw, this compiles:
static ARR: [impl Fn(i32) -> i32; 1] = [|x| x];
But this
static ARR: [impl Fn(i32) -> i32; 0] = [];
gives another error:https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=09044d61d101f3ac849534eb9978e7c3
But IMO it should also compile.
The text was updated successfully, but these errors were encountered: