Merge #1930
1930: replace horrible hack with a slightly less horrible one r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
21fa889cf3
2 changed files with 5 additions and 3 deletions
|
@ -32,11 +32,10 @@ pub trait CheckCanceled {
|
|||
|
||||
fn catch_canceled<F, T>(&self, f: F) -> Result<T, Canceled>
|
||||
where
|
||||
Self: Sized,
|
||||
Self: Sized + panic::RefUnwindSafe,
|
||||
F: FnOnce(&Self) -> T + panic::UnwindSafe,
|
||||
{
|
||||
let this = panic::AssertUnwindSafe(self);
|
||||
panic::catch_unwind(|| f(*this)).map_err(|err| match err.downcast::<Canceled>() {
|
||||
panic::catch_unwind(|| f(self)).map_err(|err| match err.downcast::<Canceled>() {
|
||||
Ok(canceled) => *canceled,
|
||||
Err(payload) => panic::resume_unwind(payload),
|
||||
})
|
||||
|
|
|
@ -30,6 +30,9 @@ impl PartialEq for TraitSolver {
|
|||
|
||||
impl Eq for TraitSolver {}
|
||||
|
||||
// FIXME: this impl is WRONG, chalk is not RefUnwindSafe, and this causes #1927
|
||||
impl std::panic::RefUnwindSafe for TraitSolver {}
|
||||
|
||||
impl TraitSolver {
|
||||
fn solve(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Reference in a new issue