Change:
Example: I left a FIXME at the relevant part of the code.
Nominating for something.
I can mentor...
I'm willing to have a look if the mentor offer stands
I already have a proposed fix, I just need to clean it up and add a test.
thanks for volunteering. The offer is still up but has been working on it. I'm happy to help with other bugs too.

Discussion:
rscope.anon_regions(span, expected_num_region_params); if supplied_num_region_params != 0 || anon_regions.is_err() { <del> span_err!(tcx.sess, span, E0107, "wrong number of lifetime parameters: expected {}, found {}", expected_num_region_params, supplied_num_region_params); </del> <ins> report_lifetime_number_error(tcx, span, supplied_num_region_params, expected_num_region_params); </ins> } match anon_regions {

.count(); let mut type_substs = types_provided; <ins> check_type_argument_count(this.tcx(), span, supplied_ty_param_count, required_ty_param_count, formal_ty_param_count); </ins> if supplied_ty_param_count < required_ty_param_count { <del> let expected = if required_ty_param_count < formal_ty_param_count { "expected at least" } else { "expected" }; span_err!(this.tcx().sess, span, E0243, "wrong number of type arguments: {} {}, found {}", expected, required_ty_param_count, supplied_ty_param_count); </del> while type_substs.len() < required_ty_param_count { type_substs.push(tcx.types.err); } } else if supplied_ty_param_count > formal_ty_param_count { <del> let expected = if required_ty_param_count < formal_ty_param_count { "expected at most" } else { "expected" }; span_err!(this.tcx().sess, span, E0244, "wrong number of type arguments: {} {}, found {}", expected, formal_ty_param_count, supplied_ty_param_count); </del> type_substs.truncate(formal_ty_param_count); } assert!(type_substs.len() >= required_ty_param_count &&

if ty::try_add_builtin_trait(tcx, trait_did, &mut builtin_bounds) { <del> // FIXME(#20302) -- we should check for things like Copy<T> </del> <ins> let segments = &b.trait_ref.path.segments; let parameters = &segments[segments.len() - 1].parameters; if parameters.types().len() > 0 { check_type_argument_count(tcx, b.trait_ref.path.span, parameters.types().len(), 0, 0); } if parameters.lifetimes().len() > 0{ report_lifetime_number_error(tcx, b.trait_ref.path.span, parameters.lifetimes().len(), 0); } </ins> continue; // success } }

"associated type bindings are not allowed here"); } } <ins> fn check_type_argument_count(tcx: &ty::ctxt, span: Span, supplied: usize, required: usize, accepted: usize) { if supplied < required { let expected = if required < accepted { "expected at least" } else { "expected" }; span_err!(tcx.sess, span, E0243, "wrong number of type arguments: {} {}, found {}", expected, required, supplied); } else if supplied > accepted { let expected = if required < accepted { "expected at most" } else { "expected" }; span_err!(tcx.sess, span, E0244, "wrong number of type arguments: {} {}, found {}", expected, accepted, supplied); } } fn report_lifetime_number_error(tcx: &ty::ctxt, span: Span, number: usize, expected: usize) { span_err!(tcx.sess, span, E0107, "wrong number of lifetime parameters: expected {}, found {}", expected, number); } </ins>

E0247, // found module name used as a type E0248, // found value name used as a type E0249, // expected constant expr for array length <del> E0250  // expected constant expr for array length </del> <ins> E0250, // expected constant expr for array length </ins> } __build_diagnostic_array! { DIAGNOSTICS }

/// Returns a HashMap with the number of occurrences of every element in the /// sequence that the iterator exposes. <ins> #[cfg(not(stage0))] </ins> pub fn freq_count<T, U>(iter: T) -> hash_map::HashMap<U, uint> where T: Iterator<Item=U>, U: Eq + Clone + Hash {

<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn foo1<T:Copy<U>, U>(x: T) {} //~^ ERROR: wrong number of type arguments: expected 0, found 1 trait Trait: Copy<Send> {} //~^ ERROR: wrong number of type arguments: expected 0, found 1 struct MyStruct1<T: Copy<T>>; //~^ ERROR wrong number of type arguments: expected 0, found 1 struct MyStruct2<'a, T: Copy<'a>>; //~^ ERROR: wrong number of lifetime parameters: expected 0, found 1 fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} //~^ ERROR: wrong number of type arguments: expected 0, found 1 //~^^ ERROR: wrong number of lifetime parameters: expected 0, found 1 fn main() { } </ins>