about summary refs log tree commit diff
path: root/src/librustc/infer
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-04 12:56:33 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-26 11:12:46 +0100
commite7c3fb90eeda06c6ac2bed523ce8fa358d48505b (patch)
tree54b0a4b7fddf428cc8508057c05249119fe3b85b /src/librustc/infer
parent2f0463a4a4f323c4deffc861349e38c6b5091782 (diff)
downloadrust-e7c3fb90eeda06c6ac2bed523ce8fa358d48505b.tar.gz
rust-e7c3fb90eeda06c6ac2bed523ce8fa358d48505b.zip
Add a distinct error code and description for "main function has wrong type"
Diffstat (limited to 'src/librustc/infer')
-rw-r--r--src/librustc/infer/error_reporting.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs
index 095d2a78a94..2bed8148b9f 100644
--- a/src/librustc/infer/error_reporting.rs
+++ b/src/librustc/infer/error_reporting.rs
@@ -629,10 +629,13 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
         let mut diag = match trace.cause.code {
             ObligationCauseCode::IfExpressionWithNoElse => {
                 struct_span_err!(self.tcx.sess, span, E0317, "{}", failure_str)
-            },
+            }
+            ObligationCauseCode::MainFunctionType => {
+                struct_span_err!(self.tcx.sess, span, E0579, "{}", failure_str)
+            }
             _ => {
                 struct_span_err!(self.tcx.sess, span, E0308, "{}", failure_str)
-            },
+            }
         };
         self.note_type_err(&mut diag, &trace.cause, None, Some(trace.values), terr);
         diag