File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,16 @@ TypeCastRules::cast_rules ()
60
60
// https://github.com/rust-lang/rust/blob/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/compiler/rustc_typeck/src/check/cast.rs#L596
61
61
// https://github.com/rust-lang/rust/blob/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/compiler/rustc_typeck/src/check/cast.rs#L654
62
62
63
- rust_debug (" cast_rules from={%s} to={%s}" ,
64
- from.get_ty ()->debug_str ().c_str (),
63
+ TyTy::BaseType *from_type = from.get_ty ()->destructure ();
64
+
65
+ rust_debug (" cast_rules from={%s} to={%s}" , from_type->debug_str ().c_str (),
65
66
to.get_ty ()->debug_str ().c_str ());
66
67
67
- switch (from. get_ty () ->get_kind ())
68
+ switch (from_type ->get_kind ())
68
69
{
69
70
case TyTy::TypeKind::INFER: {
70
71
TyTy::InferType *from_infer
71
- = static_cast <TyTy::InferType *> (from. get_ty () );
72
+ = static_cast <TyTy::InferType *> (from_type );
72
73
switch (from_infer->get_infer_kind ())
73
74
{
74
75
case TyTy::InferType::InferTypeKind::GENERAL:
@@ -290,4 +291,4 @@ TypeCastRules::emit_cast_error () const
290
291
}
291
292
292
293
} // namespace Resolver
293
- } // namespace Rust
294
+ } // namespace Rust
Original file line number Diff line number Diff line change
1
+ fn test < T > ( a : T ) -> T {
2
+ a
3
+ }
4
+
5
+ fn main ( ) {
6
+ let t: i32 = test ( 123 as i32 ) as i32 ;
7
+ // { dg-warning "unused name" "" { target *-*-* } .-1 }
8
+ }
You can’t perform that action at this time.
0 commit comments