File tree Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,6 @@ where C: RaftTypeConfig
321
321
RPCError :: Unreachable ( e) => RPCError :: Unreachable ( e) ,
322
322
RPCError :: PayloadTooLarge ( e) => RPCError :: PayloadTooLarge ( e) ,
323
323
RPCError :: Network ( e) => RPCError :: Network ( e) ,
324
- RPCError :: RemoteError ( _infallible) => unreachable ! ( ) ,
325
324
}
326
325
}
327
326
}
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ where E: Into<Infallible>
11
11
fn into_ok ( self ) -> T {
12
12
match self {
13
13
Ok ( t) => t,
14
- Err ( _) => unreachable ! ( ) ,
14
+ Err ( e) => {
15
+ // NOTE: `allow` required because of buggy reachability detection by rust compiler
16
+ #[ allow( unreachable_code) ]
17
+ match e. into ( ) { }
18
+ }
15
19
}
16
20
}
17
21
}
Original file line number Diff line number Diff line change @@ -48,17 +48,13 @@ impl<C: RaftTypeConfig> From<StreamingError<C>> for ReplicationError<C> {
48
48
49
49
impl < C : RaftTypeConfig > From < RPCError < C > > for StreamingError < C > {
50
50
fn from ( value : RPCError < C > ) -> Self {
51
- #[ allow( unreachable_patterns) ]
52
51
match value {
53
52
RPCError :: Timeout ( e) => StreamingError :: Timeout ( e) ,
54
53
RPCError :: Unreachable ( e) => StreamingError :: Unreachable ( e) ,
55
54
RPCError :: PayloadTooLarge ( _e) => {
56
55
unreachable ! ( "PayloadTooLarge should not be converted to StreamingError" )
57
56
}
58
57
RPCError :: Network ( e) => StreamingError :: Network ( e) ,
59
- RPCError :: RemoteError ( _e) => {
60
- unreachable ! ( "Infallible error should not be produced at all" )
61
- }
62
58
}
63
59
}
64
60
}
Original file line number Diff line number Diff line change @@ -74,11 +74,8 @@ impl AsyncRuntime for MonoioRuntime {
74
74
}
75
75
76
76
#[ inline]
77
- fn is_panic ( _join_error : & Self :: JoinError ) -> bool {
78
- // Given that joining a task will never fail, i.e., `Self::JoinError`
79
- // will never be constructed, and it is impossible to construct an
80
- // enum like `Infallible`, this function could never be invoked.
81
- unreachable ! ( "unreachable since argument `join_error` could never be constructed" )
77
+ fn is_panic ( join_error : & Self :: JoinError ) -> bool {
78
+ match * join_error { }
82
79
}
83
80
84
81
#[ inline]
You can’t perform that action at this time.
0 commit comments