Skip to content

Commit e45312e

Browse files
committed
Suppress type error message involving a function type whose result is ty_err
In general it would be good to suppress any messages involving types that have ty_err as a sub-component, but this works for now.
1 parent c662a9a commit e45312e

File tree

1 file changed

+8
-0
lines changed
  • src/librustc/middle/typeck/infer

1 file changed

+8
-0
lines changed

src/librustc/middle/typeck/infer/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,14 @@ impl infer_ctxt {
741741
// Don't report an error if actual type is ty_err.
742742
match ty::get(actual_ty).sty {
743743
ty::ty_err => return,
744+
// Should really not report an error if the type
745+
// has ty_err anywhere as a component, but that's
746+
// annoying since we haven't written a visitor for
747+
// ty::t yet
748+
ty::ty_fn(fty) => match ty::get(fty.sig.output).sty {
749+
ty::ty_err => return,
750+
_ => ()
751+
},
744752
_ => ()
745753
}
746754
let error_str = err.map_default(~"", |t_err|

0 commit comments

Comments
 (0)