Safe Transmute: Refactor error handling and Answer type
- Create `Answer` type that is not just a type alias of `Result` - Remove a usage of `map_layouts` to make the code easier to read - Don't hide errors related to Unknown Layout when computing transmutability
This commit is contained in:
@@ -188,14 +188,14 @@ pub(crate) mod rustc {
|
||||
/// The layout of the type is unspecified.
|
||||
Unspecified,
|
||||
/// This error will be surfaced elsewhere by rustc, so don't surface it.
|
||||
Unknown,
|
||||
UnknownLayout,
|
||||
TypeError(ErrorGuaranteed),
|
||||
}
|
||||
|
||||
impl<'tcx> From<LayoutError<'tcx>> for Err {
|
||||
fn from(err: LayoutError<'tcx>) -> Self {
|
||||
match err {
|
||||
LayoutError::Unknown(..) => Self::Unknown,
|
||||
LayoutError::Unknown(..) => Self::UnknownLayout,
|
||||
err => unimplemented!("{:?}", err),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user