Skip to content

Rollup of 19 pull requests #35462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2f5294e
Fixes #35304
mikhail-m1 Aug 5, 2016
e7e5cfe
Merge branch 'master' of https://github.com/rust-lang/rust
mikhail-m1 Aug 5, 2016
5bab0e6
Update E0206 message to new format
KiChjang Aug 5, 2016
065c685
Update E0223 to the new format
KiChjang Aug 6, 2016
c9e9d42
Update compiler error 0027 to use new error format.
silenuss Aug 6, 2016
1d25e2e
Update compiler error 0029 to use new error format.
silenuss Aug 6, 2016
f4dd1f9
Updated error message E0252
Aug 5, 2016
eb469d6
Updated E0225 to new format.
razielgn Aug 6, 2016
6eba89e
Fixing compiler error E0121
intrepion Aug 6, 2016
95cce86
Indicate tracking issue for `exact_size_is_empty` unstability.
frewsxcv Aug 6, 2016
19e4579
Updated error message E0282
Aug 5, 2016
e8da915
Fix build on DragonFly (unused function errno_location)
mneumann Aug 6, 2016
0a6b862
Add doc example for `std::ffi::NulError::into_vec`.
frewsxcv Aug 6, 2016
5e06da2
E0131 updated to new format
Aug 6, 2016
02f3609
Update error message for E0243 and E0244
Aug 6, 2016
0e13b63
Update E0220 message to new format
chamoysvoice Aug 6, 2016
ac10b5f
Update error E0117 to new format
Detegr Aug 7, 2016
e91f3f6
Update error E0118 to new format
Detegr Aug 7, 2016
54e1e98
Update E0204 to the new error format
munyari Aug 7, 2016
ed72c65
Updates compiler error E0046 with new format
shri3k Aug 5, 2016
b564c6a
Updates compiler error E0040 with new format
shri3k Aug 5, 2016
ee5b2df
Rollup merge of #35355 - shri3k:E0046, r=jonathandturner
Aug 7, 2016
feb458d
Rollup merge of #35357 - shri3k:E0040, r=jonathandturner
Aug 7, 2016
262c91f
Rollup merge of #35362 - medzin:E0252, r=GuillaumeGomez
Aug 7, 2016
5b22d2b
Rollup merge of #35366 - medzin:E0282, r=jonathandturner
Aug 7, 2016
d556e04
Rollup merge of #35394 - mikhail-m1:master, r=jonathandturner
Aug 7, 2016
d58d045
Rollup merge of #35402 - KiChjang:e0206-new-msg, r=GuillaumeGomez
Aug 7, 2016
b5261aa
Rollup merge of #35410 - silenuss:e0027-formatting, r=jonathandturner
Aug 7, 2016
f40b2ff
Rollup merge of #35411 - KiChjang:e0223-new-format, r=jonathandturner
Aug 7, 2016
eb9db9f
Rollup merge of #35412 - chamoysvoice:e0220, r=jonathandturner
Aug 7, 2016
3251520
Rollup merge of #35413 - silenuss:e0029-formatting, r=jonathandturner
Aug 7, 2016
350125b
Rollup merge of #35417 - Limeth:master, r=jonathandturner
Aug 7, 2016
2da9967
Rollup merge of #35419 - Keats:err-243, r=jonathandturner
Aug 7, 2016
abbfb1f
Rollup merge of #35421 - razielgn:updated-e0225-to-new-format, r=jona…
Aug 7, 2016
26f137b
Rollup merge of #35429 - frewsxcv:tracking-is-empty, r=apasel422
Aug 7, 2016
71aa493
Rollup merge of #35433 - mneumann:dragonfly-fix-libstd-errno-location…
Aug 7, 2016
f04b440
Rollup merge of #35434 - intrepion:fix-compile-fail-e0121, r=jonathan…
Aug 7, 2016
db04c10
Rollup merge of #35436 - frewsxcv:into-vec, r=GuillaumeGomez
Aug 7, 2016
236c089
Rollup merge of #35454 - Detegr:master, r=jonathandturner
Aug 7, 2016
1703f87
Rollup merge of #35455 - munyari:e0204, r=jonathandturner
Aug 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2261,20 +2261,27 @@ fn check_type_argument_count(tcx: TyCtxt, span: Span, supplied: usize,
} else {
"expected"
};
span_err!(tcx.sess, span, E0243,
"wrong number of type arguments: {} {}, found {}",
expected, required, supplied);
struct_span_err!(tcx.sess, span, E0243, "wrong number of type arguments")
.span_label(
span,
&format!("{} {} type arguments, found {}", expected, required, supplied)
)
.emit();
} else if supplied > accepted {
let expected = if required < accepted {
"expected at most"
let expected = if required == 0 {
"expected no".to_string()
} else if required < accepted {
format!("expected at most {}", accepted)
} else {
"expected"
format!("expected {}", accepted)
};
span_err!(tcx.sess, span, E0244,
"wrong number of type arguments: {} {}, found {}",
expected,
accepted,
supplied);

struct_span_err!(tcx.sess, span, E0244, "wrong number of type arguments")
.span_label(
span,
&format!("{} type arguments, found {}", expected, supplied)
)
.emit();
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0243.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// except according to those terms.

struct Foo<T> { x: T }
struct Bar { x: Foo } //~ ERROR E0243
struct Bar { x: Foo }
//~^ ERROR E0243
//~| NOTE expected 1 type arguments, found 0

fn main() {
}
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0244.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
// except according to those terms.

struct Foo { x: bool }
struct Bar<S, T> { x: Foo<S, T> } //~ ERROR E0244
struct Bar<S, T> { x: Foo<S, T> }
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 2


fn main() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ struct Vec<T, A = Heap>(
marker::PhantomData<(T,A)>);

fn main() {
let _: Vec; //~ ERROR wrong number of type arguments: expected at least 1, found 0
let _: Vec;
//~^ ERROR E0243
//~| NOTE expected at least 1 type arguments, found 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ struct Vec<T, A = Heap>(

fn main() {
let _: Vec<isize, Heap, bool>;
//~^ ERROR wrong number of type arguments: expected at most 2, found 3
//~^ ERROR E0244
//~| NOTE expected at most 2 type arguments, found 3
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/issue-14092.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn fn1(0: Box) {} //~ ERROR: wrong number of type arguments: expected 1, found 0
fn fn1(0: Box) {}
//~^ ERROR E0243
//~| NOTE expected 1 type arguments, found 0

fn main() {}
7 changes: 6 additions & 1 deletion src/test/compile-fail/issue-23024.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ fn main()
vfnfer.push(box h);
println!("{:?}",(vfnfer[0] as Fn)(3));
//~^ ERROR the precise format of `Fn`-family traits'
//~| ERROR wrong number of type arguments: expected 1, found 0
//~| ERROR E0243
//~| NOTE expected 1 type arguments, found 0
//~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`)
//~| NOTE in this expansion of println!
//~| NOTE in this expansion of println!
//~| NOTE in this expansion of println!
//~| NOTE in this expansion of println!
}
17 changes: 12 additions & 5 deletions src/test/compile-fail/typeck-builtin-bound-type-parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@
// except according to those terms.

fn foo1<T:Copy<U>, U>(x: T) {}
//~^ ERROR: wrong number of type arguments: expected 0, found 1
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1

trait Trait: Copy<Send> {}
//~^ ERROR: wrong number of type arguments: expected 0, found 1
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1

struct MyStruct1<T: Copy<T>>;
//~^ ERROR wrong number of type arguments: expected 0, found 1
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1

struct MyStruct2<'a, T: Copy<'a>>;
//~^ ERROR: wrong number of lifetime parameters: expected 0, found 1
//~| NOTE unexpected lifetime parameter


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
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1
//~| ERROR: wrong number of lifetime parameters: expected 0, found 1
//~| NOTE unexpected lifetime parameter

fn main() {
}
3 changes: 2 additions & 1 deletion src/test/compile-fail/typeck_type_placeholder_lifetime_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ struct Foo<'a, T:'a> {

pub fn main() {
let c: Foo<_, _> = Foo { r: &5 };
//~^ ERROR wrong number of type arguments: expected 1, found 2
//~^ ERROR E0244
//~| NOTE expected 1 type arguments, found 2
}
3 changes: 2 additions & 1 deletion src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ struct Foo<'a, T:'a> {

pub fn main() {
let c: Foo<_, usize> = Foo { r: &5 };
//~^ ERROR wrong number of type arguments: expected 1, found 2
//~^ ERROR E0244
//~| NOTE expected 1 type arguments, found 2
}
3 changes: 2 additions & 1 deletion src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
trait Trait {}

fn f<F:Trait(isize) -> isize>(x: F) {}
//~^ ERROR wrong number of type arguments: expected 0, found 1
//~^ ERROR E0244
//~| NOTE expected no type arguments, found 1
//~| ERROR associated type `Output` not found

fn main() {}