Rollup merge of #136325 - compiler-errors:indirectly, r=RalfJung
Delay a bug when indexing unsized slices Fixes #136298 r? RalfJung or reassign
This commit is contained in:
commit
f1daf9e2c4
3 changed files with 48 additions and 1 deletions
|
@ -634,7 +634,12 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
Rvalue::RawPtr(RawPtrKind::FakeForPtrMetadata, place) => {
|
||||
// These are only inserted for slice length, so the place must already be indirect.
|
||||
// This implies we do not have to worry about whether the borrow escapes.
|
||||
assert!(place.is_indirect(), "fake borrows are always indirect");
|
||||
if !place.is_indirect() {
|
||||
self.tcx.dcx().span_delayed_bug(
|
||||
self.body.source_info(location).span,
|
||||
"fake borrows are always indirect",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Rvalue::Cast(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue