RPITIT causes incorrect "dropped while still borrowed" error in some cases #131490
Labels
C-bug
Category: This is a bug.
F-return_position_impl_trait_in_trait
`#![feature(return_position_impl_trait_in_trait)]`
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
From this SO question, the following code does not compile:
However, boxing the iterator as a trait object allows it to compile:
Notably, not cloning
self.x
and simply returningself.x.owned_iter()
also works.I don't see any reason why the first code block shouldn't compile, especially while the boxed version and the non-cloning version do.
Meta
rustc --version --verbose
:It also fails to compile on 1.83.0-nightly (2024-10-09 eb4e234).
The text was updated successfully, but these errors were encountered: