Skip to content

Commit 65bd2a6

Browse files
committed
Auto merge of rust-lang#105951 - matthiaskrgr:rollup-aqxz888, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#105835 (Refactor post borrowck cleanup passes) - rust-lang#105930 (Disable `NormalizeArrayLen`) - rust-lang#105938 (Update coerce_unsized tracking issue from rust-lang#27732 to rust-lang#18598) - rust-lang#105939 (Improve description of struct-fields GUI test) - rust-lang#105943 (Add regression test for rust-lang#102206) - rust-lang#105944 (Add regression test for rust-lang#80816) - rust-lang#105945 (Add regression test for rust-lang#57404) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8a746f4 + 8db5dd4 commit 65bd2a6

25 files changed

+207
-124
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,48 @@
1-
//! This module provides a pass to replacing the following statements with
2-
//! [`Nop`]s
1+
//! This module provides a pass that removes parts of MIR that are no longer relevant after
2+
//! analysis phase and borrowck. In particular, it removes false edges, user type annotations and
3+
//! replaces following statements with [`Nop`]s:
34
//!
45
//! - [`AscribeUserType`]
56
//! - [`FakeRead`]
67
//! - [`Assign`] statements with a [`Shallow`] borrow
78
//!
8-
//! The `CleanFakeReadsAndBorrows` "pass" is actually implemented as two
9-
//! traversals (aka visits) of the input MIR. The first traversal,
10-
//! `DeleteAndRecordFakeReads`, deletes the fake reads and finds the
11-
//! temporaries read by [`ForMatchGuard`] reads, and `DeleteFakeBorrows`
12-
//! deletes the initialization of those temporaries.
13-
//!
149
//! [`AscribeUserType`]: rustc_middle::mir::StatementKind::AscribeUserType
15-
//! [`Shallow`]: rustc_middle::mir::BorrowKind::Shallow
16-
//! [`FakeRead`]: rustc_middle::mir::StatementKind::FakeRead
1710
//! [`Assign`]: rustc_middle::mir::StatementKind::Assign
18-
//! [`ForMatchGuard`]: rustc_middle::mir::FakeReadCause::ForMatchGuard
11+
//! [`FakeRead`]: rustc_middle::mir::StatementKind::FakeRead
1912
//! [`Nop`]: rustc_middle::mir::StatementKind::Nop
13+
//! [`Shallow`]: rustc_middle::mir::BorrowKind::Shallow
2014
2115
use crate::MirPass;
22-
use rustc_middle::mir::visit::MutVisitor;
23-
use rustc_middle::mir::{Body, BorrowKind, Location, Rvalue};
24-
use rustc_middle::mir::{Statement, StatementKind};
16+
use rustc_middle::mir::{Body, BorrowKind, Rvalue, StatementKind, TerminatorKind};
2517
use rustc_middle::ty::TyCtxt;
2618

27-
pub struct CleanupNonCodegenStatements;
19+
pub struct CleanupPostBorrowck;
2820

29-
pub struct DeleteNonCodegenStatements<'tcx> {
30-
tcx: TyCtxt<'tcx>,
31-
}
21+
impl<'tcx> MirPass<'tcx> for CleanupPostBorrowck {
22+
fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
23+
for basic_block in body.basic_blocks.as_mut() {
24+
for statement in basic_block.statements.iter_mut() {
25+
match statement.kind {
26+
StatementKind::AscribeUserType(..)
27+
| StatementKind::Assign(box (_, Rvalue::Ref(_, BorrowKind::Shallow, _)))
28+
| StatementKind::FakeRead(..) => statement.make_nop(),
29+
_ => (),
30+
}
31+
}
32+
let terminator = basic_block.terminator_mut();
33+
match terminator.kind {
34+
TerminatorKind::FalseEdge { real_target, .. }
35+
| TerminatorKind::FalseUnwind { real_target, .. } => {
36+
terminator.kind = TerminatorKind::Goto { target: real_target };
37+
}
38+
_ => {}
39+
}
40+
}
3241

33-
impl<'tcx> MirPass<'tcx> for CleanupNonCodegenStatements {
34-
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
35-
let mut delete = DeleteNonCodegenStatements { tcx };
36-
delete.visit_body_preserves_cfg(body);
3742
body.user_type_annotations.raw.clear();
3843

3944
for decl in &mut body.local_decls {
4045
decl.user_ty = None;
4146
}
4247
}
4348
}
44-
45-
impl<'tcx> MutVisitor<'tcx> for DeleteNonCodegenStatements<'tcx> {
46-
fn tcx(&self) -> TyCtxt<'tcx> {
47-
self.tcx
48-
}
49-
50-
fn visit_statement(&mut self, statement: &mut Statement<'tcx>, location: Location) {
51-
match statement.kind {
52-
StatementKind::AscribeUserType(..)
53-
| StatementKind::Assign(box (_, Rvalue::Ref(_, BorrowKind::Shallow, _)))
54-
| StatementKind::FakeRead(..) => statement.make_nop(),
55-
_ => (),
56-
}
57-
self.super_statement(statement, location);
58-
}
59-
}

compiler/rustc_mir_transform/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ mod match_branches;
7777
mod multiple_return_terminators;
7878
mod normalize_array_len;
7979
mod nrvo;
80-
// This pass is public to allow external drivers to perform MIR cleanup
81-
pub mod remove_false_edges;
8280
mod remove_noop_landing_pads;
8381
mod remove_storage_markers;
8482
mod remove_uninit_drops;
@@ -494,10 +492,9 @@ fn run_analysis_to_runtime_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>
494492
/// After this series of passes, no lifetime analysis based on borrowing can be done.
495493
fn run_analysis_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
496494
let passes: &[&dyn MirPass<'tcx>] = &[
497-
&remove_false_edges::RemoveFalseEdges,
495+
&cleanup_post_borrowck::CleanupPostBorrowck,
498496
&simplify_branches::SimplifyConstCondition::new("initial"),
499497
&remove_noop_landing_pads::RemoveNoopLandingPads,
500-
&cleanup_post_borrowck::CleanupNonCodegenStatements,
501498
&simplify::SimplifyCfg::new("early-opt"),
502499
&deref_separator::Derefer,
503500
];

compiler/rustc_mir_transform/src/normalize_array_len.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub struct NormalizeArrayLen;
1616

1717
impl<'tcx> MirPass<'tcx> for NormalizeArrayLen {
1818
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
19-
sess.mir_opt_level() >= 4
19+
// See #105929
20+
sess.mir_opt_level() >= 4 && sess.opts.unstable_opts.unsound_mir_opts
2021
}
2122

2223
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {

compiler/rustc_mir_transform/src/remove_false_edges.rs

-29
This file was deleted.

library/alloc/src/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
20332033
}
20342034
}
20352035

2036-
#[unstable(feature = "coerce_unsized", issue = "27732")]
2036+
#[unstable(feature = "coerce_unsized", issue = "18598")]
20372037
impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A> {}
20382038

20392039
#[unstable(feature = "dispatch_from_dyn", issue = "none")]

library/alloc/src/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Rc<T> {}
336336
#[stable(feature = "rc_ref_unwind_safe", since = "1.58.0")]
337337
impl<T: RefUnwindSafe + ?Sized> RefUnwindSafe for Rc<T> {}
338338

339-
#[unstable(feature = "coerce_unsized", issue = "27732")]
339+
#[unstable(feature = "coerce_unsized", issue = "18598")]
340340
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {}
341341

342342
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
@@ -2190,7 +2190,7 @@ impl<T: ?Sized> !marker::Send for Weak<T> {}
21902190
#[stable(feature = "rc_weak", since = "1.4.0")]
21912191
impl<T: ?Sized> !marker::Sync for Weak<T> {}
21922192

2193-
#[unstable(feature = "coerce_unsized", issue = "27732")]
2193+
#[unstable(feature = "coerce_unsized", issue = "18598")]
21942194
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}
21952195

21962196
#[unstable(feature = "dispatch_from_dyn", issue = "none")]

library/alloc/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ unsafe impl<T: ?Sized + Sync + Send> Sync for Arc<T> {}
254254
#[stable(feature = "catch_unwind", since = "1.9.0")]
255255
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for Arc<T> {}
256256

257-
#[unstable(feature = "coerce_unsized", issue = "27732")]
257+
#[unstable(feature = "coerce_unsized", issue = "18598")]
258258
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
259259

260260
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
@@ -306,7 +306,7 @@ unsafe impl<T: ?Sized + Sync + Send> Send for Weak<T> {}
306306
#[stable(feature = "arc_weak", since = "1.4.0")]
307307
unsafe impl<T: ?Sized + Sync + Send> Sync for Weak<T> {}
308308

309-
#[unstable(feature = "coerce_unsized", issue = "27732")]
309+
#[unstable(feature = "coerce_unsized", issue = "18598")]
310310
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}
311311
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
312312
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Weak<U>> for Weak<T> {}

library/core/src/cell.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<T: Default> Cell<T> {
568568
}
569569
}
570570

571-
#[unstable(feature = "coerce_unsized", issue = "27732")]
571+
#[unstable(feature = "coerce_unsized", issue = "18598")]
572572
impl<T: CoerceUnsized<U>, U> CoerceUnsized<Cell<U>> for Cell<T> {}
573573

574574
impl<T> Cell<[T]> {
@@ -1266,7 +1266,7 @@ impl<T> const From<T> for RefCell<T> {
12661266
}
12671267
}
12681268

1269-
#[unstable(feature = "coerce_unsized", issue = "27732")]
1269+
#[unstable(feature = "coerce_unsized", issue = "18598")]
12701270
impl<T: CoerceUnsized<U>, U> CoerceUnsized<RefCell<U>> for RefCell<T> {}
12711271

12721272
struct BorrowRef<'b> {
@@ -1492,7 +1492,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
14921492
}
14931493
}
14941494

1495-
#[unstable(feature = "coerce_unsized", issue = "27732")]
1495+
#[unstable(feature = "coerce_unsized", issue = "18598")]
14961496
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b, T> {}
14971497

14981498
#[stable(feature = "std_guard_impls", since = "1.20.0")]
@@ -1738,7 +1738,7 @@ impl<T: ?Sized> DerefMut for RefMut<'_, T> {
17381738
}
17391739
}
17401740

1741-
#[unstable(feature = "coerce_unsized", issue = "27732")]
1741+
#[unstable(feature = "coerce_unsized", issue = "18598")]
17421742
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T> {}
17431743

17441744
#[stable(feature = "std_guard_impls", since = "1.20.0")]
@@ -2074,7 +2074,7 @@ impl<T> const From<T> for UnsafeCell<T> {
20742074
}
20752075
}
20762076

2077-
#[unstable(feature = "coerce_unsized", issue = "27732")]
2077+
#[unstable(feature = "coerce_unsized", issue = "18598")]
20782078
impl<T: CoerceUnsized<U>, U> CoerceUnsized<UnsafeCell<U>> for UnsafeCell<T> {}
20792079

20802080
/// [`UnsafeCell`], but [`Sync`].
@@ -2164,7 +2164,7 @@ impl<T> const From<T> for SyncUnsafeCell<T> {
21642164
}
21652165
}
21662166

2167-
#[unstable(feature = "coerce_unsized", issue = "27732")]
2167+
#[unstable(feature = "coerce_unsized", issue = "18598")]
21682168
//#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
21692169
impl<T: CoerceUnsized<U>, U> CoerceUnsized<SyncUnsafeCell<U>> for SyncUnsafeCell<T> {}
21702170

library/core/src/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub trait Sized {
126126
/// [`Rc`]: ../../std/rc/struct.Rc.html
127127
/// [RFC982]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
128128
/// [nomicon-coerce]: ../../nomicon/coercions.html
129-
#[unstable(feature = "unsize", issue = "27732")]
129+
#[unstable(feature = "unsize", issue = "18598")]
130130
#[lang = "unsize"]
131131
#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
132132
pub trait Unsize<T: ?Sized> {

library/core/src/ops/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub(crate) use self::try_trait::{ChangeOutputType, NeverShortCircuit};
201201
#[unstable(feature = "generator_trait", issue = "43122")]
202202
pub use self::generator::{Generator, GeneratorState};
203203

204-
#[unstable(feature = "coerce_unsized", issue = "27732")]
204+
#[unstable(feature = "coerce_unsized", issue = "18598")]
205205
pub use self::unsize::CoerceUnsized;
206206

207207
#[unstable(feature = "dispatch_from_dyn", issue = "none")]

library/core/src/ops/unsize.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,41 @@ use crate::marker::Unsize;
3131
/// [dst-coerce]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
3232
/// [unsize]: crate::marker::Unsize
3333
/// [nomicon-coerce]: ../../nomicon/coercions.html
34-
#[unstable(feature = "coerce_unsized", issue = "27732")]
34+
#[unstable(feature = "coerce_unsized", issue = "18598")]
3535
#[lang = "coerce_unsized"]
3636
pub trait CoerceUnsized<T: ?Sized> {
3737
// Empty.
3838
}
3939

4040
// &mut T -> &mut U
41-
#[unstable(feature = "coerce_unsized", issue = "27732")]
41+
#[unstable(feature = "coerce_unsized", issue = "18598")]
4242
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a mut U> for &'a mut T {}
4343
// &mut T -> &U
44-
#[unstable(feature = "coerce_unsized", issue = "27732")]
44+
#[unstable(feature = "coerce_unsized", issue = "18598")]
4545
impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b mut T {}
4646
// &mut T -> *mut U
47-
#[unstable(feature = "coerce_unsized", issue = "27732")]
47+
#[unstable(feature = "coerce_unsized", issue = "18598")]
4848
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for &'a mut T {}
4949
// &mut T -> *const U
50-
#[unstable(feature = "coerce_unsized", issue = "27732")]
50+
#[unstable(feature = "coerce_unsized", issue = "18598")]
5151
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for &'a mut T {}
5252

5353
// &T -> &U
54-
#[unstable(feature = "coerce_unsized", issue = "27732")]
54+
#[unstable(feature = "coerce_unsized", issue = "18598")]
5555
impl<'a, 'b: 'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<&'a U> for &'b T {}
5656
// &T -> *const U
57-
#[unstable(feature = "coerce_unsized", issue = "27732")]
57+
#[unstable(feature = "coerce_unsized", issue = "18598")]
5858
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for &'a T {}
5959

6060
// *mut T -> *mut U
61-
#[unstable(feature = "coerce_unsized", issue = "27732")]
61+
#[unstable(feature = "coerce_unsized", issue = "18598")]
6262
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
6363
// *mut T -> *const U
64-
#[unstable(feature = "coerce_unsized", issue = "27732")]
64+
#[unstable(feature = "coerce_unsized", issue = "18598")]
6565
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {}
6666

6767
// *const T -> *const U
68-
#[unstable(feature = "coerce_unsized", issue = "27732")]
68+
#[unstable(feature = "coerce_unsized", issue = "18598")]
6969
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
7070

7171
/// `DispatchFromDyn` is used in the implementation of object safety checks (specifically allowing

library/core/src/ptr/non_null.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ impl<T: ?Sized> const Clone for NonNull<T> {
712712
#[stable(feature = "nonnull", since = "1.25.0")]
713713
impl<T: ?Sized> Copy for NonNull<T> {}
714714

715-
#[unstable(feature = "coerce_unsized", issue = "27732")]
715+
#[unstable(feature = "coerce_unsized", issue = "18598")]
716716
impl<T: ?Sized, U: ?Sized> CoerceUnsized<NonNull<U>> for NonNull<T> where T: Unsize<U> {}
717717

718718
#[unstable(feature = "dispatch_from_dyn", issue = "none")]

src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
1313
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
1414
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
15-
let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
1615

1716
bb0: {
1817
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
@@ -25,16 +24,14 @@
2524
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
2625
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2726
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
28-
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
29-
_10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
3027
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
3128
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
3229
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
3330
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
34-
_7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
35-
StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
31+
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3632
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3733
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
34+
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3835
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3936
+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
4037
}

src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
1313
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
1414
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
15-
let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
1615

1716
bb0: {
1817
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
@@ -25,16 +24,14 @@
2524
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
2625
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2726
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
28-
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
29-
_10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
3027
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
3128
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
3229
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
3330
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
34-
_7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
35-
StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
31+
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3632
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3733
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
34+
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3835
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
3936
+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
4037
}

0 commit comments

Comments
 (0)