Skip to content

Commit 59a435b

Browse files
author
Esteban Küber
committed
Use MultiSpan in E0707 and E709
1 parent d3b3bc5 commit 59a435b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc/hir/lowering.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use syntax::tokenstream::{Delimited, TokenStream, TokenTree};
7272
use syntax::parse::token::Token;
7373
use syntax::util::small_vector::SmallVector;
7474
use syntax::visit::{self, Visitor};
75-
use syntax_pos::Span;
75+
use syntax_pos::{Span, MultiSpan};
7676

7777
const HIR_ID_COUNTER_LOCKED: u32 = 0xFFFFFFFF;
7878

@@ -2049,7 +2049,7 @@ impl<'a> LoweringContext<'a> {
20492049
if current_lt_name != name {
20502050
struct_span_err!(
20512051
self.context.sess,
2052-
current_lt_span.between(lifetime.span),
2052+
MultiSpan::from_spans(vec![current_lt_span, lifetime.span]),
20532053
E0709,
20542054
"multiple different lifetimes used in arguments of `async fn`",
20552055
)
@@ -2061,7 +2061,7 @@ impl<'a> LoweringContext<'a> {
20612061
} else if current_lt_name.is_elided() && name.is_elided() {
20622062
struct_span_err!(
20632063
self.context.sess,
2064-
current_lt_span.between(lifetime.span),
2064+
MultiSpan::from_spans(vec![current_lt_span, lifetime.span]),
20652065
E0707,
20662066
"multiple elided lifetimes used in arguments of `async fn`",
20672067
)

src/test/ui/async-fn-multiple-lifetimes.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0709]: multiple different lifetimes used in arguments of `async fn`
2-
--> $DIR/async-fn-multiple-lifetimes.rs:17:49
2+
--> $DIR/async-fn-multiple-lifetimes.rs:17:47
33
|
44
LL | async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {}
5-
| --^^^^^^^^^-- different lifetime here
5+
| ^^ ^^ different lifetime here
66
| |
77
| first lifetime here
88
|
@@ -12,7 +12,7 @@ error[E0707]: multiple elided lifetimes used in arguments of `async fn`
1212
--> $DIR/async-fn-multiple-lifetimes.rs:26:39
1313
|
1414
LL | async fn multiple_elided_lifetimes(_: &u8, _: &u8) {}
15-
| -^^^^^^^- different lifetime here
15+
| ^ ^ different lifetime here
1616
| |
1717
| first lifetime here
1818
|

0 commit comments

Comments
 (0)