Deal with fallout
This commit is contained in:
parent
8ac3ffe834
commit
62174bfe72
17 changed files with 47 additions and 29 deletions
|
@ -278,7 +278,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
// Arrays give us `[]`, `[{ty}; _]` and `[{ty}; N]`
|
||||
if let ty::Array(aty, len) = self_ty.kind() {
|
||||
flags.push((sym::_Self, Some("[]".to_string())));
|
||||
let len = len.kind().try_to_value().and_then(|v| v.try_to_target_usize(self.tcx));
|
||||
let len = len.try_to_value().and_then(|v| v.try_to_target_usize(self.tcx));
|
||||
flags.push((sym::_Self, Some(format!("[{}; _]", aty))));
|
||||
if let Some(n) = len {
|
||||
flags.push((sym::_Self, Some(format!("[{}; {}]", aty, n))));
|
||||
|
|
|
@ -528,7 +528,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
|
|||
debug!("equating consts:\nc1= {:?}\nc2= {:?}", c1, c2);
|
||||
|
||||
use rustc_hir::def::DefKind;
|
||||
use ty::ConstKind::Unevaluated;
|
||||
use ty::Unevaluated;
|
||||
match (c1.kind(), c2.kind()) {
|
||||
(Unevaluated(a), Unevaluated(b))
|
||||
if a.def == b.def && tcx.def_kind(a.def) == DefKind::AssocConst =>
|
||||
|
|
|
@ -897,7 +897,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
);
|
||||
|
||||
use rustc_hir::def::DefKind;
|
||||
use ty::ConstKind::Unevaluated;
|
||||
use ty::Unevaluated;
|
||||
match (c1.kind(), c2.kind()) {
|
||||
(Unevaluated(a), Unevaluated(b))
|
||||
if a.def == b.def && tcx.def_kind(a.def) == DefKind::AssocConst =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue