-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
New reached the type-length limit while instantiating
error appearing on 1.81.0-nightly (aa1d4f682 2024-07-03)
#127346
Comments
The error in the CI logs I read is:
I think it started in #125507 and it seems to be intended as it is labeled with (is the above correct @compiler-errors ?) @rustbot label -I-prioritize -regression-untriaged +T-types |
@TheLostLambda: you should probably just add |
@compiler-errors Wait until you see what I got from the other crate in my project: In all seriousness though, I don't think I've been doing anything particularly unusual, but I think that Perhaps more importantly, even after adding those attributes, I can't get It also still fails to build on CI: https://github.com/TheLostLambda/pg-pipeline/actions/runs/9818433944/job/27110969365 EDIT: Seeing the workaround that rust-itertools/itertools#945 used to fix one of the |
The attributes need to be applied in the crate which is being compiled, not the crate that contains the offending span. The diagnostic makes this a bit confusing.
In this case, the attribute needs to be added to After applying this diff, diff --git a/src/bin/molmass.rs b/src/bin/molmass.rs
index 8e90189..f2c47ac 100644
--- a/src/bin/molmass.rs
+++ b/src/bin/molmass.rs
@@ -1,3 +1,5 @@
+#![type_length_limit = "18554191"]
+
use miette::{Diagnostic, GraphicalReportHandler, GraphicalTheme};
use once_cell::sync::Lazy;
use polychem::{AtomicDatabase, Charged, ChargedParticle, ChemicalComposition, Massive, Result};
diff --git a/src/bin/pgmass.rs b/src/bin/pgmass.rs
index 71efb62..4f02b8e 100644
--- a/src/bin/pgmass.rs
+++ b/src/bin/pgmass.rs
@@ -1,3 +1,5 @@
+#![type_length_limit="30491060267835378"]
+
use miette::{Diagnostic, GraphicalReportHandler, GraphicalTheme};
use muropeptide::{Muropeptide, Result};
use once_cell::sync::Lazy; |
@saethlin I see! I do agree that's a bit unclear from the compiler diagnostic, and it would be nice to somehow replace the "your crate" with a more specific location in cases like these (especially when it's something a bit sneaky like a binary)! Either way, thank you for the fix in my case, and I'll try to keep up with the conversation in #125507 — Let me know if there is anything more I can do to help! EDIT: Additionally, when it comes to improving the diagnostic (and I don't know how feasible this is), it might be nice if you were given the final size needed, instead up updating the limit once to get another error with a larger limit, then repeating until the errors stop. |
I've had to continue to add more |
Some of my CI started failing today, but only for the workflows relying on the
nightly
toolchain — you can get a closer look at the error and the code causing it here (as well as see that things work fine onstable
still):https://github.com/TheLostLambda/pg-pipeline/actions/runs/9800551201
Version it worked on
Version with regression
@rustbot modify labels: +regression-from-stable-to-{nightly} -regression-untriaged
The text was updated successfully, but these errors were encountered: