Skip to content

Commit d0190d3

Browse files
committed
Some changes
1 parent 1f1c575 commit d0190d3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc/infer/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
525525
ref fresh_tables,
526526
} = *self;
527527
let in_progress_tables = fresh_tables.as_ref();
528+
// Check that we haven't entered before
529+
assert!(interners.is_none());
528530
global_tcx.enter_local(arena, interners, |tcx| {
529531
f(InferCtxt {
530532
tcx,

src/librustc/ty/context.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
16181618

16191619
impl<'gcx> GlobalCtxt<'gcx> {
16201620
/// Call the closure with a local `TyCtxt` using the given arena.
1621+
/// `interners` is a slot passed so we can create a CtxtInterners
1622+
/// with the same lifetime as `arena`.
16211623
pub fn enter_local<'tcx, F, R>(
16221624
&'gcx self,
16231625
arena: &'tcx SyncDroplessArena,
@@ -2020,7 +2022,7 @@ pub mod tls {
20202022
/// This happens once per rustc session and TyCtxts only exists
20212023
/// inside the `f` function.
20222024
pub fn enter_global<'gcx, F, R>(gcx: &'gcx GlobalCtxt<'gcx>, f: F) -> R
2023-
where F: for<'a> FnOnce(TyCtxt<'a, 'gcx, 'gcx>) -> R
2025+
where F: FnOnce(TyCtxt<'gcx, 'gcx, 'gcx>) -> R
20242026
{
20252027
with_thread_locals(|| {
20262028
// Update GCX_PTR to indicate there's a GlobalCtxt available

0 commit comments

Comments
 (0)