summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-24 09:49:54 +0800
committerGitHub <noreply@github.com>2018-07-24 09:49:54 +0800
commit291a62064cc0af2cacd58f2697d1bcbd239a5103 (patch)
tree5d6ef7517b500917f0b3fc6c1a9ad3217a891786
parent85bb13c2326aec55695cef65d660aa02bb71c8b5 (diff)
parent59a435b22007d9d9c6d4023b4722e58bf99c3f41 (diff)
downloadrust-291a62064cc0af2cacd58f2697d1bcbd239a5103.tar.gz
Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
Use MultiSpan in E0707 and E709
-rw-r--r--src/librustc/hir/lowering.rs6
-rw-r--r--src/test/ui/async-fn-multiple-lifetimes.stderr6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 31350a78ac1..3b030fc098f 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -73,7 +73,7 @@ use syntax::tokenstream::{Delimited, TokenStream, TokenTree};
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 @@ impl<'a> LoweringContext<'a> {
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 @@ impl<'a> LoweringContext<'a> {
} 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`",
)
diff --git a/src/test/ui/async-fn-multiple-lifetimes.stderr b/src/test/ui/async-fn-multiple-lifetimes.stderr
index f203d9acf87..1d34673a005 100644
--- a/src/test/ui/async-fn-multiple-lifetimes.stderr
+++ b/src/test/ui/async-fn-multiple-lifetimes.stderr
@@ -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
|