Skip to content

Commit 61ede07

Browse files
committed
Stop ICEing on impossible predicates.
1 parent d7c5937 commit 61ede07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_mir_dataflow/src/value_analysis.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,10 @@ impl Map {
846846

847847
if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ref_ty, _) = ty.kind()
848848
&& let ty::Slice(..) = ref_ty.kind()
849+
// The user may have written a predicate like `[T]: Sized` in their where clauses,
850+
// which makes slices scalars.
851+
&& self.places[place].value_index.is_none()
849852
{
850-
assert!(self.places[place].value_index.is_none(), "slices are not scalars");
851-
852853
// Prepend new child to the linked list.
853854
let len = self.places.push(PlaceInfo::new(Some(TrackElem::DerefLen)));
854855
self.places[len].next_sibling = self.places[place].first_child;

0 commit comments

Comments
 (0)