diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-06-09 10:55:16 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2017-06-10 15:29:53 +0300 |
| commit | fc5c31c48cf19757ebf4b750efa34e7cb5f995e3 (patch) | |
| tree | 8760dec05da62290b437a65b0956554529957841 /src/librustc/traits/specialize | |
| parent | 63481a57dcb4a12501621f5bc915999d4af0e8a0 (diff) | |
| download | rust-fc5c31c48cf19757ebf4b750efa34e7cb5f995e3.tar.gz rust-fc5c31c48cf19757ebf4b750efa34e7cb5f995e3.zip | |
rustc: make the comon case of tcx.infer_ctxt(()) nicer.
Diffstat (limited to 'src/librustc/traits/specialize')
| -rw-r--r-- | src/librustc/traits/specialize/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc/traits/specialize/specialization_graph.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs index 689f06a3597..18734e2dbc3 100644 --- a/src/librustc/traits/specialize/mod.rs +++ b/src/librustc/traits/specialize/mod.rs @@ -125,7 +125,7 @@ pub fn find_associated_item<'a, 'tcx>( let ancestors = trait_def.ancestors(tcx, impl_data.impl_def_id); match ancestors.defs(tcx, item.name, item.kind).next() { Some(node_item) => { - let substs = tcx.infer_ctxt(()).enter(|infcx| { + let substs = tcx.infer_ctxt().enter(|infcx| { let param_env = ty::ParamEnv::empty(Reveal::All); let substs = substs.rebase_onto(tcx, trait_def_id, impl_data.substs); let substs = translate_substs(&infcx, param_env, impl_data.impl_def_id, @@ -188,7 +188,7 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let impl1_trait_ref = tcx.impl_trait_ref(impl1_def_id).unwrap(); // Create a infcx, taking the predicates of impl1 as assumptions: - let result = tcx.infer_ctxt(()).enter(|infcx| { + let result = tcx.infer_ctxt().enter(|infcx| { // Normalize the trait reference. The WF rules ought to ensure // that this always succeeds. let impl1_trait_ref = diff --git a/src/librustc/traits/specialize/specialization_graph.rs b/src/librustc/traits/specialize/specialization_graph.rs index 702c5035a18..f80caeec460 100644 --- a/src/librustc/traits/specialize/specialization_graph.rs +++ b/src/librustc/traits/specialize/specialization_graph.rs @@ -109,7 +109,7 @@ impl<'a, 'gcx, 'tcx> Children { let possible_sibling = *slot; let tcx = tcx.global_tcx(); - let (le, ge) = tcx.infer_ctxt(()).enter(|infcx| { + let (le, ge) = tcx.infer_ctxt().enter(|infcx| { let overlap = traits::overlapping_impls(&infcx, possible_sibling, impl_def_id); |
