提交 1ef3598e 编写于 作者: N Niko Matsakis

Merge conflicts due to eddyb's UFCS branch

上级 abdb42ba
...@@ -688,7 +688,7 @@ fn ast_path_to_trait_ref<'a,'tcx>( ...@@ -688,7 +688,7 @@ fn ast_path_to_trait_ref<'a,'tcx>(
-> Rc<ty::TraitRef<'tcx>> -> Rc<ty::TraitRef<'tcx>>
{ {
debug!("ast_path_to_trait_ref {:?}", trait_segment); 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, Ok(trait_def) => trait_def,
Err(ErrorReported) => { Err(ErrorReported) => {
// No convenient way to recover from a cycle here. Just bail. Sorry! // No convenient way to recover from a cycle here. Just bail. Sorry!
...@@ -873,17 +873,19 @@ fn ast_path_to_ty<'tcx>( ...@@ -873,17 +873,19 @@ fn ast_path_to_ty<'tcx>(
-> Ty<'tcx> -> Ty<'tcx>
{ {
let tcx = this.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 }) => { Ok(ty::TypeScheme { generics, ty: decl_ty }) => {
ast_path_substs_for_ty(this, rscope, (generics, decl_ty)
span, param_mode,
&generics, item_segment)
} }
Err(ErrorReported) => { 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. // FIXME(#12938): This is a hack until we have full support for DST.
if Some(did) == this.tcx().lang_items.owned_box() { if Some(did) == this.tcx().lang_items.owned_box() {
assert_eq!(substs.types.len(TypeSpace), 1); assert_eq!(substs.types.len(TypeSpace), 1);
...@@ -1020,7 +1022,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>, ...@@ -1020,7 +1022,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
// FIXME(#20300) -- search where clauses, not bounds // FIXME(#20300) -- search where clauses, not bounds
let 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()); .unwrap_or(Vec::new());
let mut suitable_bounds: Vec<_> = let mut suitable_bounds: Vec<_> =
......
...@@ -3637,7 +3637,7 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, ...@@ -3637,7 +3637,7 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
} }
} else { } else {
tcx.sess.span_bug(expr.span, 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; let mut def = path_res.base_def;
......
...@@ -504,7 +504,7 @@ fn is_param<'tcx>(tcx: &ty::ctxt<'tcx>, ...@@ -504,7 +504,7 @@ fn is_param<'tcx>(tcx: &ty::ctxt<'tcx>,
-> bool -> bool
{ {
if let ast::TyPath(None, _) = ast_ty.node { 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 { if let def::DefTyParam(_, _, def_id, _) = path_res.base_def {
path_res.depth == 0 && def_id == local_def(param_id) path_res.depth == 0 && def_id == local_def(param_id)
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册