File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/librustc/middle/typeck/infer Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -737,10 +737,19 @@ impl infer_ctxt {
737
737
fn type_error_message ( sp : span , mk_msg : fn ( ~str ) -> ~str ,
738
738
actual_ty : ty:: t , err : Option < & ty:: type_err > ) {
739
739
let actual_ty = self . resolve_type_vars_if_possible ( actual_ty) ;
740
+ let mut actual_sty = ty:: get ( copy actual_ty) ;
740
741
741
742
// Don't report an error if actual type is ty_err.
742
- match ty :: get ( actual_ty ) . sty {
743
+ match actual_sty . sty {
743
744
ty:: ty_err => return ,
745
+ // Should really not report an error if the type
746
+ // has ty_err anywhere as a component, but that's
747
+ // annoying since we haven't written a visitor for
748
+ // ty::t yet
749
+ ty:: ty_fn( ref fty) => match ty:: get ( fty. sig . output ) . sty {
750
+ ty:: ty_err => return ,
751
+ _ => ( )
752
+ } ,
744
753
_ => ( )
745
754
}
746
755
let error_str = err. map_default ( ~"", |t_err|
You can’t perform that action at this time.
0 commit comments