I have a temporary workaround. Since I am using a manually built Rust compiler toolchain, I can always modify the source code of core crate located in rust_install_path/lib/rustlib/src/rust/library/core, and then ask the compiler to build the core crate locally with
[unstable]
build-std = ["core"]
However, I would like to know if the core crate can be uniformly patched just like any other crate.
All crates that form the standard library are precompiled and don't participate in the cargo dependency graph at all. In fact except when using build-std, cargo is not even aware of the existence of these crates. Rustc transparently loads them from the sysroot. Using build-std (or some other way of locally building the standard library like the unmaintained xargo) is the only way you can patch them. You can use the __CARGO_TESTS_ONLY_SRC_ROOT env var with build-std to set the location where cargo will look for the standard library sources. That way you don't have to modify the sources in the sysroot.