Skip to content
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

Rust 1.67 won't compile citeproc-rs (lifetime error) #154

Open
jblachly opened this issue Jan 31, 2023 · 2 comments · May be fixed by #155
Open

Rust 1.67 won't compile citeproc-rs (lifetime error) #154

jblachly opened this issue Jan 31, 2023 · 2 comments · May be fixed by #155

Comments

@jblachly
Copy link

Rust 1.66 compiles citeproc-rs just fine. (rustup run 1.66 cargo build)

Rust 1.67 (https://github.com/rust-lang/rust/blob/master/RELEASES.md) can't compile sub module io due to a lifetime error:

$ rustup run 1.67 cargo build
...
   Compiling citeproc-io v0.1.0 (/private/tmp/citeproc-rs/crates/io)
error: `QuoteSplitter<'_, impl Iterator<Item = (usize, char)> + '_>::events::{opaque#0}<'_>` does not live long enough
   --> crates/io/src/output/parse_quotes.rs:419:47
    |
419 |                 | MicroNode::Formatted(..) => EachSplitter::Index(Some(ix)),
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: `QuoteSplitter<'_, impl Iterator<Item = (usize, char)> + '_>::events::{opaque#0}<'_>` does not live long enough
   --> crates/io/src/output/parse_quotes.rs:430:21
    |
430 | /                     EachSplitter::Splitter {
431 | |                         index: ix,
432 | |                         splitter,
433 | |                         seen_any: Some(false),
434 | |                     }
    | |_____________________^

error: could not compile `citeproc-io` due to 2 previous errors
@jblachly
Copy link
Author

jblachly commented Jan 31, 2023

Discussion question posted here: https://users.rust-lang.org/t/rust-1-67-lifetime-error-compiles-with-1-66-what-changed/88483

Likely offending rustc change is here: rust-lang/rust#95474 although this supposedly was merged into 1.66, but compiling doesn't break until 1.67

@cormacrelf
Copy link
Collaborator

Thanks for reporting. This is a one-liner fix, fortunately. Discussion in those threads will go on since it should have been caught by 1.66, but that's rustc's problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants