-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
--emit=metadata,obj produces confusing error #76644
Copy link
Copy link
Closed
Labels
A-codegenArea: Code generationArea: Code generationA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
EDIT ehuss:
With an empty file,
foo.rs, the commandrustc --emit=metadata,obj --crate-type=lib foo.rsreturns a confusing error:The error message should at least be a little clearer. I do not know why the combination of metadata+obj causes this error.
objby itself is fine, but for some reason addingmetadatacauses an error.Original bug report below:
Original title: Cargo check fails to build the same package that cargo build can with an unhelpful error
Problem
When running cargo check on my project, it errors out with the following error

a very unhelpful, cryptic error. Running with verbose gives no more info than i can get from this screenshot alone.
I have been able to notice that it only happens when compiling for the target
thumbv7em-none-eabihfand not my native targetthumbv7em-none-eabihfSteps
I have made a minimum example git repo
https://github.com/DusterTheFirst/cargo-check-bug-cfg-if
Possible Solution(s)
More descriptive errors than "No such file or directory" such as information about the file that is missing would help in solving the problem.
Notes
Output of
cargo version:cargo 1.48.0-nightly (875e01232 2020-09-08)
and
cargo 1.46.0 (149022b1d 2020-07-17)
rustup show