diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index bb27918075df..866c0b8cb42c 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1849,12 +1849,12 @@ pub fn partition_bounds<'a>(tcx: &ty::ctxt, &mut builtin_bounds) { let segments = &b.trait_ref.path.segments; let parameters = &segments[segments.len() - 1].parameters; - if parameters.is_empty() { - continue; // success + if !parameters.is_empty() { + span_err!(tcx.sess, b.trait_ref.path.span, E0316, + "builtin bounds do not require arguments, {} given", + parameters.lifetimes().len() + parameters.types().len()); } - span_err!(tcx.sess, b.trait_ref.path.span, E0316, - "builtin bounds do not require arguments, {} given", - parameters.types().len()); + continue; // success } } _ => { diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 4e94be59ade0..7cc07e926b26 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -332,6 +332,7 @@ pub fn winsorize(samples: &mut [T], pct: T) { /// Returns a HashMap with the number of occurrences of every element in the /// sequence that the iterator exposes. +#[cfg(not(stage0))] pub fn freq_count(iter: T) -> hash_map::HashMap where T: Iterator, U: Eq + Clone + Hash { diff --git a/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs b/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs index 3914fb96a0d3..b6d45b1bbf86 100644 --- a/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs +++ b/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs @@ -15,13 +15,13 @@ trait Trait: Copy {} //~^ ERROR: builtin bounds do not require arguments, 1 given struct MyStruct1>; -//~^ ERROR: builtin bounds do not require arguments, 1 given +//~^ ERROR builtin bounds do not require arguments, 1 given struct MyStruct2<'a, T: Copy<'a>>; //~^ ERROR: builtin bounds do not require arguments, 1 given fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} -//~^ ERROR: builtin bounds do not require arguments, 1 given +//~^ ERROR builtin bounds do not require arguments, 2 given fn main() { }