Skip to content

Commit

Permalink
incr.comp.: Use the awesome new '_ in a few places.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Dec 1, 2017
1 parent c531d9f commit 410f850
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/librustc/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,10 @@ impl DepGraph {
self.data.as_ref().and_then(|data| data.colors.borrow().get(dep_node).cloned())
}

pub fn try_mark_green<'a, 'tcx>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
dep_node: &DepNode)
-> Option<DepNodeIndex> {
pub fn try_mark_green<'tcx>(&self,
tcx: TyCtxt<'_, 'tcx, 'tcx>,
dep_node: &DepNode)
-> Option<DepNodeIndex> {
debug!("try_mark_green({:?}) - BEGIN", dep_node);
let data = self.data.as_ref().unwrap();

Expand Down
12 changes: 6 additions & 6 deletions src/librustc/ty/maps/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ pub(super) trait QueryDescription<'tcx>: QueryConfig {
false
}

fn try_load_from_disk<'a>(_: TyCtxt<'a, 'tcx, 'tcx>,
_: SerializedDepNodeIndex)
-> Option<Self::Value> {
fn try_load_from_disk(_: TyCtxt<'_, 'tcx, 'tcx>,
_: SerializedDepNodeIndex)
-> Option<Self::Value> {
bug!("QueryDescription::load_from_disk() called for unsupport query.")
}
}
Expand Down Expand Up @@ -556,9 +556,9 @@ impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
def_id.is_local()
}

fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: SerializedDepNodeIndex)
-> Option<Self::Value> {
fn try_load_from_disk(tcx: TyCtxt<'_, 'tcx, 'tcx>,
id: SerializedDepNodeIndex)
-> Option<Self::Value> {
let typeck_tables: Option<ty::TypeckTables<'tcx>> = tcx
.on_disk_query_result_cache
.try_load_query_result(tcx, id);
Expand Down
22 changes: 11 additions & 11 deletions src/librustc/ty/maps/on_disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ impl<'sess> OnDiskCache<'sess> {

/// Returns the cached query result if there is something in the cache for
/// the given SerializedDepNodeIndex. Otherwise returns None.
pub fn try_load_query_result<'a, 'tcx, T>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
dep_node_index: SerializedDepNodeIndex)
-> Option<T>
pub fn try_load_query_result<'tcx, T>(&self,
tcx: TyCtxt<'_, 'tcx, 'tcx>,
dep_node_index: SerializedDepNodeIndex)
-> Option<T>
where T: Decodable
{
self.load_indexed(tcx,
Expand All @@ -319,13 +319,13 @@ impl<'sess> OnDiskCache<'sess> {
x.extend(diagnostics.into_iter());
}

fn load_indexed<'a, 'tcx, T>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
dep_node_index: SerializedDepNodeIndex,
index: &FxHashMap<SerializedDepNodeIndex,
AbsoluteBytePos>,
debug_tag: &'static str)
-> Option<T>
fn load_indexed<'tcx, T>(&self,
tcx: TyCtxt<'_, 'tcx, 'tcx>,
dep_node_index: SerializedDepNodeIndex,
index: &FxHashMap<SerializedDepNodeIndex,
AbsoluteBytePos>,
debug_tag: &'static str)
-> Option<T>
where T: Decodable
{
let pos = if let Some(&pos) = index.get(&dep_node_index) {
Expand Down

0 comments on commit 410f850

Please sign in to comment.