about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2021-10-29 13:14:44 +0200
committerb-naber <bn263@gmx.de>2021-10-29 13:47:53 +0200
commit87fbf3c5aaff62cb70cf95ccfd756f4f147e8fea (patch)
treef80d05f4a333610824fab53d72a18450a3870c10 /compiler
parent4e0d3973fafdfb1c51011bc74e44257b5e3863f1 (diff)
downloadrust-87fbf3c5aaff62cb70cf95ccfd756f4f147e8fea.tar.gz
rust-87fbf3c5aaff62cb70cf95ccfd756f4f147e8fea.zip
ignore type flags insertion in default_anon_const_substs if error occurred
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/collect/type_of.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs
index cee3679d0a0..96211be8cdc 100644
--- a/compiler/rustc_typeck/src/collect/type_of.rs
+++ b/compiler/rustc_typeck/src/collect/type_of.rs
@@ -292,7 +292,8 @@ pub(super) fn default_anon_const_substs(tcx: TyCtxt<'_>, def_id: DefId) -> Subst
     // Getting this wrong can lead to ICE and unsoundness, so we assert it here.
     for arg in substs.iter() {
         let allowed_flags = ty::TypeFlags::MAY_NEED_DEFAULT_CONST_SUBSTS
-            | ty::TypeFlags::STILL_FURTHER_SPECIALIZABLE;
+            | ty::TypeFlags::STILL_FURTHER_SPECIALIZABLE
+            | ty::TypeFlags::HAS_ERROR;
         assert!(!arg.has_type_flags(!allowed_flags));
     }
     substs