Lifetime error returning reference to associated type from trait with const generic parameter. #71547
Labels
A-const-generics
Area: const generics (parameters and arguments)
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
F-adt_const_params
`#![feature(adt_const_params)]`
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=5638c99e5d0c0c6af0b5fd8773cefffb
I expected the code to compile successfully(like it did in previous nightly versions)
Instead, the code failed to compile with this error:
Meta
Tried this on rustc 1.44.0-nightly (2020-04-24 3360cc3)
The way I work around this bug is to write the function like this:
The text was updated successfully, but these errors were encountered: