Skip to content

Commit 6dc98cf

Browse files
committed
Revert "Remove unused methods from MultiSpan"
This reverts commit f7019a4. 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.
1 parent cec262e commit 6dc98cf

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/libsyntax_pos/lib.rs

+15-4
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,20 @@ impl MultiSpan {
193193
}
194194
}
195195

196+
pub fn from_span(primary_span: Span) -> MultiSpan {
197+
MultiSpan {
198+
primary_spans: vec![primary_span],
199+
span_labels: vec![]
200+
}
201+
}
202+
203+
pub fn from_spans(vec: Vec<Span>) -> MultiSpan {
204+
MultiSpan {
205+
primary_spans: vec,
206+
span_labels: vec![]
207+
}
208+
}
209+
196210
pub fn push_span_label(&mut self, span: Span, label: String) {
197211
self.span_labels.push((span, label));
198212
}
@@ -240,10 +254,7 @@ impl MultiSpan {
240254

241255
impl From<Span> for MultiSpan {
242256
fn from(span: Span) -> MultiSpan {
243-
MultiSpan {
244-
primary_spans: vec![span],
245-
span_labels: vec![]
246-
}
257+
MultiSpan::from_span(span)
247258
}
248259
}
249260

0 commit comments

Comments
 (0)