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

The "reached type-length limit" error is not very helpful #62495

Open
lovasoa opened this issue Jul 8, 2019 · 1 comment
Open

The "reached type-length limit" error is not very helpful #62495

lovasoa opened this issue Jul 8, 2019 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Jul 8, 2019

This issue is close to #58952, but I think it's different. Feel free to close it if I'm mistaken.

The issue

Here is the code I am trying to compile: lovasoa/seamcarving @ f6be585.
The compilation fails with :

error: reached the type-length limit while instantiating `<std::iter::Once<u32> as std::it...ving::seamfinder::SeamElem), !>>`

The issue probably comes from my code, and not from the compiler, but the compiler makes it quite difficult to debug !

The compiler error does not point to a precise place in the code, and does not even print the full name of the type it is trying to instantiate. I only know that is starts with <std::iter::Once<u32> as std::it and ends with ving::seamfinder::SeamElem), !>>.
Moreover, it notes :

note: consider adding a `#![type_length_limit="1814752"]` attribute to your crate

... even if the attribute is already there.

@lovasoa
Copy link
Contributor Author

lovasoa commented Jul 8, 2019

The type that reaches the limit seems to be the one of this iterator, which is generated by that function.

lovasoa added a commit to lovasoa/seamcarving that referenced this issue Jul 8, 2019
@Centril Centril added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-typesystem Area: The type system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 6, 2019
@crlf0710 crlf0710 added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants