I am trying to add a new dependency to libstd in my own port of the Rust compiler, which right now is similar to the official Rust compiler from a couple of months ago. I am trying to do what is mentioned in Adding a new crate to libstd dependency - help - The Rust Programming Language Forum, but I cannot make it work. Please let me know if you see where I am doing something wrong.
I want to add another crate my-crate to Rust compiler's libstd like:
Updating only changed submodules
Submodules updated in 0.02 seconds
Finished dev [unoptimized] target(s) in 0.22s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Compiling my-crate v19.0.0 (/home/utsav/Desktop/my-crate)
error[E0463]: can't find crate for `core`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `my-crate`.
If I try to directly use my-crate in Cargo.toml of libstd where my-crate has no dependencies, I get the same error.
I was completely overlooking rustc-dep-of-std! I also realized that cfg-if was a good example I should have followed earlier on, as it is a crate that is a dependency of std, but it does not have anything patch-related going on.