Unify all uses of 'gcx and 'tcx.

This commit is contained in:
Eduard-Mihai Burtescu 2019-06-14 00:48:52 +03:00
parent 0e4a56b4b0
commit f3f9d6dfd9
341 changed files with 3109 additions and 3327 deletions

View file

@ -51,7 +51,7 @@ use std::io::Write;
use syntax::ast;
use syntax_pos::Span;
pub fn assert_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
pub fn assert_dep_graph<'tcx>(tcx: TyCtxt<'tcx>) {
tcx.dep_graph.with_ignore(|| {
if tcx.sess.opts.debugging_opts.dump_dep_graph {
dump_graph(tcx);
@ -90,7 +90,7 @@ type Sources = Vec<(Span, DefId, DepNode)>;
type Targets = Vec<(Span, ast::Name, hir::HirId, DepNode)>;
struct IfThisChanged<'tcx> {
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
if_this_changed: Sources,
then_this_would_need: Targets,
}
@ -185,7 +185,7 @@ impl Visitor<'tcx> for IfThisChanged<'tcx> {
}
fn check_paths<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
if_this_changed: &Sources,
then_this_would_need: &Targets,
) {
@ -218,7 +218,7 @@ fn check_paths<'tcx>(
}
}
fn dump_graph(tcx: TyCtxt<'_, '_>) {
fn dump_graph(tcx: TyCtxt<'_>) {
let path: String = env::var("RUST_DEP_GRAPH").unwrap_or_else(|_| "dep_graph".to_string());
let query = tcx.dep_graph.query();

View file

@ -35,7 +35,7 @@ const MODULE: Symbol = sym::module;
const CFG: Symbol = sym::cfg;
const KIND: Symbol = sym::kind;
pub fn assert_module_sources<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
pub fn assert_module_sources<'tcx>(tcx: TyCtxt<'tcx>) {
tcx.dep_graph.with_ignore(|| {
if tcx.sess.opts.incremental.is_none() {
return;
@ -60,7 +60,7 @@ pub fn assert_module_sources<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
}
struct AssertModuleSource<'tcx> {
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
available_cgus: BTreeSet<String>,
}

View file

@ -206,7 +206,7 @@ impl Assertion {
}
}
pub fn check_dirty_clean_annotations<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
pub fn check_dirty_clean_annotations<'tcx>(tcx: TyCtxt<'tcx>) {
// can't add `#[rustc_dirty]` etc without opting in to this feature
if !tcx.features().rustc_attrs {
return;
@ -235,7 +235,7 @@ pub fn check_dirty_clean_annotations<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
}
pub struct DirtyCleanVisitor<'tcx> {
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
checked_attrs: FxHashSet<ast::AttrId>,
}
@ -537,7 +537,7 @@ impl ItemLikeVisitor<'tcx> for DirtyCleanVisitor<'tcx> {
///
/// Also make sure that the `label` and `except` fields do not
/// both exist.
fn check_config(tcx: TyCtxt<'_, '_>, attr: &Attribute) -> bool {
fn check_config(tcx: TyCtxt<'_>, attr: &Attribute) -> bool {
debug!("check_config(attr={:?})", attr);
let config = &tcx.sess.parse_sess.config;
debug!("check_config: config={:?}", config);
@ -572,7 +572,7 @@ fn check_config(tcx: TyCtxt<'_, '_>, attr: &Attribute) -> bool {
}
}
fn expect_associated_value(tcx: TyCtxt<'_, '_>, item: &NestedMetaItem) -> ast::Name {
fn expect_associated_value(tcx: TyCtxt<'_>, item: &NestedMetaItem) -> ast::Name {
if let Some(value) = item.value_str() {
value
} else {
@ -590,7 +590,7 @@ fn expect_associated_value(tcx: TyCtxt<'_, '_>, item: &NestedMetaItem) -> ast::N
// the HIR. It is used to verfiy that we really ran checks for all annotated
// nodes.
pub struct FindAllAttrs<'tcx> {
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
attr_names: Vec<Symbol>,
found_attrs: Vec<&'tcx Attribute>,
}

View file

@ -15,7 +15,7 @@ use super::fs::*;
use super::file_format;
use super::work_product;
pub fn dep_graph_tcx_init<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
pub fn dep_graph_tcx_init<'tcx>(tcx: TyCtxt<'tcx>) {
if !tcx.dep_graph.is_fully_enabled() {
return
}

View file

@ -15,7 +15,7 @@ use super::dirty_clean;
use super::file_format;
use super::work_product;
pub fn save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) {
pub fn save_dep_graph<'tcx>(tcx: TyCtxt<'tcx>) {
debug!("save_dep_graph()");
tcx.dep_graph.with_ignore(|| {
let sess = tcx.sess;
@ -129,7 +129,7 @@ fn save_in<F>(sess: &Session, path_buf: PathBuf, encode: F)
}
}
fn encode_dep_graph(tcx: TyCtxt<'_, '_>, encoder: &mut Encoder) {
fn encode_dep_graph(tcx: TyCtxt<'_>, encoder: &mut Encoder) {
// First encode the commandline arguments hash
tcx.sess.opts.dep_tracking_hash().encode(encoder).unwrap();
@ -233,7 +233,7 @@ fn encode_work_product_index(work_products: &FxHashMap<WorkProductId, WorkProduc
serialized_products.encode(encoder).unwrap();
}
fn encode_query_cache(tcx: TyCtxt<'_, '_>, encoder: &mut Encoder) {
fn encode_query_cache(tcx: TyCtxt<'_>, encoder: &mut Encoder) {
time(tcx.sess, "serialize query result cache", || {
tcx.serialize_query_result_cache(encoder).unwrap();
})