Skip to content

Commit cd9246e

Browse files
evanyeungfacebook-github-bot
authored andcommitted
Fix GitHub Cargo CI by replacing unstable Arc::unwrap_or_clone
Summary: Fixes the failure in T187825473 caused by D56339821. This diff fixes the failing github action in https://github.com/facebook/relay/actions/runs/8932140521/job/24535481318 which was caused due to the addition of an unstable API in Arc (f7b030e). I've replaced the function with it's internal implemention from the PR to ARC at rust-lang/rust#91589. Reviewed By: tyao1 Differential Revision: D56920263 fbshipit-source-id: e2d3f04921dd1e4b554ef075e258854b59764891
1 parent b159110 commit cd9246e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/crates/relay-compiler/src/build_project.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ fn merge_programs(onto: &mut Programs, from: Programs) {
504504
}
505505

506506
fn merge_program(onto: &mut Program, from: Arc<Program>) {
507-
let from = Arc::unwrap_or_clone(from);
507+
// Note: this it the inner implementation of the unstable "unwrap_or_clone"
508+
let from = Arc::try_unwrap(from).unwrap_or_else(|arc| (*arc).clone());
508509
onto.fragments.extend(from.fragments);
509510
onto.operations.extend(from.operations);
510511
}

0 commit comments

Comments
 (0)