about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-01-07 16:12:39 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-01-07 16:14:25 -0800
commite45312e5a0557b2d79028bd5f869f979bc2b5924 (patch)
tree5ab0fc8a449a5fc108fe2c685574aa52b5fc82ec
parentc662a9aad7a158c797faa4bd805808f867a3e22e (diff)
downloadrust-e45312e5a0557b2d79028bd5f869f979bc2b5924.tar.gz
rust-e45312e5a0557b2d79028bd5f869f979bc2b5924.zip
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.
-rw-r--r--src/librustc/middle/typeck/infer/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs
index 279318079b9..801b0966f75 100644
--- a/src/librustc/middle/typeck/infer/mod.rs
+++ b/src/librustc/middle/typeck/infer/mod.rs
@@ -741,6 +741,14 @@ impl infer_ctxt {
         // Don't report an error if actual type is ty_err.
         match ty::get(actual_ty).sty {
             ty::ty_err => return,
+            // Should really not report an error if the type
+            // has ty_err anywhere as a component, but that's
+            // annoying since we haven't written a visitor for
+            // ty::t yet
+            ty::ty_fn(fty) => match ty::get(fty.sig.output).sty {
+                ty::ty_err => return,
+                _ => ()
+            },
             _           => ()
         }
         let error_str = err.map_default(~"", |t_err|