Skip to content

Commit 9b453d6

Browse files
committed
Use DroplessArena for variance inference
1 parent d07ce65 commit 9b453d6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_typeck/src/variance/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/variance.html
55
66
use hir::Node;
7-
use rustc_arena::TypedArena;
7+
use rustc_arena::DroplessArena;
88
use rustc_hir as hir;
99
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
1010
use rustc_middle::ty::query::Providers;
@@ -32,8 +32,8 @@ pub fn provide(providers: &mut Providers) {
3232

3333
fn crate_variances(tcx: TyCtxt<'_>, crate_num: CrateNum) -> CrateVariancesMap<'_> {
3434
assert_eq!(crate_num, LOCAL_CRATE);
35-
let mut arena = TypedArena::default();
36-
let terms_cx = terms::determine_parameters_to_be_inferred(tcx, &mut arena);
35+
let arena = DroplessArena::default();
36+
let terms_cx = terms::determine_parameters_to_be_inferred(tcx, &arena);
3737
let constraints_cx = constraints::add_constraints_from_crate(terms_cx);
3838
solve::solve_constraints(constraints_cx)
3939
}

compiler/rustc_typeck/src/variance/terms.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// `InferredIndex` is a newtype'd int representing the index of such
1010
// a variable.
1111

12-
use rustc_arena::TypedArena;
12+
use rustc_arena::DroplessArena;
1313
use rustc_hir as hir;
1414
use rustc_hir::itemlikevisit::ItemLikeVisitor;
1515
use rustc_hir::HirIdMap;
@@ -47,7 +47,7 @@ impl<'a> fmt::Debug for VarianceTerm<'a> {
4747

4848
pub struct TermsContext<'a, 'tcx> {
4949
pub tcx: TyCtxt<'tcx>,
50-
pub arena: &'a TypedArena<VarianceTerm<'a>>,
50+
pub arena: &'a DroplessArena,
5151

5252
// For marker types, UnsafeCell, and other lang items where
5353
// variance is hardcoded, records the item-id and the hardcoded
@@ -64,7 +64,7 @@ pub struct TermsContext<'a, 'tcx> {
6464

6565
pub fn determine_parameters_to_be_inferred<'a, 'tcx>(
6666
tcx: TyCtxt<'tcx>,
67-
arena: &'a mut TypedArena<VarianceTerm<'a>>,
67+
arena: &'a DroplessArena,
6868
) -> TermsContext<'a, 'tcx> {
6969
let mut terms_cx = TermsContext {
7070
tcx,

0 commit comments

Comments
 (0)