diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-10-11 14:02:06 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-11-01 14:07:45 -0400 |
| commit | f6526512751bfe29a0bf9535bc41db2076ff57ba (patch) | |
| tree | bb03dcf1be6a9997ac28ecd1c46b772c2459a9ff /src/librustc_errors | |
| parent | 888a92cef37342c7878028eda967c85eb15afe43 (diff) | |
| download | rust-f6526512751bfe29a0bf9535bc41db2076ff57ba.tar.gz rust-f6526512751bfe29a0bf9535bc41db2076ff57ba.zip | |
retool EarlyLint to track a Diagnostic
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/diagnostic.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index dab8fb665ac..cb03257a5ee 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -166,6 +166,14 @@ impl Diagnostic { self.level } + /// Used by a lint. Copies over all details *but* the "main + /// message". + pub fn copy_details_not_message(&mut self, from: &Diagnostic) { + self.span = from.span.clone(); + self.code = from.code.clone(); + self.children.extend(from.children.iter().cloned()) + } + /// Convenience function for internal use, clients should use one of the /// public methods above. fn sub(&mut self, |
