-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d36028
commit c19efb8
Showing
4 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
use super::Backend; | ||
use super::{RethrowHandle, ThrowByValue}; | ||
|
||
pub(crate) struct ActiveBackend; | ||
|
||
compile_error!("Lithium does not support no_std in this configuration"); | ||
|
||
unsafe impl Backend for ActiveBackend { | ||
type ExceptionHeader = (); | ||
unsafe impl ThrowByValue for ActiveBackend { | ||
type RethrowHandle<E> = UnimplementedRethrowHandle; | ||
|
||
fn new_header() {} | ||
unsafe fn throw<E>(_cause: E) -> ! { | ||
unimplemented!() | ||
} | ||
|
||
unsafe fn throw(_ex: *mut ()) -> ! { | ||
unsafe fn intercept<Func: FnOnce() -> R, R, E>( | ||
_func: Func, | ||
) -> Result<R, (E, Self::RethrowHandle<E>)> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
pub(crate) struct UnimplementedRethrowHandle; | ||
|
||
fn intercept<Func: FnOnce() -> R, R>(_func: Func) -> Result<R, *mut ()> { | ||
impl RethrowHandle for UnimplementedRethrowHandle { | ||
unsafe fn rethrow<F>(self, _new_cause: F) -> ! { | ||
unimplemented!() | ||
} | ||
} |