-
Notifications
You must be signed in to change notification settings - Fork 0
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
Broken on latest nightlies (regression on 2020-06-04) #1
Comments
Aha! Cargo reads the I'll try devising a workflow for this. |
I pushed rustc build tooling to the
The first time you run the script the first step will take a long time (your threadripper should help). When I run that command it successfully runs all 19 tests and then emits a compiler error during the doc-test phase:
This suggests using the One potential explanation is the docker images are getting EDIT: For completeness, I also included a EDIT 2: |
The There is some discussion of the issue here. Tracing through the changes that were made and the rationale behind them (which I don't fully agree with), I'm not sure a PR which restores the prior behavior would be accepted, unfortunately. |
I agree, it seems like getting features to support this use case, let alone their stabilization, may not be attainable. If we don't pursue compiler changes, this leaves us with:
What you're doing here reminds me a lot of the sort of code implemented in theorem provers. They'll use type-level encodings of natural numbers to help prove relations like your range invariants. A common way to do that is with a unary encoding where some type represents zero and another type represents the successor (+1) of another encoded number. Here's a small demo. It doesn't compile, but maybe the idea is enough to help you figure more out. You're probably horrified about space and time overhead of this representation. It's brutal, but the hope is all of that overhead could be confined to compile-time, and there would be no overhead at runtime. My understanding is the standard It may work to port this to a language like Idris, expose a C-compatible interface for it, and then implement a library wrapper for it in Rust. |
Users of this crate would need to know at compile-time exactly what ranges they'll need. Do you have a list of ranges you'll need for your project? Maybe that would help us find some reasonable compromises. |
I found a workaround which may be enough to move toward a release. It's not as satisfying as what you were aiming for, but it works. See U007D/arranged@b196cf7 ( EDIT: the branch name is a misnomer. Originally I was going to use a proc-macro, but realizes macro_rules would suffice. |
Looks like you may have resolved this with your recent push. I haven't verified it myself yet and can't right now, but feel free to close this if it's all set. |
Bumping the rust version in
rust-toolchain
by one day causes the crate to fail with compile-time errors like this:This reproduces with the recent
nightly-2020-12-15
release as well.What changed?
Here are the rustc git revisions associated with 2020-06-03 and 2020-06-04 nightly releases:
Here's what changed over that range of commits: rust-lang/rust@fe10f1a...56daaf6.
The following stick out to me, although I haven't yet traced any concrete connection between any particular change and the regression here. Some test files include similar error messages with strings like
constant expression depends on a generic parameter
andthis may fail depending on what value the parameter takes
, but the text must have already existed in the compiler's source:Both come from the rust-lang/rust#70107 PR.
Potential Solutions
rustc
and convince the community to adopt itIn either case it may be insightful to further isolate exactly what change(s) caused the regression and whether undoing them on top of a
56daaf669
build fixes it. To do that I'd need to figure out how to persuade cargo/rustup to use a custom-built rustc.The text was updated successfully, but these errors were encountered: