Skip to content

Conversation

@zachs18
Copy link
Contributor

@zachs18 zachs18 commented Nov 20, 2025

Reverts #147101 in library/alloc/src/btree/

#147101 replaced some instances of code like a.len() == b.len() && a.iter().eq(&b) with just a.iter().eq(&b), but the optimization that PR introduced only applies for TrustedLen iterators, and BTreeMap's itertors are not TrustedLen, so this theoretically regressed perf for comparing large BTreeMap/BTreeSets with unequal lengths but equal prefixes, (and also made it so that comparing two different-length BTreeMap/BTreeSets with elements whose PartialEq impls that can panic now can panic, though this is not a "promised" behaviour either way (cc #149122))

Given that TrustedLen is an unsafe trait, I opted to not implement it for BTreeMap's iterators, and instead just revert the change. If someone else wants to audit BTreeMap's iterators to make sure they always return the right number of items (even in the face of incorrect user Ord impls) and then implement TrustedLen for them so that the optimization works for them, then this can be closed in favor of that (or if the perf regression is deemed too theoretical, this can be closed outright).

Example of theoretical perf regression: https://play.rust-lang.org/?version=beta&mode=release&edition=2024&gist=a37e3d61e6bf02669b251315c9a44fe2 (very rough estimates, using Instant::elapsed).
In release mode on stable the comparison takes ~23.68µs.
In release mode on beta/nightly the comparison takes ~48.351057ms.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be overmuch to suggest we add a test of a "naughty" BTreeMap comparison of panicking equality impls that manages to avoid panicking because of the len check, and add a comment to it that says that regressing the test is fine if you did it on purpose?

View changes since this review

@zachs18
Copy link
Contributor Author

zachs18 commented Nov 20, 2025

I added a module in library/alloctests/collections/ that tests that various collections' PartialEq::eq impls don't compare elements if the lengths of two compared collections are different.

(I think teeeechically a regression for (BTree,Hash)(Map,Set) could get past the test if they compare the (1, Evil) to the (0, Evil) first and bail early, but I think that's an unlikely change for BTree*, and would be nondeterministic for Hash* so would be caught eventually)

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yotamofek
Copy link
Contributor

Thanks for catching and fixing this!

@theemathas theemathas added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 20, 2025
@workingjubilee
Copy link
Member

r? workingjubilee
@bors r+

@bors
Copy link
Collaborator

bors commented Nov 20, 2025

📌 Commit 907f5c1 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 20, 2025
@Amanieu
Copy link
Member

Amanieu commented Nov 20, 2025

BTreeMap iterators should just be TrustedLen since the iterators themselves don't use Ord. Ord is only used when finding an element in the tree, not when iterating through the whole tree (which just follows node pointers without looking at the values).

@theemathas
Copy link
Contributor

Beta-nominated because it fixes a stable-to-beta performance regression.

On stable, BTreeMap/BTreeSet's PartialEq impl compared the set sizes before comparing the contents. On beta, this check isn't done first.

@workingjubilee
Copy link
Member

@Amanieu That seems fine to apply as a followup! I don't think we want to beta-backport novel unsafe code though.

@Amanieu
Copy link
Member

Amanieu commented Nov 20, 2025

I agree, I think this is fine for a backport.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 20, 2025
…gjubilee

In `BTreeMap::eq`, do not compare the elements if the sizes are different.

Reverts rust-lang#147101 in library/alloc/src/btree/

rust-lang#147101 replaced some instances of code like `a.len() == b.len() && a.iter().eq(&b)` with just `a.iter().eq(&b)`, but the optimization that PR introduced only applies for `TrustedLen` iterators, and `BTreeMap`'s itertors are not `TrustedLen`, so this theoretically regressed perf for comparing large `BTreeMap`/`BTreeSet`s with unequal lengths but equal prefixes, (and also made it so that comparing two different-length `BTreeMap`/`BTreeSet`s with elements whose `PartialEq` impls that can panic now can panic, though this is not a "promised" behaviour either way (cc rust-lang#149122))

Given that `TrustedLen` is an unsafe trait, I opted to not implement it for `BTreeMap`'s iterators, and instead just revert the change. If someone else wants to audit `BTreeMap`'s iterators to make sure they always return the right number of items (even in the face of incorrect user `Ord` impls) and then implement `TrustedLen` for them so that the optimization works for them, then this can be closed in favor of that (or if the perf regression is deemed too theoretical, this can be closed outright).

Example of theoretical perf regression: https://play.rust-lang.org/?version=beta&mode=release&edition=2024&gist=a37e3d61e6bf02669b251315c9a44fe2 (very rough estimates, using `Instant::elapsed`).
In release mode on stable the comparison takes ~23.68µs.
In release mode on beta/nightly the comparison takes ~48.351057ms.
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 9 pull requests

Successful merges:

 - #149033 (autodiff rlib handling)
 - #149088 (Add missing trailing period to RustDoc for fn create_dir().)
 - #149111 (fs: Run file lock tests on all platforms that support it)
 - #149113 (sgx: avoid unnecessarily creating a slice)
 - #149123 (std: sys: fs: uefi: Fix FileAttr size)
 - #149125 (In `BTreeMap::eq`, do not compare the elements if the sizes are different.)
 - #149133 (Remove an unused variable)
 - #149134 (std: sys: net: uefi: Implement read_vectored)
 - #149139 (Enable host tools for aarch64-unknown-linux-ohos)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr
Copy link
Member

@bors2 try jobs=test-various

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 20, 2025
In `BTreeMap::eq`, do not compare the elements if the sizes are different.

try-job: test-various
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/vecdeque-drain.rs:13:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:180:57: note: found here
_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit:
                                                        ^~
/checkout/tests/codegen-llvm/vecdeque-drain.rs:32:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:201:68: note: found here
 br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit
                                                                   ^~
/checkout/tests/codegen-llvm/vecdeque-drain.rs:53:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:227:15: note: found here
_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb3.i.i
              ^~

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll
Check file: /checkout/tests/codegen-llvm/vecdeque-drain.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        .
        .
        .
       80:  
       81: bb13.i: ; preds = %bb6.i 
       82:  %10 = icmp ne ptr %source_deque.val16, null 
       83:  tail call void @llvm.assume(i1 %10) 
       84:  %_237.i = getelementptr i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
       85:  %dst7.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
       86:  %11 = shl i64 %dst_pre_wrap_len.i, 2 
       87:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst7.i, ptr nonnull align 4 %_237.i, i64 %11, i1 false) 
       88:  %len9.i = sub i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
       89:  %_330.i = getelementptr i32, ptr %_237.i, i64 %dst_pre_wrap_len.i 
       90:  %12 = shl i64 %len9.i, 2 
       91:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr align 4 %_330.i, i64 %12, i1 false) 
       92:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
       93:  
       94: bb12.i: ; preds = %bb6.i 
       95:  %len11.i = sub i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
       96:  %13 = icmp ne ptr %source_deque.val16, null 
       97:  tail call void @llvm.assume(i1 %13) 
       98:  %14 = getelementptr i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
       99:  %_191.i = getelementptr i32, ptr %14, i64 %dst_pre_wrap_len.i 
      100:  %15 = shl i64 %len11.i, 2 
      101:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr align 4 %_191.i, i64 %15, i1 false) 
      102:  %dst12.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      103:  %16 = shl i64 %dst_pre_wrap_len.i, 2 
      104:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst12.i, ptr nonnull align 4 %14, i64 %16, i1 false) 
      105:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      106:  
      107: bb8.i: ; preds = %bb7.i 
      108:  br i1 %dst_wraps.i, label %bb15.i, label %bb11.i 
      109:  
      110: bb9.i: ; preds = %bb7.i 
      111:  br i1 %dst_wraps.i, label %bb16.i, label %bb10.i 
      112:  
      113: bb11.i: ; preds = %bb8.i 
      114:  %17 = icmp ne ptr %source_deque.val16, null 
      115:  tail call void @llvm.assume(i1 %17) 
      116:  %_144.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      117:  %dst13.i = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      118:  %18 = shl i64 %src_pre_wrap_len.i, 2 
      119:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst13.i, ptr nonnull align 4 %_144.i, i64 %18, i1 false) 
      120:  %len15.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      121:  %dst16.i = getelementptr i32, ptr %dst13.i, i64 %src_pre_wrap_len.i 
      122:  %19 = shl i64 %len15.i, 2 
      123:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst16.i, ptr nonnull align 4 %source_deque.val16, i64 %19, i1 false) 
      124:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      125:  
      126: bb15.i: ; preds = %bb8.i 
      127:  %delta.i = sub i64 %dst_pre_wrap_len.i, %src_pre_wrap_len.i 
      128:  %_512.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      129:  %dst17.i = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      130:  %20 = shl i64 %src_pre_wrap_len.i, 2 
      131:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst17.i, ptr nonnull align 4 %_512.i, i64 %20, i1 false) 
      132:  %dst19.i = getelementptr i32, ptr %dst17.i, i64 %src_pre_wrap_len.i 
      133:  %21 = shl i64 %delta.i, 2 
      134:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst19.i, ptr nonnull align 4 %source_deque.val16, i64 %21, i1 false) 
      135:  %len20.i = sub nuw i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
      136:  %22 = icmp ne ptr %source_deque.val16, null 
      137:  tail call void @llvm.assume(i1 %22) 
      138:  %_604.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %delta.i 
      139:  %23 = shl i64 %len20.i, 2 
      140:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr nonnull align 4 %_604.i, i64 %23, i1 false) 
      141:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      142:  
      143: bb10.i: ; preds = %bb9.i 
      144:  %len22.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      145:  %24 = icmp ne ptr %source_deque.val16, null 
      146:  tail call void @llvm.assume(i1 %24) 
      147:  %25 = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      148:  %dst23.i = getelementptr i32, ptr %25, i64 %src_pre_wrap_len.i 
      149:  %26 = shl i64 %len22.i, 2 
      150:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst23.i, ptr nonnull align 4 %source_deque.val16, i64 %26, i1 false) 
      151:  %_466.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      152:  %27 = shl i64 %src_pre_wrap_len.i, 2 
      153:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %25, ptr nonnull align 4 %_466.i, i64 %27, i1 false) 
      154:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      155:  
      156: bb16.i: ; preds = %bb9.i 
      157:  %delta25.i = sub i64 %src_pre_wrap_len.i, %dst_pre_wrap_len.i 
      158:  %len26.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      159:  %dst27.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %delta25.i 
      160:  %28 = shl i64 %len26.i, 2 
      161:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst27.i, ptr nonnull align 4 %source_deque.val16, i64 %28, i1 false) 
      162:  %src29.i = sub i64 %source_deque.val, %delta25.i 
      163:  %_698.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src29.i 
      164:  %29 = shl i64 %delta25.i, 2 
      165:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr nonnull align 4 %_698.i, i64 %29, i1 false) 
      166:  %30 = icmp ne ptr %source_deque.val16, null 
      167:  tail call void @llvm.assume(i1 %30) 
      168:  %_743.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      169:  %dst30.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      170:  %31 = shl i64 %dst_pre_wrap_len.i, 2 
      171:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst30.i, ptr nonnull align 4 %_743.i, i64 %31, i1 false) 
      172:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      173:  
      174: _RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb14.i, %bb13.i, %bb12.i, %bb11.i, %bb15.i, %bb10.i, %bb16.i 
      175:  ret void 
      176: } 
      177:  
      178: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: write) uwtable 
      179: define void @clear(ptr noalias noundef writeonly align 8 captures(none) dereferenceable(32) initializes((16, 32)) %v) unnamed_addr #1 personality ptr @rust_eh_personality { 
      180: _RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit: 
not:13                                                             !~                                                                                            error: no match expected
      181:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      182:  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false) 
      183:  ret void 
      184: } 
      185:  
      186: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
      187: define void @truncate(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %n) unnamed_addr #2 personality ptr @rust_eh_personality { 
      188: start: 
      189:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      190:  %_4 = load i64, ptr %0, align 8, !noundef !3 
      191:  %_3 = icmp ult i64 %n, %_4 
      192:  br i1 %_3, label %bb11.i.i.i.i, label %bb4 
      193:  
      194: bb11.i.i.i.i: ; preds = %start 
      195:  %1 = icmp eq i64 %n, 0 
      196:  br i1 %1, label %bb12.i.i.i.i, label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      197:  
      198: bb12.i.i.i.i: ; preds = %bb11.i.i.i.i 
      199:  %2 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      200:  store i64 0, ptr %2, align 8, !noalias !5 
      201:  br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
not:32                                                                        !~                                                                                           error: no match expected
      202:  
      203: _RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb11.i.i.i.i, %bb12.i.i.i.i 
      204:  store i64 %n, ptr %0, align 8, !noalias !5 
      205:  br label %bb4 
      206:  
      207: bb4: ; preds = %start, %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      208:  ret void 
      209: } 
      210:  
      211: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
      212: define void @advance(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %n) unnamed_addr #2 personality ptr @rust_eh_personality { 
      213: start: 
      214:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      215:  %_4 = load i64, ptr %0, align 8, !noundef !3 
      216:  %_3 = icmp ult i64 %n, %_4 
      217:  br i1 %_3, label %bb11.i.i.i.i, label %bb3 
      218:  
      219: bb3: ; preds = %start 
      220:  %_3.i = icmp eq i64 %_4, 0 
      221:  br i1 %_3.i, label %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit, label %bb3.i.i 
      222:  
      223: bb3.i.i: ; preds = %bb3 
      224:  store i64 0, ptr %0, align 8, !alias.scope !10 
      225:  br label %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit 
      226:  
      227: _RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb3.i.i 
not:53                   !~                                                                                                                                error: no match expected
      228:  %1 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      229:  store i64 0, ptr %1, align 8 
      230:  br label %bb4 
      231:  
      232: bb11.i.i.i.i: ; preds = %start 
      233:  %_14 = sub nuw i64 %_4, %n 
      234:  %2 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      235:  %idx.i.i.i.i = load i64, ptr %2, align 8, !noalias !13, !noundef !3 
      236:  %logical_index.i.i.i.i = add i64 %idx.i.i.i.i, %n 
      237:  %self1.i.i.i.i = load i64, ptr %v, align 8, !range !4, !noalias !13, !noundef !3 
      238:  %_31.not.i.i.i.i = icmp ult i64 %logical_index.i.i.i.i, %self1.i.i.i.i 
      239:  %3 = select i1 %_31.not.i.i.i.i, i64 0, i64 %self1.i.i.i.i 
      240:  %_17.sroa.0.0.i.i.i.i = sub nuw i64 %logical_index.i.i.i.i, %3 
      241:  store i64 %_17.sroa.0.0.i.i.i.i, ptr %2, align 8, !noalias !13 
      242:  store i64 %_14, ptr %0, align 8, !noalias !13 
      243:  br label %bb4 
      244:  
      245: bb4: ; preds = %bb11.i.i.i.i, %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit 
      246:  ret void 
      247: } 
      248:  
      249: ; Function Attrs: nonlazybind uwtable 
      250: define void @remove(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %a, i64 noundef %b) unnamed_addr #3 personality ptr @rust_eh_personality { 
      251: start: 
      252:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      253:  %_10 = load i64, ptr %0, align 8, !noundef !3 
      254:  %_10.i = icmp ugt i64 %b, %_10 
      255:  br i1 %_10.i, label %bb8.i, label %bb10.i, !prof !18 
      256:  
      257: bb10.i: ; preds = %start 
      258:  %_20.i = icmp ugt i64 %a, %b 
      259:  br i1 %_20.i, label %bb17.i, label %_RINvNtNtCsbt21qwEa2UW_4core5slice5index5rangeINtNtNtB6_3ops5range5RangejEECs8PzcKh4RrBy_14vecdeque_drain.exit, !prof !18 
      260:  
      261: bb8.i: ; preds = %start 
      262: ; call core::slice::index::slice_index_fail 
      263:  tail call void @_ZN4core5slice5index16slice_index_fail17h833efc9711696ca5E(i64 noundef 0, i64 noundef %b, i64 noundef %_10, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_0da207a3891aba83e29427493b8ac3a7) #9 
      264:  unreachable 
      265:  
      266: bb17.i: ; preds = %bb10.i 
      267: ; call core::slice::index::slice_index_fail 
      268:  tail call void @_ZN4core5slice5index16slice_index_fail17h833efc9711696ca5E(i64 noundef %a, i64 noundef %b, i64 noundef %_10, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_0da207a3891aba83e29427493b8ac3a7) #9 
      269:  unreachable 
      270:  
      271: _RINvNtNtCsbt21qwEa2UW_4core5slice5index5rangeINtNtNtB6_3ops5range5RangejEECs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb10.i 
      272:  %_11 = sub nuw i64 %b, %a 
      273:  store i64 %a, ptr %0, align 8 
      274:  %_13 = sub i64 %_10, %_11 
      275:  %tail_len.i.i.i.i = sub i64 %_13, %a 
      276:  %1 = icmp eq i64 %a, 0 
      277:  %2 = icmp eq i64 %_13, %a 
      278:  %or.cond.i.i.i.i = or i1 %1, %2 
      279:  br i1 %or.cond.i.i.i.i, label %bb11.i.i.i.i, label %bb10.i.i.i.i, !prof !19 
      280:  
      281: bb11.i.i.i.i: ; preds = %bb10.i.i.i.i, %_RINvNtNtCsbt21qwEa2UW_4core5slice5index5rangeINtNtNtB6_3ops5range5RangejEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      282:  %3 = icmp eq i64 %_10, %_11 
      283:  br i1 %3, label %bb12.i.i.i.i, label %bb13.i.i.i.i 
      284:  
      285: bb10.i.i.i.i: ; preds = %_RINvNtNtCsbt21qwEa2UW_4core5slice5index5rangeINtNtNtB6_3ops5range5RangejEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      286: ; call <<alloc::collections::vec_deque::drain::Drain<_, _> as core::ops::drop::Drop>::drop::DropGuard<_, _> as core::ops::drop::Drop>::drop::join_head_and_tail_wrapping::<i32, alloc::alloc::Global> 
      287:  tail call fastcc void @_RINvNvXNvXs2_NtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drainINtBb_5DrainppENtNtNtCsbt21qwEa2UW_4core3ops4drop4Drop4dropINtB5_9DropGuardppEB1j_4drop27join_head_and_tail_wrappinglNtNtBh_5alloc6GlobalECs8PzcKh4RrBy_14vecdeque_drain(ptr noalias noundef align 8 dereferenceable(32) %v, i64 noundef %_11, i64 noundef %a, i64 noundef %tail_len.i.i.i.i), !noalias !20 
      288:  br label %bb11.i.i.i.i 
      289:  
      290: bb12.i.i.i.i: ; preds = %bb11.i.i.i.i 
      291:  %4 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      292:  store i64 0, ptr %4, align 8, !noalias !20 
      293:  br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      294:  
      295: bb13.i.i.i.i: ; preds = %bb11.i.i.i.i 
      296:  %_16.i.i.i.i = icmp ult i64 %a, %tail_len.i.i.i.i 
      297:  br i1 %_16.i.i.i.i, label %bb14.i.i.i.i, label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      298:  
      299: bb14.i.i.i.i: ; preds = %bb13.i.i.i.i 
      300:  %5 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      301:  %idx.i.i.i.i = load i64, ptr %5, align 8, !noalias !20, !noundef !3 
      302:  %logical_index.i.i.i.i = add i64 %idx.i.i.i.i, %_11 
      303:  %self1.i.i.i.i = load i64, ptr %v, align 8, !range !4, !noalias !20, !noundef !3 
      304:  %_31.not.i.i.i.i = icmp ult i64 %logical_index.i.i.i.i, %self1.i.i.i.i 
      305:  %6 = select i1 %_31.not.i.i.i.i, i64 0, i64 %self1.i.i.i.i 
      306:  %_17.sroa.0.0.i.i.i.i = sub nuw i64 %logical_index.i.i.i.i, %6 
      307:  store i64 %_17.sroa.0.0.i.i.i.i, ptr %5, align 8, !noalias !20 
      308:  br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      309:  
      310: _RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb12.i.i.i.i, %bb13.i.i.i.i, %bb14.i.i.i.i 
      311:  store i64 %_13, ptr %0, align 8, !noalias !20 
      312:  ret void 
      313: } 
      314:  
      315: ; Function Attrs: nounwind nonlazybind uwtable 
      316: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #4 
      317:  
      318: ; core::slice::index::slice_index_fail 
      319: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 
      320: declare void @_ZN4core5slice5index16slice_index_fail17h833efc9711696ca5E(i64 noundef, i64 noundef, i64 noundef, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #5 
      321:  
      322: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
      323: declare void @llvm.assume(i1 noundef) #6 
      324:  
      325: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) 
      326: declare void @llvm.memmove.p0.p0.i64(ptr writeonly captures(none), ptr readonly captures(none), i64, i1 immarg) #7 
      327:  
        .
        .
        .
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll" "/checkout/tests/codegen-llvm/vecdeque-drain.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/vecdeque-drain.rs:13:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:180:57: note: found here
_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit:
                                                        ^~
/checkout/tests/codegen-llvm/vecdeque-drain.rs:32:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:201:68: note: found here
 br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit
                                                                   ^~
/checkout/tests/codegen-llvm/vecdeque-drain.rs:53:15: error: CHECK-NOT: excluded string found in input
// CHECK-NOT: br
              ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll:227:15: note: found here
_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb3.i.i
              ^~

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/vecdeque-drain/vecdeque-drain.ll
Check file: /checkout/tests/codegen-llvm/vecdeque-drain.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        .
        .
        .
       80:  
       81: bb13.i: ; preds = %bb6.i 
       82:  %10 = icmp ne ptr %source_deque.val16, null 
       83:  tail call void @llvm.assume(i1 %10) 
       84:  %_237.i = getelementptr i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
       85:  %dst7.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
       86:  %11 = shl i64 %dst_pre_wrap_len.i, 2 
       87:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst7.i, ptr nonnull align 4 %_237.i, i64 %11, i1 false) 
       88:  %len9.i = sub i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
       89:  %_330.i = getelementptr i32, ptr %_237.i, i64 %dst_pre_wrap_len.i 
       90:  %12 = shl i64 %len9.i, 2 
       91:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr align 4 %_330.i, i64 %12, i1 false) 
       92:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
       93:  
       94: bb12.i: ; preds = %bb6.i 
       95:  %len11.i = sub i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
       96:  %13 = icmp ne ptr %source_deque.val16, null 
       97:  tail call void @llvm.assume(i1 %13) 
       98:  %14 = getelementptr i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
       99:  %_191.i = getelementptr i32, ptr %14, i64 %dst_pre_wrap_len.i 
      100:  %15 = shl i64 %len11.i, 2 
      101:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr align 4 %_191.i, i64 %15, i1 false) 
      102:  %dst12.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      103:  %16 = shl i64 %dst_pre_wrap_len.i, 2 
      104:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst12.i, ptr nonnull align 4 %14, i64 %16, i1 false) 
      105:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      106:  
      107: bb8.i: ; preds = %bb7.i 
      108:  br i1 %dst_wraps.i, label %bb15.i, label %bb11.i 
      109:  
      110: bb9.i: ; preds = %bb7.i 
      111:  br i1 %dst_wraps.i, label %bb16.i, label %bb10.i 
      112:  
      113: bb11.i: ; preds = %bb8.i 
      114:  %17 = icmp ne ptr %source_deque.val16, null 
      115:  tail call void @llvm.assume(i1 %17) 
      116:  %_144.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      117:  %dst13.i = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      118:  %18 = shl i64 %src_pre_wrap_len.i, 2 
      119:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst13.i, ptr nonnull align 4 %_144.i, i64 %18, i1 false) 
      120:  %len15.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      121:  %dst16.i = getelementptr i32, ptr %dst13.i, i64 %src_pre_wrap_len.i 
      122:  %19 = shl i64 %len15.i, 2 
      123:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst16.i, ptr nonnull align 4 %source_deque.val16, i64 %19, i1 false) 
      124:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      125:  
      126: bb15.i: ; preds = %bb8.i 
      127:  %delta.i = sub i64 %dst_pre_wrap_len.i, %src_pre_wrap_len.i 
      128:  %_512.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      129:  %dst17.i = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      130:  %20 = shl i64 %src_pre_wrap_len.i, 2 
      131:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst17.i, ptr nonnull align 4 %_512.i, i64 %20, i1 false) 
      132:  %dst19.i = getelementptr i32, ptr %dst17.i, i64 %src_pre_wrap_len.i 
      133:  %21 = shl i64 %delta.i, 2 
      134:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst19.i, ptr nonnull align 4 %source_deque.val16, i64 %21, i1 false) 
      135:  %len20.i = sub nuw i64 %head_len.sroa.0.0, %dst_pre_wrap_len.i 
      136:  %22 = icmp ne ptr %source_deque.val16, null 
      137:  tail call void @llvm.assume(i1 %22) 
      138:  %_604.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %delta.i 
      139:  %23 = shl i64 %len20.i, 2 
      140:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr nonnull align 4 %_604.i, i64 %23, i1 false) 
      141:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      142:  
      143: bb10.i: ; preds = %bb9.i 
      144:  %len22.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      145:  %24 = icmp ne ptr %source_deque.val16, null 
      146:  tail call void @llvm.assume(i1 %24) 
      147:  %25 = getelementptr i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      148:  %dst23.i = getelementptr i32, ptr %25, i64 %src_pre_wrap_len.i 
      149:  %26 = shl i64 %len22.i, 2 
      150:  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %dst23.i, ptr nonnull align 4 %source_deque.val16, i64 %26, i1 false) 
      151:  %_466.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      152:  %27 = shl i64 %src_pre_wrap_len.i, 2 
      153:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %25, ptr nonnull align 4 %_466.i, i64 %27, i1 false) 
      154:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      155:  
      156: bb16.i: ; preds = %bb9.i 
      157:  %delta25.i = sub i64 %src_pre_wrap_len.i, %dst_pre_wrap_len.i 
      158:  %len26.i = sub i64 %head_len.sroa.0.0, %src_pre_wrap_len.i 
      159:  %dst27.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %delta25.i 
      160:  %28 = shl i64 %len26.i, 2 
      161:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst27.i, ptr nonnull align 4 %source_deque.val16, i64 %28, i1 false) 
      162:  %src29.i = sub i64 %source_deque.val, %delta25.i 
      163:  %_698.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src29.i 
      164:  %29 = shl i64 %delta25.i, 2 
      165:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %source_deque.val16, ptr nonnull align 4 %_698.i, i64 %29, i1 false) 
      166:  %30 = icmp ne ptr %source_deque.val16, null 
      167:  tail call void @llvm.assume(i1 %30) 
      168:  %_743.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %src.sroa.0.1 
      169:  %dst30.i = getelementptr inbounds nuw i32, ptr %source_deque.val16, i64 %dst.sroa.0.1 
      170:  %31 = shl i64 %dst_pre_wrap_len.i, 2 
      171:  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 4 %dst30.i, ptr nonnull align 4 %_743.i, i64 %31, i1 false) 
      172:  br label %_RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit 
      173:  
      174: _RNvMs1_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE9wrap_copyCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb14.i, %bb13.i, %bb12.i, %bb11.i, %bb15.i, %bb10.i, %bb16.i 
      175:  ret void 
      176: } 
      177:  
      178: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: write) uwtable 
      179: define void @clear(ptr noalias noundef writeonly align 8 captures(none) dereferenceable(32) initializes((16, 32)) %v) unnamed_addr #1 personality ptr @rust_eh_personality { 
      180: _RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit: 
not:13                                                             !~                                                                                            error: no match expected
      181:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      182:  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false) 
      183:  ret void 
      184: } 
      185:  
      186: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
      187: define void @truncate(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %n) unnamed_addr #2 personality ptr @rust_eh_personality { 
      188: start: 
      189:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      190:  %_4 = load i64, ptr %0, align 8, !noundef !3 
      191:  %_3 = icmp ult i64 %n, %_4 
      192:  br i1 %_3, label %bb11.i.i.i.i, label %bb4 
      193:  
      194: bb11.i.i.i.i: ; preds = %start 
      195:  %1 = icmp eq i64 %n, 0 
      196:  br i1 %1, label %bb12.i.i.i.i, label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      197:  
      198: bb12.i.i.i.i: ; preds = %bb11.i.i.i.i 
      199:  %2 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      200:  store i64 0, ptr %2, align 8, !noalias !5 
      201:  br label %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
not:32                                                                        !~                                                                                           error: no match expected
      202:  
      203: _RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb11.i.i.i.i, %bb12.i.i.i.i 
      204:  store i64 %n, ptr %0, align 8, !noalias !5 
      205:  br label %bb4 
      206:  
      207: bb4: ; preds = %start, %_RINvNtCsbt21qwEa2UW_4core3ptr13drop_in_placeINtNtNtNtCsbrp9Q2uV4qT_5alloc11collections9vec_deque5drain5DrainlEECs8PzcKh4RrBy_14vecdeque_drain.exit 
      208:  ret void 
      209: } 
      210:  
      211: ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable 
      212: define void @advance(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %n) unnamed_addr #2 personality ptr @rust_eh_personality { 
      213: start: 
      214:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      215:  %_4 = load i64, ptr %0, align 8, !noundef !3 
      216:  %_3 = icmp ult i64 %n, %_4 
      217:  br i1 %_3, label %bb11.i.i.i.i, label %bb3 
      218:  
      219: bb3: ; preds = %start 
      220:  %_3.i = icmp eq i64 %_4, 0 
      221:  br i1 %_3.i, label %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit, label %bb3.i.i 
      222:  
      223: bb3.i.i: ; preds = %bb3 
      224:  store i64 0, ptr %0, align 8, !alias.scope !10 
      225:  br label %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit 
      226:  
      227: _RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit: ; preds = %bb3, %bb3.i.i 
not:53                   !~                                                                                                                                error: no match expected
      228:  %1 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      229:  store i64 0, ptr %1, align 8 
      230:  br label %bb4 
      231:  
      232: bb11.i.i.i.i: ; preds = %start 
      233:  %_14 = sub nuw i64 %_4, %n 
      234:  %2 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      235:  %idx.i.i.i.i = load i64, ptr %2, align 8, !noalias !13, !noundef !3 
      236:  %logical_index.i.i.i.i = add i64 %idx.i.i.i.i, %n 
      237:  %self1.i.i.i.i = load i64, ptr %v, align 8, !range !4, !noalias !13, !noundef !3 
      238:  %_31.not.i.i.i.i = icmp ult i64 %logical_index.i.i.i.i, %self1.i.i.i.i 
      239:  %3 = select i1 %_31.not.i.i.i.i, i64 0, i64 %self1.i.i.i.i 
      240:  %_17.sroa.0.0.i.i.i.i = sub nuw i64 %logical_index.i.i.i.i, %3 
      241:  store i64 %_17.sroa.0.0.i.i.i.i, ptr %2, align 8, !noalias !13 
      242:  store i64 %_14, ptr %0, align 8, !noalias !13 
      243:  br label %bb4 
      244:  
      245: bb4: ; preds = %bb11.i.i.i.i, %_RNvMs3_NtNtCsbrp9Q2uV4qT_5alloc11collections9vec_dequeINtB5_8VecDequelE8truncateCs8PzcKh4RrBy_14vecdeque_drain.exit 
      246:  ret void 
      247: } 
      248:  
      249: ; Function Attrs: nonlazybind uwtable 
      250: define void @remove(ptr noalias noundef align 8 captures(none) dereferenceable(32) %v, i64 noundef %a, i64 noundef %b) unnamed_addr #3 personality ptr @rust_eh_personality { 
      251: start: 
      252:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 24 
      253:  %_10 = load i64, ptr %0, align 8, !noundef !3 
      254:  %_10.i = icmp ugt i64 %b, %_10 

@theemathas
Copy link
Contributor

What should be done with this PR, given that #149381 was already merged?

@workingjubilee
Copy link
Member

nada!
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 2, 2025

📌 Commit 907f5c1 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 2, 2025
@workingjubilee
Copy link
Member

hm, wait, taking stock. I missed something

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 2, 2025
@workingjubilee
Copy link
Member

workingjubilee commented Dec 2, 2025

Hm. still want the regression tests despite there being no functional differences.

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 2, 2025

📌 Commit 907f5c1 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 2, 2025
@yotamofek
Copy link
Contributor

Hm. still want the regression tests despite there being no functional differences.

@bors r+

But now it's undoing the cleanup from #147101 for no reason

@workingjubilee
Copy link
Member

@yotamofek This PR was marked beta-accepted. #149381 was not. I am going to have to ask T-release very nicely to get this pulled at all into 1.92, because this was supposed to land first and then everyone decided it had to wait for this and that and the other thing. We almost always land changes on main first and then pull them to beta. Knowing all this, if you want me to bors r-, I will.

@yotamofek
Copy link
Contributor

@workingjubilee sorry, I should've phrased that comment as a question, wasn't trying to impose. Let's just get beta fixed, the cleanup really isn't important :)

Also, I don't think anyone decided to block this PR on anything. It was practically blocked on #149190 because CI was failing, but after that got merged I think this one just kinda slipped through the cracks. I had assumed it was going to be merged soon when I opened #149381

Anyways, sorry for the mess!

@workingjubilee
Copy link
Member

Even now, I don't actually know that the failing addressed by #149190 was deterministic or not. Several parts of v0 mangling are just hashes and I didn't look too closely. I just know that I wasn't sure anymore what it was twigging on. While I was confident about whether this should land at the start, I tend to have the maladaptive reflex of withdrawing in the face of sufficient uncertainty.

So instead of being uncertain, I'm just being senseless. Like, yes, but I don't want to be guessing about anything given the release is Dec 11, so we want this backported by... Friday? this weekend? After this is on beta, this will be definitely fixed and we can clarify the process and r+ reverts and make jokes about jubilee being a foolish robot or whatever else to make things fixed-fixed later. Right now, playing the robot fool.

@cuviper
Copy link
Member

cuviper commented Dec 2, 2025

@bors p=1

@bors
Copy link
Collaborator

bors commented Dec 2, 2025

⌛ Testing commit 907f5c1 with merge 646a3f8...

@Amanieu Amanieu added the I-libs-nominated Nominated for discussion during a libs team meeting. label Dec 2, 2025
@bors
Copy link
Collaborator

bors commented Dec 2, 2025

☀️ Test successful - checks-actions
Approved by: workingjubilee
Pushing 646a3f8 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 2, 2025
@bors bors merged commit 646a3f8 into rust-lang:main Dec 2, 2025
13 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing eca9d93 (parent) -> 646a3f8 (this PR)

Test differences

Show 16 test diffs

Stage 1

  • collections::eq_diff_len::btreemap_evil_eq: [missing] -> pass (J1)
  • collections::eq_diff_len::btreeset_evil_eq: [missing] -> pass (J1)
  • collections::eq_diff_len::evil_eq_works: [missing] -> pass (J1)
  • collections::eq_diff_len::hashmap_evil_eq: [missing] -> pass (J1)
  • collections::eq_diff_len::hashset_evil_eq: [missing] -> pass (J1)
  • collections::eq_diff_len::linkedlist_evil_eq: [missing] -> pass (J1)
  • collections::eq_diff_len::vec_evil_eq: [missing] -> pass (J1)

Stage 2

  • collections::eq_diff_len::btreemap_evil_eq: [missing] -> pass (J0)
  • collections::eq_diff_len::btreeset_evil_eq: [missing] -> pass (J0)
  • collections::eq_diff_len::evil_eq_works: [missing] -> pass (J0)
  • collections::eq_diff_len::hashmap_evil_eq: [missing] -> pass (J0)
  • collections::eq_diff_len::hashset_evil_eq: [missing] -> pass (J0)
  • collections::eq_diff_len::linkedlist_evil_eq: [missing] -> pass (J0)
  • collections::eq_diff_len::vec_evil_eq: [missing] -> pass (J0)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 646a3f8c15baefb98dc6e0c1c1ba3356db702d2a --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. i686-gnu-2: 6018.3s -> 5074.3s (-15.7%)
  2. dist-sparcv9-solaris: 5052.6s -> 5749.7s (+13.8%)
  3. aarch64-gnu-llvm-20-2: 2608.2s -> 2258.1s (-13.4%)
  4. x86_64-gnu-llvm-20: 2821.9s -> 2456.2s (-13.0%)
  5. x86_64-gnu-debug: 7613.8s -> 6636.7s (-12.8%)
  6. dist-x86_64-freebsd: 5509.4s -> 4813.4s (-12.6%)
  7. x86_64-gnu-gcc: 3362.1s -> 2945.2s (-12.4%)
  8. x86_64-rust-for-linux: 3040.0s -> 2664.2s (-12.4%)
  9. x86_64-gnu-tools: 3460.1s -> 3040.6s (-12.1%)
  10. dist-x86_64-apple: 8147.6s -> 9134.5s (+12.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (646a3f8): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 1

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -4.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-4.7%, -4.7%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 471.361s -> 468.916s (-0.52%)
Artifact size: 386.74 MiB -> 386.75 MiB (0.00%)

@cuviper cuviper mentioned this pull request Dec 3, 2025
@cuviper cuviper modified the milestones: 1.93.0, 1.92.0 Dec 3, 2025
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 3, 2025
bors added a commit that referenced this pull request Dec 3, 2025
[beta] backports

- rustdoc: Use configured target modifiers when collecting doctests #148068
- fix(rustdoc): Color doctest errors #148834
- Fix the issue of unused assignment from MIR liveness checking #149072
- Skip unused variables warning for unreachable code #149096
- In `BTreeMap::eq`, do not compare the elements if the sizes are different. #149125
- Handle cycles when checking impl candidates for `doc(hidden)` #149185
- Generalize branch references #148395
  - only the commit updating CI scripts
- Change default branch references #148564

r? cuviper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. I-libs-nominated Nominated for discussion during a libs team meeting. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.92 regression: Behavior change in PartialEq impl of BTreeSet?