diff options
| author | mcarton <cartonmartin+git@gmail.com> | 2016-07-28 19:33:31 +0200 |
|---|---|---|
| committer | mcarton <cartonmartin+git@gmail.com> | 2016-07-28 19:33:31 +0200 |
| commit | 6dc98cf099d1fc3209e1354144f2190c052c8a0b (patch) | |
| tree | c21c2be6b1a23e697e679fa6ec3b027fabf44f4a /src/libsyntax_pos | |
| parent | cec262e55a92ad15196c4ea6d490fb6ef6bccab4 (diff) | |
| download | rust-6dc98cf099d1fc3209e1354144f2190c052c8a0b.tar.gz rust-6dc98cf099d1fc3209e1354144f2190c052c8a0b.zip | |
Revert "Remove unused methods from MultiSpan"
This reverts commit f7019a4e2f80577d38ec35fcebd64d5970b15f78. This removed the only way to make a suggestion with more than one substitute. Bring it back until we come up with a better solution.
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index c96be8fec2b..7dfe19452a2 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -193,6 +193,20 @@ impl MultiSpan { } } + pub fn from_span(primary_span: Span) -> MultiSpan { + MultiSpan { + primary_spans: vec![primary_span], + span_labels: vec![] + } + } + + pub fn from_spans(vec: Vec<Span>) -> MultiSpan { + MultiSpan { + primary_spans: vec, + span_labels: vec![] + } + } + pub fn push_span_label(&mut self, span: Span, label: String) { self.span_labels.push((span, label)); } @@ -240,10 +254,7 @@ impl MultiSpan { impl From<Span> for MultiSpan { fn from(span: Span) -> MultiSpan { - MultiSpan { - primary_spans: vec![span], - span_labels: vec![] - } + MultiSpan::from_span(span) } } |
