@@ -26,7 +26,7 @@ use syntax::codemap::{DUMMY_SP, Span};
2626use util:: ppaux:: Repr ;
2727
2828#[ derive( Copy , Clone ) ]
29- struct ParamIsLocal ( bool ) ;
29+ struct InferIsLocal ( bool ) ;
3030
3131/// True if there exist types that satisfy both of the two given impls.
3232pub fn overlapping_impls ( infcx : & InferCtxt ,
@@ -60,7 +60,7 @@ fn overlap(selcx: &mut SelectionContext,
6060
6161 let ( a_trait_ref, a_obligations) = impl_trait_ref_and_oblig ( selcx,
6262 a_def_id,
63- util:: free_substs_for_impl ) ;
63+ util:: fresh_type_vars_for_impl ) ;
6464
6565 let ( b_trait_ref, b_obligations) = impl_trait_ref_and_oblig ( selcx,
6666 b_def_id,
@@ -104,7 +104,7 @@ pub fn trait_ref_is_knowable<'tcx>(tcx: &ty::ctxt<'tcx>, trait_ref: &ty::TraitRe
104104
105105 // if the orphan rules pass, that means that no ancestor crate can
106106 // impl this, so it's up to us.
107- if orphan_check_trait_ref ( tcx, trait_ref, ParamIsLocal ( false ) ) . is_ok ( ) {
107+ if orphan_check_trait_ref ( tcx, trait_ref, InferIsLocal ( false ) ) . is_ok ( ) {
108108 debug ! ( "trait_ref_is_knowable: orphan check passed" ) ;
109109 return true ;
110110 }
@@ -126,7 +126,7 @@ pub fn trait_ref_is_knowable<'tcx>(tcx: &ty::ctxt<'tcx>, trait_ref: &ty::TraitRe
126126 // implemented by an upstream crate, which means that the impl
127127 // must be visible to us, and -- since the trait is fundamental
128128 // -- we can test.
129- orphan_check_trait_ref ( tcx, trait_ref, ParamIsLocal ( true ) ) . is_err ( )
129+ orphan_check_trait_ref ( tcx, trait_ref, InferIsLocal ( true ) ) . is_err ( )
130130}
131131
132132type SubstsFn = for <' a , ' tcx > fn ( infcx : & InferCtxt < ' a , ' tcx > ,
@@ -196,16 +196,16 @@ pub fn orphan_check<'tcx>(tcx: &ty::ctxt<'tcx>,
196196 return Ok ( ( ) ) ;
197197 }
198198
199- orphan_check_trait_ref ( tcx, & trait_ref, ParamIsLocal ( false ) )
199+ orphan_check_trait_ref ( tcx, & trait_ref, InferIsLocal ( false ) )
200200}
201201
202202fn orphan_check_trait_ref < ' tcx > ( tcx : & ty:: ctxt < ' tcx > ,
203203 trait_ref : & ty:: TraitRef < ' tcx > ,
204- param_is_local : ParamIsLocal )
204+ infer_is_local : InferIsLocal )
205205 -> Result < ( ) , OrphanCheckErr < ' tcx > >
206206{
207- debug ! ( "orphan_check_trait_ref(trait_ref={}, param_is_local ={})" ,
208- trait_ref. repr( tcx) , param_is_local . 0 ) ;
207+ debug ! ( "orphan_check_trait_ref(trait_ref={}, infer_is_local ={})" ,
208+ trait_ref. repr( tcx) , infer_is_local . 0 ) ;
209209
210210 // First, create an ordered iterator over all the type parameters to the trait, with the self
211211 // type appearing first.
@@ -215,12 +215,12 @@ fn orphan_check_trait_ref<'tcx>(tcx: &ty::ctxt<'tcx>,
215215 // Find the first input type that either references a type parameter OR
216216 // some local type.
217217 for input_ty in input_tys {
218- if ty_is_local ( tcx, input_ty, param_is_local ) {
218+ if ty_is_local ( tcx, input_ty, infer_is_local ) {
219219 debug ! ( "orphan_check_trait_ref: ty_is_local `{}`" , input_ty. repr( tcx) ) ;
220220
221221 // First local input type. Check that there are no
222222 // uncovered type parameters.
223- let uncovered_tys = uncovered_tys ( tcx, input_ty, param_is_local ) ;
223+ let uncovered_tys = uncovered_tys ( tcx, input_ty, infer_is_local ) ;
224224 for uncovered_ty in uncovered_tys {
225225 if let Some ( param) = uncovered_ty. walk ( ) . find ( |t| is_type_parameter ( t) ) {
226226 debug ! ( "orphan_check_trait_ref: uncovered type `{}`" , param. repr( tcx) ) ;
@@ -234,7 +234,7 @@ fn orphan_check_trait_ref<'tcx>(tcx: &ty::ctxt<'tcx>,
234234
235235 // Otherwise, enforce invariant that there are no type
236236 // parameters reachable.
237- if !param_is_local . 0 {
237+ if !infer_is_local . 0 {
238238 if let Some ( param) = input_ty. walk ( ) . find ( |t| is_type_parameter ( t) ) {
239239 debug ! ( "orphan_check_trait_ref: uncovered type `{}`" , param. repr( tcx) ) ;
240240 return Err ( OrphanCheckErr :: UncoveredTy ( param) ) ;
@@ -249,14 +249,14 @@ fn orphan_check_trait_ref<'tcx>(tcx: &ty::ctxt<'tcx>,
249249
250250fn uncovered_tys < ' tcx > ( tcx : & ty:: ctxt < ' tcx > ,
251251 ty : Ty < ' tcx > ,
252- param_is_local : ParamIsLocal )
252+ infer_is_local : InferIsLocal )
253253 -> Vec < Ty < ' tcx > >
254254{
255- if ty_is_local_constructor ( tcx, ty, param_is_local ) {
255+ if ty_is_local_constructor ( tcx, ty, infer_is_local ) {
256256 vec ! [ ]
257257 } else if fundamental_ty ( tcx, ty) {
258258 ty. walk_shallow ( )
259- . flat_map ( |t| uncovered_tys ( tcx, t, param_is_local ) . into_iter ( ) )
259+ . flat_map ( |t| uncovered_tys ( tcx, t, infer_is_local ) . into_iter ( ) )
260260 . collect ( )
261261 } else {
262262 vec ! [ ty]
@@ -271,10 +271,10 @@ fn is_type_parameter<'tcx>(ty: Ty<'tcx>) -> bool {
271271 }
272272}
273273
274- fn ty_is_local < ' tcx > ( tcx : & ty:: ctxt < ' tcx > , ty : Ty < ' tcx > , param_is_local : ParamIsLocal ) -> bool
274+ fn ty_is_local < ' tcx > ( tcx : & ty:: ctxt < ' tcx > , ty : Ty < ' tcx > , infer_is_local : InferIsLocal ) -> bool
275275{
276- ty_is_local_constructor ( tcx, ty, param_is_local ) ||
277- fundamental_ty ( tcx, ty) && ty. walk_shallow ( ) . any ( |t| ty_is_local ( tcx, t, param_is_local ) )
276+ ty_is_local_constructor ( tcx, ty, infer_is_local ) ||
277+ fundamental_ty ( tcx, ty) && ty. walk_shallow ( ) . any ( |t| ty_is_local ( tcx, t, infer_is_local ) )
278278}
279279
280280fn fundamental_ty < ' tcx > ( tcx : & ty:: ctxt < ' tcx > , ty : Ty < ' tcx > ) -> bool
@@ -293,7 +293,7 @@ fn fundamental_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> bool
293293
294294fn ty_is_local_constructor < ' tcx > ( tcx : & ty:: ctxt < ' tcx > ,
295295 ty : Ty < ' tcx > ,
296- param_is_local : ParamIsLocal )
296+ infer_is_local : InferIsLocal )
297297 -> bool
298298{
299299 debug ! ( "ty_is_local_constructor({})" , ty. repr( tcx) ) ;
@@ -310,13 +310,13 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>,
310310 ty:: ty_ptr( ..) |
311311 ty:: ty_rptr( ..) |
312312 ty:: ty_tup( ..) |
313- ty:: ty_infer ( ..) |
313+ ty:: ty_param ( ..) |
314314 ty:: ty_projection( ..) => {
315315 false
316316 }
317317
318- ty:: ty_param ( ..) => {
319- param_is_local . 0
318+ ty:: ty_infer ( ..) => {
319+ infer_is_local . 0
320320 }
321321
322322 ty:: ty_enum( def_id, _) |
0 commit comments