Skip to content

Commit

Permalink
Auto merge of #33977 - Ms2ger:create-and-enter, r=nrc
Browse files Browse the repository at this point in the history
Take the def_map argument to TyCtxt::create_and_enter out of its RefCell.
  • Loading branch information
bors committed May 31, 2016
2 parents 298730e + 7463c95 commit 49da43e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
/// reference to the context, to allow formatting values that need it.
pub fn create_and_enter<F, R>(s: &'tcx Session,
arenas: &'tcx CtxtArenas<'tcx>,
def_map: RefCell<DefMap>,
def_map: DefMap,
named_region_map: resolve_lifetime::NamedRegionMap,
map: ast_map::Map<'tcx>,
freevars: FreevarMap,
Expand Down Expand Up @@ -693,7 +693,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
item_variance_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
variance_computed: Cell::new(false),
sess: s,
def_map: def_map,
def_map: RefCell::new(def_map),
tables: RefCell::new(Tables::empty()),
impl_trait_refs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
trait_defs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use super::Compilation;

use serialize::json;

use std::cell::RefCell;
use std::collections::HashMap;
use std::env;
use std::ffi::{OsString, OsStr};
Expand Down Expand Up @@ -893,7 +892,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
let trait_map = resolutions.trait_map;
TyCtxt::create_and_enter(sess,
arenas,
RefCell::new(resolutions.def_map),
resolutions.def_map,
named_region_map,
hir_map,
resolutions.freevars,
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_driver/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use rustc_metadata::cstore::CStore;
use rustc_metadata::creader::read_local_crates;
use rustc::hir::map as hir_map;
use rustc::session::{self, config};
use std::cell::RefCell;
use std::rc::Rc;
use syntax::ast;
use syntax::abi::Abi;
Expand Down Expand Up @@ -140,7 +139,7 @@ fn test_env<F>(source_string: &str,
let index = stability::Index::new(&ast_map);
TyCtxt::create_and_enter(&sess,
&arenas,
RefCell::new(resolutions.def_map),
resolutions.def_map,
named_region_map.unwrap(),
ast_map,
resolutions.freevars,
Expand Down

0 comments on commit 49da43e

Please sign in to comment.