Skip to content

Commit ad83b47

Browse files
Rollup merge of #48198 - csmoe:inform_type_annotations, r=estebank
inform user where to give a type annotation should resolve #47777 previous pull request #47982 was closed because of a mistaken rebase. r? @estebank
2 parents f0343cb + 4370a58 commit ad83b47

14 files changed

+20
-46
lines changed

src/librustc_typeck/check/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
337337
lint::builtin::TYVAR_BEHIND_RAW_POINTER,
338338
scope_expr_id,
339339
span,
340-
&format!("the type of this value must be known in this context"));
340+
&format!("type annotations needed"));
341341
}
342342
} else {
343343
let t = self.structurally_resolved_type(span, final_ty);

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5052,9 +5052,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
50525052
ty
50535053
} else {
50545054
if !self.is_tainted_by_errors() {
5055-
type_error_struct!(self.tcx.sess, sp, ty, E0619,
5056-
"the type of this value must be known in this context")
5057-
.emit();
5055+
self.need_type_info((**self).body_id, sp, ty);
50585056
}
50595057
self.demand_suptype(sp, self.tcx.types.err, ty);
50605058
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.

0 commit comments

Comments
 (0)