Skip to content

Commit e5c125f

Browse files
Rollup merge of #152019 - nnethercote:rm-unneeded-HashStable-derives, r=Zalathar
`NativeLib` cleanups Improvements to `NativeLib`. r? @Zalathar
2 parents fabcf5a + 3a5d7df commit e5c125f

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3683,7 +3683,6 @@ dependencies = [
36833683
"rustc_macros",
36843684
"rustc_metadata",
36853685
"rustc_middle",
3686-
"rustc_query_system",
36873686
"rustc_serialize",
36883687
"rustc_session",
36893688
"rustc_span",

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ rustc_lint_defs = { path = "../rustc_lint_defs" }
2828
rustc_macros = { path = "../rustc_macros" }
2929
rustc_metadata = { path = "../rustc_metadata" }
3030
rustc_middle = { path = "../rustc_middle" }
31-
rustc_query_system = { path = "../rustc_query_system" }
3231
rustc_serialize = { path = "../rustc_serialize" }
3332
rustc_session = { path = "../rustc_session" }
3433
rustc_span = { path = "../rustc_span" }

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_data_structures::unord::UnordMap;
2424
use rustc_hir::CRATE_HIR_ID;
2525
use rustc_hir::attrs::{CfgEntry, NativeLibKind, WindowsSubsystemKind};
2626
use rustc_hir::def_id::CrateNum;
27-
use rustc_macros::{Decodable, Encodable, HashStable};
27+
use rustc_macros::{Decodable, Encodable};
2828
use rustc_metadata::EncodedMetadata;
2929
use rustc_middle::dep_graph::WorkProduct;
3030
use rustc_middle::lint::LevelAndSource;
@@ -175,7 +175,12 @@ bitflags::bitflags! {
175175
}
176176
}
177177

178-
#[derive(Clone, Debug, Encodable, Decodable, HashStable)]
178+
// This is the same as `rustc_session::cstore::NativeLib`, except:
179+
// - (important) the `foreign_module` field is missing, because it contains a `DefId`, which can't
180+
// be encoded with `FileEncoder`.
181+
// - (less important) the `verbatim` field is a `bool` rather than an `Option<bool>`, because here
182+
// we can treat `false` and `absent` the same.
183+
#[derive(Clone, Debug, Encodable, Decodable)]
179184
pub struct NativeLib {
180185
pub kind: NativeLibKind,
181186
pub name: Symbol,

0 commit comments

Comments
 (0)