Get rid of can_eq_shallow
This commit is contained in:
@@ -12,6 +12,7 @@ use rustc_middle::{
|
||||
use rustc_span::{def_id::DefId, sym, BytePos, Span, Symbol};
|
||||
|
||||
use crate::error_reporting::TypeErrCtxt;
|
||||
use crate::infer::InferCtxtExt;
|
||||
|
||||
impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||
pub fn note_and_explain_type_err(
|
||||
@@ -821,7 +822,7 @@ fn foo(&self) -> Self::T { String::new() }
|
||||
tcx.defaultness(item.id.owner_id)
|
||||
{
|
||||
let assoc_ty = tcx.type_of(item.id.owner_id).instantiate_identity();
|
||||
if self.infcx.can_eq_shallow(param_env, assoc_ty, found) {
|
||||
if self.infcx.can_eq(param_env, assoc_ty, found) {
|
||||
diag.span_label(
|
||||
item.span,
|
||||
"associated type defaults can't be assumed inside the \
|
||||
@@ -844,7 +845,7 @@ fn foo(&self) -> Self::T { String::new() }
|
||||
let assoc_ty = tcx.type_of(item.id.owner_id).instantiate_identity();
|
||||
if let hir::Defaultness::Default { has_value: true } =
|
||||
tcx.defaultness(item.id.owner_id)
|
||||
&& self.infcx.can_eq_shallow(param_env, assoc_ty, found)
|
||||
&& self.infcx.can_eq(param_env, assoc_ty, found)
|
||||
{
|
||||
diag.span_label(
|
||||
item.span,
|
||||
|
||||
Reference in New Issue
Block a user