Skip to content

Commit ac36a07

Browse files
committed
Remove unnecessary trait HasDepContext
1 parent 6ee8ac8 commit ac36a07

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

compiler/rustc_middle/src/dep_graph/graph.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use {super::debug::EdgeFilter, std::env};
2525

2626
use super::query::DepGraphQuery;
2727
use super::serialized::{GraphEncoder, SerializedDepGraph, SerializedDepNodeIndex};
28-
use super::{DepKind, DepNode, HasDepContext, WorkProductId, read_deps, with_deps};
28+
use super::{DepKind, DepNode, WorkProductId, read_deps, with_deps};
2929
use crate::dep_graph::edges::EdgesVec;
3030
use crate::ty::TyCtxt;
3131
use crate::verify_ich::incremental_verify_ich;
@@ -922,7 +922,7 @@ impl DepGraphData {
922922

923923
// We failed to mark it green, so we try to force the query.
924924
debug!("trying to force dependency {dep_dep_node:?}");
925-
if !tcx.dep_context().try_force_from_dep_node(*dep_dep_node, parent_dep_node_index, frame) {
925+
if !tcx.try_force_from_dep_node(*dep_dep_node, parent_dep_node_index, frame) {
926926
// The DepNode could not be forced.
927927
debug!("dependency {dep_dep_node:?} could not be forced");
928928
return None;
@@ -969,10 +969,7 @@ impl DepGraphData {
969969
let frame = MarkFrame { index: prev_dep_node_index, parent: frame };
970970

971971
// We never try to mark eval_always nodes as green
972-
debug_assert!(
973-
!tcx.dep_context()
974-
.is_eval_always(self.previous.index_to_node(prev_dep_node_index).kind)
975-
);
972+
debug_assert!(!tcx.is_eval_always(self.previous.index_to_node(prev_dep_node_index).kind));
976973

977974
let prev_deps = self.previous.edge_targets_from(prev_dep_node_index);
978975

compiler/rustc_middle/src/dep_graph/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ mod graph;
2424
mod query;
2525
mod serialized;
2626

27-
pub trait HasDepContext<'tcx>: Copy {
28-
fn dep_context(&self) -> TyCtxt<'tcx>;
29-
}
30-
31-
impl<'tcx> HasDepContext<'tcx> for TyCtxt<'tcx> {
32-
fn dep_context(&self) -> TyCtxt<'tcx> {
33-
*self
34-
}
35-
}
36-
3727
/// Describes the contents of the fingerprint generated by a given query.
3828
///
3929
/// This is mainly for determining whether and how we can reconstruct a key

0 commit comments

Comments
 (0)