diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 3bda1730e63b8..ea5ca8acb094f 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -5453,7 +5453,8 @@ impl<'tcx> ctxt<'tcx> { expected.ty, found.ty)); - match (expected.def_id.krate == ast::LOCAL_CRATE, self.map.opt_span(expected.def_id.node)) { + match (expected.def_id.krate == ast::LOCAL_CRATE, + self.map.opt_span(expected.def_id.node)) { (true, Some(span)) => { self.sess.span_note(span, &format!("a default was defined here...")); @@ -5464,15 +5465,17 @@ impl<'tcx> ctxt<'tcx> { .map(|p| p.to_string()) .collect::>(); self.sess.note( - &format!("a default is defined on `{}`", + &format!("a default is defined on `{}`", elems.join("::"))); } } - self.sess.span_note(expected.origin_span, - &format!("...that was applied to an unconstrained type variable here")); + self.sess.span_note( + expected.origin_span, + &format!("...that was applied to an unconstrained type variable here")); - match (found.def_id.krate == ast::LOCAL_CRATE, self.map.opt_span(found.def_id.node)) { + match (found.def_id.krate == ast::LOCAL_CRATE, + self.map.opt_span(found.def_id.node)) { (true, Some(span)) => { self.sess.span_note(span, &format!("a second default was defined here...")); @@ -5488,8 +5491,9 @@ impl<'tcx> ctxt<'tcx> { } } - self.sess.span_note(found.origin_span, - &format!("...that also applies to the same type variable here")); + self.sess.span_note( + found.origin_span, + &format!("...that also applies to the same type variable here")); } _ => {} } diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index 12e14dbcb92f8..e9869e2a00e5d 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -349,7 +349,9 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> { } else if num_supplied_types != num_method_types { span_err!(self.tcx().sess, self.span, E0036, "incorrect number of type parameters given for this method"); - final_substs.types.replace(subst::FnSpace, vec![self.tcx().types.err; num_method_types]); + final_substs.types.replace( + subst::FnSpace, + vec![self.tcx().types.err; num_method_types]); } else { final_substs.types.replace(subst::FnSpace, supplied_method_types); } diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 1bcb7a5ce031f..e3f55cca9ee51 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -190,7 +190,7 @@ pub fn lookup_in_trait_adjusted<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, type_parameter_defs); } } - + let trait_ref = ty::TraitRef::new(trait_def_id, fcx.tcx().mk_substs(substs)); // Construct an obligation