From 1ef3598ed9da3222467d373bc02973e8ecffbaad Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 24 Feb 2015 16:27:02 -0500 Subject: [PATCH] Merge conflicts due to eddyb's UFCS branch --- src/librustc_typeck/astconv.rs | 16 +++++++++------- src/librustc_typeck/check/mod.rs | 2 +- src/librustc_typeck/collect.rs | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 48928516a60..844635117b5 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -688,7 +688,7 @@ fn ast_path_to_trait_ref<'a,'tcx>( -> Rc> { debug!("ast_path_to_trait_ref {:?}", trait_segment); - let trait_def = match this.get_trait_def(path.span, trait_def_id) { + let trait_def = match this.get_trait_def(span, trait_def_id) { Ok(trait_def) => trait_def, Err(ErrorReported) => { // No convenient way to recover from a cycle here. Just bail. Sorry! @@ -873,17 +873,19 @@ fn ast_path_to_ty<'tcx>( -> Ty<'tcx> { let tcx = this.tcx(); - let substs = match this.get_item_type_scheme(path.span, did) { + let (generics, decl_ty) = match this.get_item_type_scheme(span, did) { Ok(ty::TypeScheme { generics, ty: decl_ty }) => { - ast_path_substs_for_ty(this, rscope, - span, param_mode, - &generics, item_segment) + (generics, decl_ty) } Err(ErrorReported) => { - return TypeAndSubsts { substs: Substs::empty(), ty: tcx.types.err }; + return tcx.types.err; } }; + let substs = ast_path_substs_for_ty(this, rscope, + span, param_mode, + &generics, item_segment); + // FIXME(#12938): This is a hack until we have full support for DST. if Some(did) == this.tcx().lang_items.owned_box() { assert_eq!(substs.types.len(TypeSpace), 1); @@ -1020,7 +1022,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>, // FIXME(#20300) -- search where clauses, not bounds let bounds = - this.get_type_parameter_bounds(ast_ty.span, ty_param_ndoe_id) + this.get_type_parameter_bounds(span, ty_param_node_id) .unwrap_or(Vec::new()); let mut suitable_bounds: Vec<_> = diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 43edb4f09cc..fd6ba79ec21 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3637,7 +3637,7 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, } } else { tcx.sess.span_bug(expr.span, - &format!("unbound path {}", expr.repr(tcx))[]) + &format!("unbound path {}", expr.repr(tcx))) }; let mut def = path_res.base_def; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 737d2067684..74fed6cbf39 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -504,7 +504,7 @@ fn is_param<'tcx>(tcx: &ty::ctxt<'tcx>, -> bool { if let ast::TyPath(None, _) = ast_ty.node { - let path_res = ccx.tcx.def_map.borrow()[ast_ty.id]; + let path_res = tcx.def_map.borrow()[ast_ty.id]; if let def::DefTyParam(_, _, def_id, _) = path_res.base_def { path_res.depth == 0 && def_id == local_def(param_id) } else {