about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2024-06-26 14:21:13 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2024-06-29 10:42:31 +0000
commit61ede075bfbb1bcbe09595565381ab9c5ef5deec (patch)
tree814642ed95f495691d612739168b42e58a88f299 /compiler/rustc_mir_dataflow/src
parentd7c59370cea68cd17006ec3440a43254fd0eda7d (diff)
downloadrust-61ede075bfbb1bcbe09595565381ab9c5ef5deec.tar.gz
rust-61ede075bfbb1bcbe09595565381ab9c5ef5deec.zip
Stop ICEing on impossible predicates.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index 5e2d88f94ca..bfbfff7e259 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -846,9 +846,10 @@ impl Map {
 
         if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ref_ty, _) = ty.kind()
             && let ty::Slice(..) = ref_ty.kind()
+            // The user may have written a predicate like `[T]: Sized` in their where clauses,
+            // which makes slices scalars.
+            && self.places[place].value_index.is_none()
         {
-            assert!(self.places[place].value_index.is_none(), "slices are not scalars");
-
             // Prepend new child to the linked list.
             let len = self.places.push(PlaceInfo::new(Some(TrackElem::DerefLen)));
             self.places[len].next_sibling = self.places[place].first_child;