mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 12:33:57 +00:00
Stop ICEing on impossible predicates.
This commit is contained in:
parent
d7c59370ce
commit
61ede075bf
|
@ -846,9 +846,10 @@ fn register_children<'tcx>(
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue