Skip to content

Commit 25d5cd2

Browse files
committed
Remove unnecessary trait HasDepContext
1 parent db58395 commit 25d5cd2

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
@@ -23,7 +23,7 @@ use {super::debug::EdgeFilter, std::env};
2323

2424
use super::query::DepGraphQuery;
2525
use super::serialized::{GraphEncoder, SerializedDepGraph, SerializedDepNodeIndex};
26-
use super::{DepKind, DepNode, HasDepContext, WorkProductId, read_deps, with_deps};
26+
use super::{DepKind, DepNode, WorkProductId, read_deps, with_deps};
2727
use crate::dep_graph::edges::EdgesVec;
2828
use crate::ich::StableHashingContext;
2929
use crate::ty::TyCtxt;
@@ -938,7 +938,7 @@ impl DepGraphData {
938938

939939
// We failed to mark it green, so we try to force the query.
940940
debug!("trying to force dependency {dep_dep_node:?}");
941-
if !tcx.dep_context().try_force_from_dep_node(*dep_dep_node, parent_dep_node_index, frame) {
941+
if !tcx.try_force_from_dep_node(*dep_dep_node, parent_dep_node_index, frame) {
942942
// The DepNode could not be forced.
943943
debug!("dependency {dep_dep_node:?} could not be forced");
944944
return None;
@@ -985,10 +985,7 @@ impl DepGraphData {
985985
let frame = MarkFrame { index: prev_dep_node_index, parent: frame };
986986

987987
// We never try to mark eval_always nodes as green
988-
debug_assert!(
989-
!tcx.dep_context()
990-
.is_eval_always(self.previous.index_to_node(prev_dep_node_index).kind)
991-
);
988+
debug_assert!(!tcx.is_eval_always(self.previous.index_to_node(prev_dep_node_index).kind));
992989

993990
let prev_deps = self.previous.edge_targets_from(prev_dep_node_index);
994991

compiler/rustc_middle/src/dep_graph/mod.rs

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

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

0 commit comments

Comments
 (0)