Skip to content

Commit

Permalink
Fix pattern matching mode changes and unsafe_op_in_unsafe_fn
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Feb 9, 2025
1 parent a4e7f8f commit 4312d7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/collections/btree/merge_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<I: Iterator> MergeIterInner<I> {
b_next = self.b.next();
}
}
if let (Some(ref a1), Some(ref b1)) = (&a_next, &b_next) {
if let (Some(a1), Some(b1)) = (&a_next, &b_next) {
match cmp(a1, b1) {
Ordering::Less => self.peeked = b_next.take().map(Peeked::B),
Ordering::Greater => self.peeked = a_next.take().map(Peeked::A),
Expand Down
6 changes: 3 additions & 3 deletions library/std/src/sync/mpmc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ impl<T> Sender<T> {
#[unstable(feature = "mpmc_channel", issue = "126840")]
pub fn same_channel(&self, other: &Sender<T>) -> bool {
match (&self.flavor, &other.flavor) {
(SenderFlavor::Array(ref a), SenderFlavor::Array(ref b)) => a == b,
(SenderFlavor::List(ref a), SenderFlavor::List(ref b)) => a == b,
(SenderFlavor::Zero(ref a), SenderFlavor::Zero(ref b)) => a == b,
(SenderFlavor::Array(a), SenderFlavor::Array(b)) => a == b,
(SenderFlavor::List(a), SenderFlavor::List(b)) => a == b,
(SenderFlavor::Zero(a), SenderFlavor::Zero(b)) => a == b,
_ => false,
}
}
Expand Down
8 changes: 6 additions & 2 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,16 @@ pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
// If we're being run in SpawnedSecondary mode, run the test here. run_test
// will then exit the process.
if let Ok(name) = env::var(SECONDARY_TEST_INVOKER_VAR) {
env::remove_var(SECONDARY_TEST_INVOKER_VAR);
unsafe {
env::remove_var(SECONDARY_TEST_INVOKER_VAR);
}

// Convert benchmarks to tests if we're not benchmarking.
let mut tests = tests.iter().map(make_owned_test).collect::<Vec<_>>();
if env::var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR).is_ok() {
env::remove_var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR);
unsafe {
env::remove_var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR);
}
} else {
tests = convert_benchmarks_to_tests(tests);
};
Expand Down

0 comments on commit 4312d7b

Please sign in to comment.