Skip to content

Commit 20dcc72

Browse files
committed
inform type annotations
1 parent 4d2d3fc commit 20dcc72

13 files changed

+15
-43
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,9 +5086,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
50865086
// If not, error.
50875087
if alternative.is_ty_var() || alternative.references_error() {
50885088
if !self.is_tainted_by_errors() {
5089-
type_error_struct!(self.tcx.sess, sp, ty, E0619,
5090-
"the type of this value must be known in this context")
5091-
.emit();
5089+
self.need_type_info((**self).body_id, sp, ty);
50925090
}
50935091
self.demand_suptype(sp, self.tcx.types.err, ty);
50945092
ty = self.tcx.types.err;

src/librustc_typeck/diagnostics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4368,12 +4368,13 @@ i_am_a_function();
43684368
"##,
43694369

43704370
E0619: r##"
4371+
#### Note: this error code is no longer emitted by the compiler.
43714372
The type-checker needed to know the type of an expression, but that type had not
43724373
yet been inferred.
43734374
43744375
Erroneous code example:
43754376
4376-
```compile_fail,E0619
4377+
```compile_fail
43774378
let mut x = vec![];
43784379
match x.pop() {
43794380
Some(v) => {

src/test/compile-fail/epoch-raw-pointer-method-2015.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ fn main() {
1818
let x = 0;
1919
let y = &x as *const _;
2020
let _ = y.is_null();
21-
//~^ error: the type of this value must be known in this context [tyvar_behind_raw_pointer]
21+
//~^ error: type annotations needed [tyvar_behind_raw_pointer]
2222
//~^^ warning: this was previously accepted
2323
}

src/test/compile-fail/issue-15965.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fn main() {
1212
return
1313
{ return () }
14-
//~^ ERROR the type of this value must be known in this context
14+
//~^ ERROR type annotations needed [E0282]
1515
()
1616
;
1717
}

src/test/compile-fail/issue-2151.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
fn main() {
1212
let x = panic!();
13-
x.clone(); //~ ERROR the type of this value must be known in this context
13+
x.clone(); //~ ERROR type annotations needed
1414
}

src/test/compile-fail/match-vec-mismatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ fn main() {
4343
fn another_fn_to_avoid_suppression() {
4444
match Default::default()
4545
{
46-
[] => {} //~ ERROR the type of this value
46+
[] => {} //~ ERROR type annotations needed
4747
};
4848
}

src/test/compile-fail/pat-tuple-bad-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let x;
1313

1414
match x {
15-
(..) => {} //~ ERROR the type of this value must be known in this context
15+
(..) => {} //~ ERROR type annotations needed
1616
_ => {}
1717
}
1818

src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn a() {
2424
match closure0.take() {
2525
Some(c) => {
2626
return c();
27-
//~^ ERROR the type of this value must be known in this context
27+
//~^ ERROR type annotations needed
2828
}
2929
None => { }
3030
}

src/test/ui/error-codes/E0619.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/test/ui/error-codes/E0619.stderr

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)