-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ICE: compiler/rustc_metadata/src/creader.rs:136:32: Failed to get crate data for crate22 #83045
Comments
Update: I re-run the ci workflow with rustc 1.52.0-nightly (acca818 2021-03-13) multiple times today and all of which are successful without any errors.
Confirm this bug has been fixed though I am not sure which commit fixed it. |
This bug isn't fixed, and isn't macos specific, I can easily repro on the latest nightly: $ echo '' | rustc - --crate-name=a --crate-type=lib
$ echo 'extern crate a;' | rustc - --crate-name=b --crate-type=lib --extern a=liba.rlib
$ echo 'use b as _;' | rustc - --extern b=libb.rlib --edition=2018
thread 'rustc' panicked at 'Failed to get crate data for crate18', compiler/rustc_metadata/src/creader.rs:136:32 Note that this only applies to Rust 2018 imports, $ echo 'extern crate b;' | rustc - --extern b=libb.rlib
error[E0463]: can't find crate for `a` which `b` depends on
--> <anon>:1:1
|
1 | extern crate b;
| ^^^^^^^^^^^^^^^ can't find crate EDIT: a quick check reveals it doesn't repro on |
Searching again I found #83138 so I'll post my minimal repro there as well, we might want to close this issue in favor of that one? |
Here is a backtrace with line numbers (valid for Rust version eb95ace)
|
(Edited your comment - can't really use |
It looks like |
The reason I pinged @petrochenkov btw, is that this only seems to occur with Rust 2018 imports, and I recall some unfortunate details around those, like speculative loading failure modes. |
It looks like |
I plan to implement a fix for this early next week. In case a fix is more urgent than that, here are some pointers:
@eddyb's repro would make for a good regression test. I still find it weird that |
AFAIK the ICE only happens in a case where an error would otherwise be emitted (i.e. the dependency of the crate being imported with Rust 2018 style imports, being missing), so this isn't urgent, just suboptimal UX. |
Fix rust-lang#83045 by moving some crate loading verification code to a better place r? `@eddyb`
This might not be related but I found a comment mentioning this issue while looking through the code. In that case I am very sorry for the ping @eddyb @michaelwoerister This still causes an ICE in specific scenarios as I discovered here: #85386 When importing multiple things from one crate.
|
Code
This error was found when building clitrans on macos by github CI (logs). Code may be irrelevant because Ubuntu and Windows target were both successfully built and the first commit(wfxr/clitrans@57ca835) that caused this error only did some refactors on
Cargo.toml
, no code changes.EDIT:
After I revert the
Cargo.toml
changes (wfxr/clitrans@57ca835) the error is gone.Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: