Safe Transmute: Change Answer type to Result
This patch updates the `Answer` type from `rustc_transmute` so that it just a type alias to `Result`. This makes it so that the standard methods for `Result` can be used to process the `Answer` tree, including being able to make use of the `?` operator on `Answer`s. Also, remove some unused functions
This commit is contained in:
@@ -675,11 +675,11 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
scope,
|
||||
assume,
|
||||
) {
|
||||
rustc_transmute::Answer::Yes => Ok(Certainty::Yes),
|
||||
rustc_transmute::Answer::No(_)
|
||||
| rustc_transmute::Answer::IfTransmutable { .. }
|
||||
| rustc_transmute::Answer::IfAll(_)
|
||||
| rustc_transmute::Answer::IfAny(_) => Err(NoSolution),
|
||||
Ok(None) => Ok(Certainty::Yes),
|
||||
Err(_)
|
||||
| Ok(Some(rustc_transmute::Condition::IfTransmutable { .. }))
|
||||
| Ok(Some(rustc_transmute::Condition::IfAll(_)))
|
||||
| Ok(Some(rustc_transmute::Condition::IfAny(_))) => Err(NoSolution),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user