// https://github.com/rust-lang/rust/blob/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/compiler/rustc_typeck/src/check/cast.rs#L596
// https://github.com/rust-lang/rust/blob/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/compiler/rustc_typeck/src/check/cast.rs#L654
- rust_debug ("cast_rules from={%s} to={%s}",
- from.get_ty ()->debug_str ().c_str (),
+ TyTy::BaseType *from_type = from.get_ty ()->destructure ();
+
+ rust_debug ("cast_rules from={%s} to={%s}", from_type->debug_str ().c_str (),
to.get_ty ()->debug_str ().c_str ());
- switch (from.get_ty ()->get_kind ())
+ switch (from_type->get_kind ())
{
case TyTy::TypeKind::INFER: {
TyTy::InferType *from_infer
- = static_cast<TyTy::InferType *> (from.get_ty ());
+ = static_cast<TyTy::InferType *> (from_type);
switch (from_infer->get_infer_kind ())
{
case TyTy::InferType::InferTypeKind::GENERAL:
}
} // namespace Resolver
-} // namespace Rust
+} // namespace Rust
\ No newline at end of file