reviews
This commit is contained in:
parent
611db1d3f3
commit
25ed5d5db2
2 changed files with 43 additions and 43 deletions
|
@ -1044,7 +1044,6 @@ fn check_impl_items_against_trait<'tcx>(
|
||||||
let impl_item_full = tcx.hir().impl_item(impl_item.id);
|
let impl_item_full = tcx.hir().impl_item(impl_item.id);
|
||||||
match impl_item_full.kind {
|
match impl_item_full.kind {
|
||||||
hir::ImplItemKind::Const(..) => {
|
hir::ImplItemKind::Const(..) => {
|
||||||
// Find associated const definition.
|
|
||||||
let _ = tcx.compare_assoc_const_impl_item_with_trait_item((
|
let _ = tcx.compare_assoc_const_impl_item_with_trait_item((
|
||||||
impl_item.id.def_id.def_id,
|
impl_item.id.def_id.def_id,
|
||||||
ty_impl_item.trait_item_def_id.unwrap(),
|
ty_impl_item.trait_item_def_id.unwrap(),
|
||||||
|
|
|
@ -1349,11 +1349,12 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
|
||||||
|
|
||||||
debug!("compare_const_impl: trait_ty={:?}", trait_ty);
|
debug!("compare_const_impl: trait_ty={:?}", trait_ty);
|
||||||
|
|
||||||
let maybe_error_reported = infcx
|
let err = infcx
|
||||||
.at(&cause, param_env)
|
.at(&cause, param_env)
|
||||||
.sup(trait_ty, impl_ty)
|
.sup(trait_ty, impl_ty)
|
||||||
.map(|ok| ocx.register_infer_ok_obligations(ok))
|
.map(|ok| ocx.register_infer_ok_obligations(ok));
|
||||||
.map_err(|terr| {
|
|
||||||
|
if let Err(terr) = err {
|
||||||
debug!(
|
debug!(
|
||||||
"checking associated const for compatibility: impl ty {:?}, trait ty {:?}",
|
"checking associated const for compatibility: impl ty {:?}, trait ty {:?}",
|
||||||
impl_ty, trait_ty
|
impl_ty, trait_ty
|
||||||
|
@ -1393,8 +1394,8 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
diag.emit()
|
return Err(diag.emit());
|
||||||
});
|
};
|
||||||
|
|
||||||
// Check that all obligations are satisfied by the implementation's
|
// Check that all obligations are satisfied by the implementation's
|
||||||
// version.
|
// version.
|
||||||
|
@ -1407,7 +1408,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
|
||||||
let outlives_environment = OutlivesEnvironment::new(param_env);
|
let outlives_environment = OutlivesEnvironment::new(param_env);
|
||||||
infcx
|
infcx
|
||||||
.check_region_obligations_and_report_errors(impl_const_item_def, &outlives_environment);
|
.check_region_obligations_and_report_errors(impl_const_item_def, &outlives_environment);
|
||||||
maybe_error_reported
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue