Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
Use MultiSpan in E0707 and E709
This commit is contained in:
commit
291a62064c
@ -73,7 +73,7 @@
|
||||
use syntax::parse::token::Token;
|
||||
use syntax::util::small_vector::SmallVector;
|
||||
use syntax::visit::{self, Visitor};
|
||||
use syntax_pos::Span;
|
||||
use syntax_pos::{Span, MultiSpan};
|
||||
|
||||
const HIR_ID_COUNTER_LOCKED: u32 = 0xFFFFFFFF;
|
||||
|
||||
@ -2071,7 +2071,7 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
|
||||
if current_lt_name != name {
|
||||
struct_span_err!(
|
||||
self.context.sess,
|
||||
current_lt_span.between(lifetime.span),
|
||||
MultiSpan::from_spans(vec![current_lt_span, lifetime.span]),
|
||||
E0709,
|
||||
"multiple different lifetimes used in arguments of `async fn`",
|
||||
)
|
||||
@ -2083,7 +2083,7 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
|
||||
} else if current_lt_name.is_elided() && name.is_elided() {
|
||||
struct_span_err!(
|
||||
self.context.sess,
|
||||
current_lt_span.between(lifetime.span),
|
||||
MultiSpan::from_spans(vec![current_lt_span, lifetime.span]),
|
||||
E0707,
|
||||
"multiple elided lifetimes used in arguments of `async fn`",
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0709]: multiple different lifetimes used in arguments of `async fn`
|
||||
--> $DIR/async-fn-multiple-lifetimes.rs:17:49
|
||||
--> $DIR/async-fn-multiple-lifetimes.rs:17:47
|
||||
|
|
||||
LL | async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {}
|
||||
| --^^^^^^^^^-- different lifetime here
|
||||
| ^^ ^^ different lifetime here
|
||||
| |
|
||||
| first lifetime here
|
||||
|
|
||||
@ -12,7 +12,7 @@ error[E0707]: multiple elided lifetimes used in arguments of `async fn`
|
||||
--> $DIR/async-fn-multiple-lifetimes.rs:26:39
|
||||
|
|
||||
LL | async fn multiple_elided_lifetimes(_: &u8, _: &u8) {}
|
||||
| -^^^^^^^- different lifetime here
|
||||
| ^ ^ different lifetime here
|
||||
| |
|
||||
| first lifetime here
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user