trans: Exit earlier from base::trans_crate() when compiling rmeta crates.#39184
Conversation
src/librustc_trans/back/write.rs
Outdated
There was a problem hiding this comment.
Are you sure that there is no chance that output_types may contain not only Metadata?
There was a problem hiding this comment.
This is just replicating the condition from here:
rust/src/librustc_trans/base.rs
Line 1186 in 47965f5
It's not an important assertion anyway.
src/librustc_trans/base.rs
Outdated
There was a problem hiding this comment.
I'd rather reverse this sort of condition and instead have !output_types.iter().any(|o| o.needs_codegen()).
There was a problem hiding this comment.
I just so that there's already OutputTypes::should_trans() which does what's needed here. I'll change it.
There was a problem hiding this comment.
Or maybe not. What was that with metadata,bin being special?
There was a problem hiding this comment.
No, it looks like that should work.
|
In general, it'd be neat if you could generate an |
8020dd9 to
b9765c0
Compare
|
Updated. Both comments should be addressed now. |
|
|
||
| // Skip crate items and just output metadata in -Z no-trans mode. | ||
| if tcx.sess.opts.debugging_opts.no_trans || | ||
| !tcx.sess.opts.output_types.should_trans() { |
There was a problem hiding this comment.
I wonder if we should even keep -Zno-trans.
|
@bors r+ |
|
📌 Commit b9765c0 has been approved by |
…-meta-crates, r=eddyb trans: Exit earlier from base::trans_crate() when compiling rmeta crates. Fixes rust-lang#38964. r? @eddyb cc @nrc
|
@bors: r- I believe this causes |
Rollup of 28 pull requests - Successful merges: #38603, #38761, #38842, #38847, #38955, #38966, #39062, #39068, #39077, #39111, #39112, #39114, #39118, #39120, #39132, #39135, #39138, #39142, #39143, #39146, #39157, #39166, #39167, #39168, #39179, #39184, #39195, #39197 - Failed merges: #39060, #39145
Rollup of 28 pull requests - Successful merges: #38603, #38761, #38842, #38847, #38955, #38966, #39062, #39068, #39077, #39111, #39112, #39114, #39118, #39120, #39132, #39135, #39138, #39142, #39143, #39146, #39157, #39166, #39167, #39168, #39179, #39184, #39195, #39197 - Failed merges: #39060, #39145
Fixes #38964.
r? @eddyb
cc @nrc