diff options
| author | bors <bors@rust-lang.org> | 2019-05-24 03:07:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-24 03:07:07 +0000 |
| commit | 46805805abe58c287fa16963f897fd09d5d97467 (patch) | |
| tree | be2601105d73525f52a5eccb9290958d59f0d65b /src/libsyntax/parse | |
| parent | fd8e23c6b2902299cb76e89d868fbb84f48035ab (diff) | |
| parent | 8dc945c16912b988a10d48355df3195bff9cdd8f (diff) | |
| download | rust-46805805abe58c287fa16963f897fd09d5d97467.tar.gz rust-46805805abe58c287fa16963f897fd09d5d97467.zip | |
Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, r=pnkfelix
Borrowck error reporting cleanup * Don't show variables created by desugarings in borrowck errors * Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods. * Remove unused `ScopeTree` parameter. r? @pnkfelix
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index df801515082..a3d579b12b7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -8421,6 +8421,8 @@ impl<'a> Parser<'a> { for (index, input) in decl.inputs.iter_mut().enumerate() { let id = ast::DUMMY_NODE_ID; let span = input.pat.span; + let desugared_span = self.sess.source_map() + .mark_span_with_reason(CompilerDesugaringKind::Async, span, None); // Construct a name for our temporary argument. let name = format!("__arg{}", index); @@ -8437,8 +8439,7 @@ impl<'a> Parser<'a> { // this would affect the input to procedural macros, but they can have // their span marked as being the result of a compiler desugaring so // that they aren't linted against. - input.pat.span = self.sess.source_map().mark_span_with_reason( - CompilerDesugaringKind::Async, span, None); + input.pat.span = desugared_span; (binding_mode, ident, true) } @@ -8458,7 +8459,7 @@ impl<'a> Parser<'a> { node: PatKind::Ident( BindingMode::ByValue(Mutability::Immutable), ident, None, ), - span, + span: desugared_span, }), source: ArgSource::AsyncFn(input.pat.clone()), }) @@ -8471,7 +8472,7 @@ impl<'a> Parser<'a> { pat: P(Pat { id, node: PatKind::Ident(binding_mode, ident, None), - span, + span: desugared_span, }), // We explicitly do not specify the type for this statement. When the user's // argument type is `impl Trait` then this would require the |
