Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Oct 27, 2025

This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.

This is a prerequisite for rust-lang/miri#4648.

Previously only --crate-type would be taken into account, not #![crate_type].
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2025

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 27, 2025

By the way I noticed that if you specify a crate type on the cli and this crate type is not supported by either the target or (with this PR) codegen backend, the crate will be treated as a library, but --emit link produces no output files.

This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.
@bjorn3 bjorn3 force-pushed the codegen_backend_crate_types branch from 4059118 to b443a59 Compare October 27, 2025 16:24
Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with green ci and with(out) the nit

View changes since this review

@bjorn3 bjorn3 force-pushed the codegen_backend_crate_types branch from 554a58d to 9fc1378 Compare October 28, 2025 14:26
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 28, 2025

@bors r=WaffleLapkin

@bors
Copy link
Collaborator

bors commented Oct 28, 2025

📌 Commit 9fc1378 has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 28, 2025
@bors
Copy link
Collaborator

bors commented Oct 28, 2025

⌛ Testing commit 9fc1378 with merge 88ca078...

bors added a commit that referenced this pull request Oct 28, 2025
…apkin

Allow codegen backends to indicate which crate types they support

This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.

This is a prerequisite for rust-lang/miri#4648.
@cuviper
Copy link
Member

cuviper commented Oct 28, 2025

@bors retry (yielding to a stable PR)

bors added a commit that referenced this pull request Oct 28, 2025
Rollup of 3 pull requests

Successful merges:

 - #148173 (Emit delayed bug during wfck for stranded opaque)
 - #148177 (Allow codegen backends to indicate which crate types they support)
 - #148180 (rustdoc: remove `--emit=unversioned-shared-resources`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6a7bcec into rust-lang:master Oct 28, 2025
11 of 12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Oct 28, 2025
rust-timer added a commit that referenced this pull request Oct 28, 2025
Rollup merge of #148177 - bjorn3:codegen_backend_crate_types, r=WaffleLapkin

Allow codegen backends to indicate which crate types they support

This way cargo will drop the unsupported crate types for crates that
specify multiple crate types.

This is a prerequisite for rust-lang/miri#4648.
@bjorn3 bjorn3 deleted the codegen_backend_crate_types branch October 28, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants