diff options
| author | bors <bors@rust-lang.org> | 2019-05-03 15:10:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-03 15:10:16 +0000 |
| commit | 3af1bdc4bcc502d576b1e836f99bae1eb29dbafd (patch) | |
| tree | 928e4e1504008643140afc74d2c998e62e0947e9 /src/libsyntax/parse | |
| parent | ef9a876f8297e26859469b004047e0946ed10565 (diff) | |
| parent | 6f7a1eabdf2770d1a83ad6f1968162f64b36a13d (diff) | |
| download | rust-3af1bdc4bcc502d576b1e836f99bae1eb29dbafd.tar.gz rust-3af1bdc4bcc502d576b1e836f99bae1eb29dbafd.zip | |
Auto merge of #60510 - Centril:rollup-gsndjbp, r=Centril
Rollup of 12 pull requests Successful merges: - #59928 (Make deprecation lint `ambiguous_associated_items` deny-by-default) - #60220 (report fatal errors during doctest parsing) - #60373 (Tidy: ensure lang features are sorted by since) - #60388 (Disallow non-explicit elided lifetimes in async fn) - #60393 ( Do not suggest incorrect syntax on pattern type error due to borrow) - #60401 (Rename `RUST_LOG` to `RUSTC_LOG`) - #60409 (Require a trait in the bounds of existential types) - #60455 (Resolve match arm ty when arms diverge) - #60457 (Const prop refactoring) - #60467 (Avoid repeated interning of static strings.) - #60478 (minor compiler doc tweaks) - #60501 (Propagate mutability from arguments to local bindings in async fn) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f70acb3e7da..c5173aa5569 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -8725,9 +8725,9 @@ impl<'a> Parser<'a> { // Check if this is a ident pattern, if so, we can optimize and avoid adding a // `let <pat> = __argN;` statement, instead just adding a `let <pat> = <pat>;` // statement. - let (ident, is_simple_pattern) = match input.pat.node { - PatKind::Ident(_, ident, _) => (ident, true), - _ => (ident, false), + let (binding_mode, ident, is_simple_pattern) = match input.pat.node { + PatKind::Ident(binding_mode, ident, _) => (binding_mode, ident, true), + _ => (BindingMode::ByValue(Mutability::Immutable), ident, false), }; // Construct an argument representing `__argN: <ty>` to replace the argument of the @@ -8755,9 +8755,7 @@ impl<'a> Parser<'a> { let move_local = Local { pat: P(Pat { id, - node: PatKind::Ident( - BindingMode::ByValue(Mutability::Immutable), ident, None, - ), + node: PatKind::Ident(binding_mode, ident, None), span, }), // We explicitly do not specify the type for this statement. When the user's |
