Merge conflicts due to eddyb's UFCS branch

This commit is contained in:
Niko Matsakis 2015-02-24 16:27:02 -05:00
parent abdb42ba64
commit 1ef3598ed9
3 changed files with 11 additions and 9 deletions

View File

@ -688,7 +688,7 @@ fn ast_path_to_trait_ref<'a,'tcx>(
-> Rc<ty::TraitRef<'tcx>>
{
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<_> =

View File

@ -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;

View File

@ -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 {