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

Unable to build helix-lsp on latest nightly: reached the type-length limit while instantiating helix_parsec::or #11111

Closed
RossSmyth opened this issue Jul 8, 2024 · 2 comments

Comments

@RossSmyth
Copy link
Contributor

RossSmyth commented Jul 8, 2024

The latest nightly (154fdac39 2024-07-07) no longer is able to compile Helix. This is still being triaged upstream but I am filing this issue to track it here and ensure Helix users are aware of it.

These are the lines that fail:

let parser = choice!(
tabstop(),
placeholder(),
choice(),
variable(),
map("$", |_| SnippetElement::Text("$".into())),
map(text(escape_chars, term_chars), SnippetElement::Text),
);

With the error:

error: reached the type-length limit while instantiating `helix_parsec::or::<'_, {closure@helix_parsec::map<'_, (&str, {closure@helix_parsec::filter_map<'_, ..., ..., ...>::{closure#0}}, ..., ..., ...), ..., ...>::{closure#0}}, ..., ...>`
   --> helix-lsp\src\snippet.rs:429:26
    |
429 |               let parser = choice!(
    |  __________________________^
430 | |                 tabstop(),
431 | |                 placeholder(),
432 | |                 choice(),
...   |
435 | |                 map(text(escape_chars, term_chars), SnippetElement::Text),
436 | |             );
    | |_____________^
    |
    = help: consider adding a `#![type_length_limit="28949205"]` attribute to your crate
    = note: the full type name has been written to 'C:\Users\rsmyth\AppData\Local\helix\target\release\deps\helix_lsp-8d2cb44db19181ec.long-type.txt'
    = note: this error originates in the macro `choice` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `helix-lsp` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `helix-term v24.3.0 (C:\Users\rsmyth\AppData\Local\helix\helix-term)`, intermediate artifacts can be found at `C:\Users\rsmyth\AppData\Local\helix\target`.

rust-lang/rust#125507

@RossSmyth
Copy link
Contributor Author

It may also be a good idea to consider moving away from the type-system recursive parser combinators that are currently used in the parsec crate as they are heavy on rustc

@RossSmyth RossSmyth changed the title Unable to build helix-lsp on latest nightly Unable to build helix-lsp on latest nightly: reached the type-length limit while instantiating helix_parsec::or Jul 15, 2024
@RossSmyth
Copy link
Contributor Author

Builds again in the latest nightly after rust-lang/rust#127670

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

No branches or pull requests

1 participant