Skip to content

Invalid "ignoring emit path because multiple .s files were produced" message #122509

Closed
@pacak

Description

@pacak

Code

#[inline(never)]
pub fn alpha() -> usize {
    println!("alpha");
    12
}

#[inline(never)]
pub fn beta() -> usize {
    println!("beta");
    12
}

Current output

$ rustc lib.rs --crate-type lib --emit asm -C codegen-units=2
warning: ignoring emit path because multiple .s files were produced

warning: 1 warning emitted

Desired output

blank

Rationale and extra context

Error originates from somewhere around here and implies that I passed --emit foo=some_name, while in fact I only passed --emit foo

if crate_output.outputs.contains_key(&output_type) {
// 2) Multiple codegen units, with `--emit foo=some_name`. We have
// no good solution for this case, so warn the user.
sess.dcx().emit_warn(errors::IgnoringEmitPath { extension });
} else if crate_output.single_output_file.is_some() {

Other cases

No response

Rust Version

rustc 1.78.0-nightly (1a648b397 2024-02-11)
binary: rustc
commit-hash: 1a648b397dedc98ada3dd3360f6d661ec2436c56
commit-date: 2024-02-11
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 17.0.6

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions