File tree 1 file changed +8
-12
lines changed
src/librustc/middle/typeck
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -60,29 +60,25 @@ fn get_base_type(inference_context: &InferCtxt,
60
60
span : Span ,
61
61
original_type : t )
62
62
-> Option < t > {
63
- let resolved_type;
64
- match resolve_type ( inference_context,
65
- Some ( span) ,
66
- original_type,
67
- resolve_ivar) {
68
- Ok ( resulting_type) if !type_is_ty_var ( resulting_type) => {
69
- resolved_type = resulting_type;
70
- }
63
+ let resolved_type = match resolve_type ( inference_context,
64
+ Some ( span) ,
65
+ original_type,
66
+ resolve_ivar) {
67
+ Ok ( resulting_type) if !type_is_ty_var ( resulting_type) => resulting_type,
71
68
_ => {
72
69
inference_context. tcx . sess . span_fatal ( span,
73
70
"the type of this value must be known in order \
74
71
to determine the base type") ;
75
72
}
76
- }
73
+ } ;
77
74
78
75
match get ( resolved_type) . sty {
79
76
ty_enum( ..) | ty_struct( ..) | ty_unboxed_closure( ..) => {
80
77
debug ! ( "(getting base type) found base type" ) ;
81
78
Some ( resolved_type)
82
79
}
83
- // FIXME(14865) I would prefere to use `_` here, but that causes a
84
- // compiler error.
85
- ty_uniq( _) | ty_rptr( _, _) | ty_trait( ..) if ty:: type_is_trait ( resolved_type) => {
80
+
81
+ _ if ty:: type_is_trait ( resolved_type) => {
86
82
debug ! ( "(getting base type) found base type (trait)" ) ;
87
83
Some ( resolved_type)
88
84
}
You can’t perform that action at this time.
0 commit comments