Use rustc_codegen_llvm's get_dylib_metadata to unblock proc macros. #268
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given what I found in #192 (comment), proc macros should've been working already, but their loading was silently failing. After getting
RUSTC_LOG
to work (needs rust-lang/rust#79238 and/or #267), I could see this:That's a
warn!
inrustc_metadata
, so ideally it would be visible by default, but it's not, due to rust-lang/rust#76824.(It should also be reported as an error, but I'm not sure if the LLVM backend has non-fatal metadata loading errors)
The main problem is that
rustc_metadata
is relying onrustc_codegen_spirv
to load proc macro metadata.This PR works around that by grabbing
rustc_codegen_llvm
's, but we should probably copy whatrustc_codegen_cranelift
does, instead, or fixrustc
to not rely on the codegen backend for proc macro metadata.(EDIT: filed rust-lang/rust#79239 for future improvements there)
Fixes #192.