Skip to content

Commit

Permalink
Address tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jroesch authored and Jared Roesch committed Jul 26, 2015
1 parent 99a1293 commit 7716541
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 11 additions & 7 deletions src/librustc/middle/ty.rs
Expand Up @@ -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..."));
Expand All @@ -5464,15 +5465,17 @@ impl<'tcx> ctxt<'tcx> {
.map(|p| p.to_string())
.collect::<Vec<_>>();
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..."));
Expand All @@ -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"));
}
_ => {}
}
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_typeck/check/method/confirm.rs
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/method/mod.rs
Expand Up @@ -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
Expand Down

0 comments on commit 7716541

Please sign in to comment.