diff options
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/lib.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index d82d7dbe70f..d2f3eea85f2 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -274,9 +274,20 @@ impl<'a> DiagnosticBuilder<'a> { found: &fmt::Display) -> &mut DiagnosticBuilder<'a> { + self.note_expected_found_extra(label, expected, found, &"", &"") + } + + pub fn note_expected_found_extra(&mut self, + label: &fmt::Display, + expected: &fmt::Display, + found: &fmt::Display, + expected_extra: &fmt::Display, + found_extra: &fmt::Display) + -> &mut DiagnosticBuilder<'a> + { // For now, just attach these as notes - self.note(&format!("expected {} `{}`", label, expected)); - self.note(&format!(" found {} `{}`", label, found)); + self.note(&format!("expected {} `{}`{}", label, expected, expected_extra)); + self.note(&format!(" found {} `{}`{}", label, found, found_extra)); self } @@ -764,4 +775,4 @@ pub fn expect<T, M>(diag: &Handler, opt: Option<T>, msg: M) -> T where Some(t) => t, None => diag.bug(&msg()), } -} \ No newline at end of file +} |
