Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit f4f0b64

Browse files
Hack fix for ICE as seen in CI (#23306)
(cherry picked from commit c81dd60) Co-authored-by: Trent Nelson <[email protected]>
1 parent 84c57dd commit f4f0b64

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

runtime/src/builtins.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ pub enum BuiltinFeatureTransition {
119119
},
120120
}
121121

122+
// https://github.com/solana-labs/solana/pull/23233 added `BuiltinFeatureTransition`
123+
// to `Bank` which triggers https://github.com/rust-lang/rust/issues/92987 while
124+
// attempting to resolve `Sync` on `BankRc` in `AccountsBackgroundService::new` ala,
125+
//
126+
// query stack during panic:
127+
// #0 [evaluate_obligation] evaluating trait selection obligation `bank::BankRc: core::marker::Sync`
128+
// #1 [typeck] type-checking `accounts_background_service::<impl at runtime/src/accounts_background_service.rs:358:1: 520:2>::new`
129+
// #2 [typeck_item_bodies] type-checking all item bodies
130+
// #3 [analysis] running analysis passes on this crate
131+
// end of query stack
132+
//
133+
// Yoloing a `Sync` onto it avoids the auto trait evaluation and thus the ICE.
134+
//
135+
// We should remove this when upgrading to Rust 1.60.0, where the bug has been
136+
// fixed by https://github.com/rust-lang/rust/pull/93064
137+
unsafe impl Send for BuiltinFeatureTransition {}
138+
unsafe impl Sync for BuiltinFeatureTransition {}
139+
122140
impl BuiltinFeatureTransition {
123141
pub fn to_action(
124142
&self,

0 commit comments

Comments
 (0)