about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-01 05:24:11 +0000
committerbors <bors@rust-lang.org>2017-06-01 05:24:11 +0000
commit38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a (patch)
treefd62a4e7688baa1ef79d4d4ac559f487d64903e4 /src/librustc_errors/lib.rs
parente0cc22b4bae8007c59fbe58f2c104ecd743d746a (diff)
parent9bd6dc73fc7fd46bf83ff17bea13a410efb1fc96 (diff)
downloadrust-38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a.tar.gz
rust-38efb2e1ccf210b0108d2b88ee9d4ddcd8e91a3a.zip
Auto merge of #42348 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #42136, #42275, #42286, #42297, #42302, #42306, #42314, #42324, #42347
- Failed merges:
Diffstat (limited to 'src/librustc_errors/lib.rs')
-rw-r--r--src/librustc_errors/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index f7191e49216..d1aaaf4ba7b 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -345,9 +345,15 @@ impl Handler {
         result.code(code.to_owned());
         result
     }
+    // FIXME: This method should be removed (every error should have an associated error code).
     pub fn struct_err<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
         DiagnosticBuilder::new(self, Level::Error, msg)
     }
+    pub fn struct_err_with_code<'a>(&'a self, msg: &str, code: &str) -> DiagnosticBuilder<'a> {
+        let mut result = DiagnosticBuilder::new(self, Level::Error, msg);
+        result.code(code.to_owned());
+        result
+    }
     pub fn struct_span_fatal<'a, S: Into<MultiSpan>>(&'a self,
                                                      sp: S,
                                                      msg: &str)