Skip to content

Use MultiSpan in E0707 and E709 #52622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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;

Expand Down Expand Up @@ -2049,7 +2049,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`",
)
Expand All @@ -2061,7 +2061,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`",
)
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/async-fn-multiple-lifetimes.stderr
Original file line number Diff line number Diff line change
@@ -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
|
Expand All @@ -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
|
Expand Down