1
Fork 0

Rollup merge of #77093 - lcnr:const-generics-infer-warning, r=varkor

merge `need_type_info_err(_const)`

I hoped that this would automatically solve #76737 but it doesn't quite seem like it

fixes #77092

r? @varkor
This commit is contained in:
Ralf Jung 2020-09-26 12:58:17 +02:00 committed by GitHub
commit ac8169dc10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 253 additions and 154 deletions

View file

@ -2991,7 +2991,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
ty
} else {
if !self.is_tainted_by_errors() {
self.need_type_info_err((**self).body_id, sp, ty, E0282)
self.emit_inference_failure_err((**self).body_id, sp, ty.into(), E0282)
.note("type must be known at this point")
.emit();
}

View file

@ -653,7 +653,12 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
fn report_type_error(&self, t: Ty<'tcx>) {
if !self.tcx.sess.has_errors() {
self.infcx
.need_type_info_err(Some(self.body.id()), self.span.to_span(self.tcx), t, E0282)
.emit_inference_failure_err(
Some(self.body.id()),
self.span.to_span(self.tcx),
t.into(),
E0282,
)
.emit();
}
}
@ -661,10 +666,10 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
fn report_const_error(&self, c: &'tcx ty::Const<'tcx>) {
if !self.tcx.sess.has_errors() {
self.infcx
.need_type_info_err_const(
.emit_inference_failure_err(
Some(self.body.id()),
self.span.to_span(self.tcx),
c,
c.into(),
E0282,
)
.emit();