Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cap-lints and related affect crate hash #87144

Closed
jsgf opened this issue Jul 14, 2021 · 1 comment · Fixed by #87145
Closed

--cap-lints and related affect crate hash #87144

jsgf opened this issue Jul 14, 2021 · 1 comment · Fixed by #87145
Labels
C-bug Category: This is a bug.

Comments

@jsgf
Copy link
Contributor

jsgf commented Jul 14, 2021

I tried this code t.rs:

pub fn foo() {}

I'd expect the output of:

rustc --crate-type rlib --emit link t.rs
rustc --crate-type rlib --emit link --cap-lints=warn t.rs
rustc --crate-type rlib --emit link -Ddead-code t.rs

to all produce the same output from

rustc -Zls libt.rs

since this only affects the diagnostics and nothing about the crate itself (other than whether the crate is generated at all,
if an error is converted to a warning).

Instead, they all get different crate hashes:
(nothing)

Crate info:
name t
hash 5a3a7bb9cc8aaa16 stable_crate_id StableCrateId(18443930956397526271)

--cap-lints=warn:

Crate info:
name t
hash 99f5dd1f2478b80a stable_crate_id StableCrateId(18443930956397526271)

-Ddead-code:

Crate info:
name t
hash ffe4791362102371 stable_crate_id StableCrateId(18443930956397526271)

Meta

rustc --version --verbose:

rustc 1.55.0-nightly (3e1c75c6e 2021-07-13)
binary: rustc
commit-hash: 3e1c75c6e25a4db968066bd2ef2dabc7c504d7ca
commit-date: 2021-07-13
host: x86_64-unknown-linux-gnu
release: 1.55.0-nightly
LLVM version: 12.0.1
@jsgf jsgf added the C-bug Category: This is a bug. label Jul 14, 2021
@jsgf
Copy link
Contributor Author

jsgf commented Jul 14, 2021

Similar issue to #86044, fixed in #86045. cc @Aaron1011 @bjorn3

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 16, 2021
…erister

Make --cap-lints and related options leave crate hash alone

Closes: rust-lang#87144
@bors bors closed this as completed in 51142a0 Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant