-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
1.67 regression with ……::{opaque#0}<'_> does not live long enough
error
#107516
Comments
……::{opaque#0}<'_>
does not live long enough` error
……::{opaque#0}<'_> does not live long enough
error
……::{opaque#0}<'_> does not live long enough
error
……::{opaque#0}<'_>` does not live long enough
error
……::{opaque#0}<'_>` does not live long enough
error
……::{opaque#0}<'_> does not live long enough
` error
……::{opaque#0}<'_> does not live long enough
` error……::{opaque#0}<'_> does not live long enough
error
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical |
(I'm planning to do a MCVE hunt for this after I take care of a beta- and stable-backport that is slightly higher priority.) |
Perhaps this is obvious, but to avoid any wasted time, I’ll rather write the remark than not: While reducing/minimizing – given the experience described in #107426 (comment) – make sure to keep an eye on that the regression point doesn’t shift 🐱 |
Ah, guess I should note that @cjgillot has not been tagged here. I may work on MCVE here, but they know that PR best. edit: nvm, steffahn did tag them. Ignore me 😄 |
Partially minimized: #[derive(Debug)]
struct QuoteMatcher<'a>(&'a Vec<String>);
impl<'a> QuoteMatcher<'a> {
fn intermediates(&'a self) -> impl Iterator<Item = Intermediate> + 'a {
self.0.iter().enumerate().flat_map(move |(ix, string)| {
let splitter = new_quote_splitter(&string).events();
EachSplitter::Splitter { index: ix, splitter, seen_any: Some(false) }
})
}
}
impl<'a, I: Iterator<Item = (usize, char)>> QuoteSplitter<'a, I> {
fn events(self) -> impl Iterator<Item = Event<'a>> {
self.flat_map(|x| x)
}
}
#[derive(Debug)]
enum EachSplitter<'a, I: Iterator<Item = Event<'a>> + 'a> {
Splitter { splitter: I, seen_any: Option<bool>, index: usize },
}
impl<'a, I: Iterator<Item = Event<'a>>> Iterator for EachSplitter<'a, I> {
type Item = Intermediate;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
struct Event<'a>(&'a str);
struct Intermediate;
fn leaning_text(node: &str, rightmost: bool) -> Option<&str> {
todo!()
}
#[derive(Debug)]
struct QuoteSplitter<'a, I: Iterator<Item = (usize, char)> + 'a> {
string: &'a str,
possibles: I,
}
fn new_quote_splitter<'a>(
string: &'a str,
) -> QuoteSplitter<'a, impl Iterator<Item = (usize, char)> + 'a> {
QuoteSplitter {
string,
possibles: string.char_indices().filter(|_| true),
}
}
impl<'a, I: Iterator<Item = (usize, char)>> Iterator for QuoteSplitter<'a, I> {
type Item = Thingo<'a>;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
struct Thingo<'a>(&'a ());
impl<'a> Iterator for Thingo<'a> {
type Item = Event<'a>;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
fn main() {} |
Would someone from @rust-lang/types be able to investigate this regression a bit? Thanks! 🙂 |
Minimized further: type It = u32;
fn iter<'a: 'a>() -> impl Iterator<Item = &'static It> {
[].into_iter()
}
struct Bivar<'a, I: Iterator<Item = &'a It> + 'a>(I);
fn main() {
|| {
Bivar(iter())
};
} (edit: pnkfelix took liberty of updating the example so that it is more clearly a regression, in terms of having something that successfully compiles on sufficiently old compilers.) |
Hmm. I get errors from @aliemjay 's example even on old compilers, of the form:
The easiest way to sidestep this is to revise the supposed MCVE with one that uses a sized type, like |
@pnkfelix I was also having trouble, but all it takes is edition 2021 |
Oh yeah, this is the Array::into_iter thing I bet, okay. |
Discussed in https://users.rust-lang.org/t/rust-1-67-lifetime-error-compiles-with-1-66-what-changed/88483 and described on zotero/citeproc-rs#154. I can reproduce a regression in 1.67.0 using the current latest commit “
2ab195a1e6f84f0ff284813ece61dc62096abbfe
” in thezotero/citeproc-rs
repo.This issue was first incorrectly thought of as a sort of “duplicate” of #107426, since that issue originally claimed a 1.67 regression, too, but actually regressed in 1.66, and on a deliberate soundness fix (#95474).
However, bisection of the above-mentioned commit on
citeproc-rs
points to a different PR, that isSelf
or projections inside an RPIT/async fn #103491Glancing at it, that PR does not look like it’s supposed to break anything. @rustbot label regression-from-stable-to-stable, T-compiler, E-needs-mcve
Compilation error
bisection
The text was updated successfully, but these errors were encountered: