Skip to content

Commit 5fcc537

Browse files
committed
Make DepConstructor a module.
1 parent 921b284 commit 5fcc537

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

compiler/rustc_middle/src/dep_graph/dep_node.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
//! contained no `DefId` for thing that had been removed.
3030
//!
3131
//! `DepNode` definition happens in the `define_dep_nodes!()` macro. This macro
32-
//! defines the `DepKind` enum and a corresponding `DepConstructor` enum. The
33-
//! `DepConstructor` enum links a `DepKind` to the parameters that are needed at
32+
//! defines the `DepKind` enum and a corresponding `dep_constructor` module. The
33+
//! `dep_constructor` module links a `DepKind` to the parameters that are needed at
3434
//! runtime in order to construct a valid `DepNode` fingerprint.
3535
//!
3636
//! Because the macro sees what parameters a given `DepKind` requires, it can
@@ -44,7 +44,7 @@
4444
//! `DefId` it was computed from. In other cases, too much information gets
4545
//! lost during fingerprint computation.
4646
//!
47-
//! The `DepConstructor` enum, together with `DepNode::new()`, ensures that only
47+
//! The `dep_constructor` module, together with `DepNode::new()`, ensures that only
4848
//! valid `DepNode` instances can be constructed. For example, the API does not
4949
//! allow for constructing parameterless `DepNode`s with anything other
5050
//! than a zeroed out fingerprint. More generally speaking, it relieves the
@@ -331,10 +331,10 @@ macro_rules! define_dep_nodes {
331331
$($variant),*
332332
}
333333

334-
pub struct DepConstructor;
335-
336334
#[allow(non_camel_case_types)]
337-
impl DepConstructor {
335+
pub mod dep_constructor {
336+
use super::*;
337+
338338
$(
339339
#[inline(always)]
340340
#[allow(unreachable_code, non_snake_case)]

compiler/rustc_middle/src/dep_graph/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub use rustc_query_system::dep_graph::{
1313
WorkProduct, WorkProductId,
1414
};
1515

16-
pub use dep_node::{label_strs, DepConstructor, DepKind, DepNode, DepNodeExt};
16+
pub use dep_node::{dep_constructor, label_strs, DepKind, DepNode, DepNodeExt};
1717

1818
pub type DepGraph = rustc_query_system::dep_graph::DepGraph<DepKind>;
1919
pub type TaskDeps = rustc_query_system::dep_graph::TaskDeps<DepKind>;

compiler/rustc_middle/src/mir/mono.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::dep_graph::{DepConstructor, DepNode, WorkProduct, WorkProductId};
1+
use crate::dep_graph::{dep_constructor, DepNode, WorkProduct, WorkProductId};
22
use crate::ich::{NodeIdHashingMode, StableHashingContext};
33
use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt};
44
use rustc_attr::InlineAttr;
@@ -362,7 +362,7 @@ impl<'tcx> CodegenUnit<'tcx> {
362362
}
363363

364364
pub fn codegen_dep_node(&self, tcx: TyCtxt<'tcx>) -> DepNode {
365-
DepConstructor::CompileCodegenUnit(tcx, self.name())
365+
dep_constructor::CompileCodegenUnit(tcx, self.name())
366366
}
367367
}
368368

0 commit comments

Comments
 (0)