Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #64864

Merged
merged 36 commits into from
Sep 28, 2019
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9b00e21
Remove unused DepTrackingMap
Mark-Simulacrum Sep 26, 2019
dd38a0f
update rtpSpawn's parameters type(It's prototype has been updated in …
bpangWR Sep 26, 2019
3e4f582
Upgrade env_logger to 0.7
mati865 Sep 26, 2019
377a70d
Fix div_duration() marked as stable by mistake
JMS55 Sep 26, 2019
e79036d
hir: Disallow `target_feature` on constants
davidtwco Sep 26, 2019
c81d359
Merge pull request #30 from Wind-River/update
n-salim Sep 26, 2019
c3368bd
hir: stop checking codegen fn attrs for constants
davidtwco Sep 26, 2019
821ff46
Include message on tests that should panic
kungfukennyg Sep 24, 2019
9ef6edb
lowering: don't .abort_if_errors()
Centril Sep 27, 2019
c482c84
Stabilize map_get_key_value feature
tesuji Sep 27, 2019
bd995c0
pin.rs: fix links to primitives in documentation
Sep 27, 2019
faee8e1
Turn `walk_parent_nodes` method into an iterator
estebank Sep 26, 2019
46a38dc
Account for tail expressions when pointing at return type
estebank Sep 26, 2019
e537d06
review comments
estebank Sep 26, 2019
a284822
fix rebase
estebank Sep 27, 2019
d559b72
Add mailmap entry for Dustin Bensing by request
Mark-Simulacrum Sep 27, 2019
d540d44
Remove global_tcx from TyCtxt
Mark-Simulacrum Sep 25, 2019
f226ab4
Remove lift_to_global
Mark-Simulacrum Sep 25, 2019
0a4d55d
Remove stray uses of gcx name
Mark-Simulacrum Sep 25, 2019
4b23503
Remove shrink_to_tcx_lifetime
Mark-Simulacrum Sep 25, 2019
6ccb7ae
Docs: slice elements are equidistant
llogiq Sep 23, 2019
aa03f1f
Improve diagnostic for `let A = 0;`
Centril Sep 28, 2019
4c57882
Rollup merge of #64703 - llogiq:slices-elems-are-equidistant, r=rkruppe
Centril Sep 28, 2019
a60ac8e
Rollup merge of #64745 - kennethbgoodin:should-panic-msg, r=varkor
Centril Sep 28, 2019
4db233e
Rollup merge of #64781 - Mark-Simulacrum:no-global-tcx, r=eddyb
Centril Sep 28, 2019
85175b7
Rollup merge of #64794 - Mark-Simulacrum:rm-dep-track-map, r=estebank
Centril Sep 28, 2019
5b6a580
Rollup merge of #64802 - estebank:walk-parents-iterator, r=matthewjasper
Centril Sep 28, 2019
00cba5b
Rollup merge of #64809 - davidtwco:issue-64768-target-feature-const, …
Centril Sep 28, 2019
e2823c9
Rollup merge of #64815 - JMS55:patch-1, r=jonas-schievink
Centril Sep 28, 2019
2d4c101
Rollup merge of #64818 - Wind-River:master, r=alexcrichton
Centril Sep 28, 2019
fc53088
Rollup merge of #64830 - Centril:thou-shallt-not-abort, r=estebank
Centril Sep 28, 2019
494a8a8
Rollup merge of #64836 - lzutao:stabilize-map_get_key_value, r=SimonS…
Centril Sep 28, 2019
b71f6d8
Rollup merge of #64845 - rusty-snake:patch-1, r=jonas-schievink
Centril Sep 28, 2019
e3a5179
Rollup merge of #64847 - mati865:env_logger, r=alexcrichton
Centril Sep 28, 2019
f1a5bc5
Rollup merge of #64851 - Mark-Simulacrum:mailmap-update, r=varkor
Centril Sep 28, 2019
017944c
Rollup merge of #64859 - Centril:const-def-here-new-var, r=estebank
Centril Sep 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove unused DepTrackingMap
Mark-Simulacrum committed Sep 26, 2019

Verified

This commit was signed with the committer’s verified signature.
commit 9b00e219fef1d315829d0e21b24c20ec7e9630ab
87 changes: 0 additions & 87 deletions src/librustc/dep_graph/dep_tracking_map.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/librustc/dep_graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
pub mod debug;
mod dep_node;
mod dep_tracking_map;
mod graph;
mod prev;
mod query;
mod safe;
mod serialized;
pub mod cgu_reuse_tracker;

pub use self::dep_tracking_map::{DepTrackingMap, DepTrackingMapConfig};
pub use self::dep_node::{DepNode, DepKind, DepConstructor, WorkProductId, RecoverKey, label_strs};
pub use self::graph::{DepGraph, WorkProduct, DepNodeIndex, DepNodeColor, TaskDeps, hash_result};
pub use self::graph::WorkProductFileKind;
29 changes: 1 addition & 28 deletions src/librustc/traits/codegen/mod.rs
Original file line number Diff line number Diff line change
@@ -3,12 +3,10 @@
// seems likely that they should eventually be merged into more
// general routines.

use crate::dep_graph::{DepKind, DepTrackingMapConfig};
use std::marker::PhantomData;
use crate::infer::InferCtxt;
use crate::traits::{FulfillmentContext, Obligation, ObligationCause, SelectionContext,
TraitEngine, Vtable};
use crate::ty::{self, Ty, TyCtxt};
use crate::ty::{self, TyCtxt};
use crate::ty::subst::{Subst, SubstsRef};
use crate::ty::fold::TypeFoldable;

@@ -100,33 +98,8 @@ impl<'tcx> TyCtxt<'tcx> {
}
}

// Implement DepTrackingMapConfig for `trait_cache`
pub struct TraitSelectionCache<'tcx> {
data: PhantomData<&'tcx ()>
}

impl<'tcx> DepTrackingMapConfig for TraitSelectionCache<'tcx> {
type Key = (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>);
type Value = Vtable<'tcx, ()>;
fn to_dep_kind() -> DepKind {
DepKind::TraitSelect
}
}

// # Global Cache

pub struct ProjectionCache<'tcx> {
data: PhantomData<&'tcx ()>,
}

impl<'tcx> DepTrackingMapConfig for ProjectionCache<'tcx> {
type Key = Ty<'tcx>;
type Value = Ty<'tcx>;
fn to_dep_kind() -> DepKind {
DepKind::TraitSelect
}
}

impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
/// Finishes processes any obligations that remain in the
/// fulfillment context, and then returns the result with all type
41 changes: 2 additions & 39 deletions src/librustc/util/common.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#![allow(non_camel_case_types)]

use rustc_data_structures::{fx::FxHashMap, sync::Lock};
use rustc_data_structures::sync::Lock;

use std::cell::{RefCell, Cell};
use std::cell::Cell;
use std::fmt::Debug;
use std::hash::Hash;
use std::time::{Duration, Instant};

use std::sync::mpsc::{Sender};
@@ -279,39 +278,3 @@ pub fn indenter() -> Indenter {
debug!(">>");
Indenter { _cannot_construct_outside_of_this_module: () }
}

pub trait MemoizationMap {
type Key: Clone;
type Value: Clone;

/// If `key` is present in the map, return the value,
/// otherwise invoke `op` and store the value in the map.
///
/// N.B., if the receiver is a `DepTrackingMap`, special care is
/// needed in the `op` to ensure that the correct edges are
/// added into the dep graph. See the `DepTrackingMap` impl for
/// more details!
fn memoize<OP>(&self, key: Self::Key, op: OP) -> Self::Value
where OP: FnOnce() -> Self::Value;
}

impl<K, V> MemoizationMap for RefCell<FxHashMap<K,V>>
where K: Hash+Eq+Clone, V: Clone
{
type Key = K;
type Value = V;

fn memoize<OP>(&self, key: K, op: OP) -> V
where OP: FnOnce() -> V
{
let result = self.borrow().get(&key).cloned();
match result {
Some(result) => result,
None => {
let result = op();
self.borrow_mut().insert(key, result.clone());
result
}
}
}
}