Skip to content

Rollup of 12 pull requests #60510

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 44 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bee92b5
Make deprecation lint `ambiguous_associated_items` deny-by-default
petrochenkov Apr 12, 2019
a912664
report fatal errors during doctest parsing
euclio Apr 23, 2019
0e7e938
Do not suggest incorrect syntax on pattern borrow error
estebank Apr 30, 2019
742b48d
Be more specific in the suggestion filtering
estebank Apr 30, 2019
ff68673
add tests
estebank Apr 30, 2019
693eea5
review comments
estebank Apr 30, 2019
14ca950
Fix style
estebank Apr 30, 2019
6068478
Add if let test
estebank Apr 30, 2019
bf4d0ad
Rename to RUSTC_LOG
JohnTitor Apr 30, 2019
da46eea
Add error for existential types
JohnTitor Apr 30, 2019
bb3549f
Fix tests
JohnTitor Apr 30, 2019
f56d285
Use multispan
JohnTitor Apr 30, 2019
db7f265
Fix spans
JohnTitor Apr 30, 2019
748d978
Fix run-pass test
JohnTitor Apr 30, 2019
ed08c6a
review comments: change wording
estebank Apr 30, 2019
24fddb1
Resolve match arm ty when arms diverge
estebank May 1, 2019
c6e13bc
Disallow non-explicit elided lifetimes in async fn
cramertj Apr 30, 2019
6ef39e6
Avoid repeated interning of static strings.
nnethercote May 2, 2019
16fe8cc
Remove the `self.mir` field from `ConstPropagator`
wesleywiser Apr 29, 2019
cac07eb
Fix failing test
wesleywiser May 2, 2019
8b82f68
Make find_attr_val a little bit more precise
rasendubi Apr 29, 2019
b7f55ca
Assign group and parse since for Feature
rasendubi Apr 29, 2019
d5ba6d4
Ensure language features in group are sorted by since
rasendubi Apr 29, 2019
d54477e
Address review comments
rasendubi May 1, 2019
90d3fa2
Make tidy::version::Version a [u32; 3]
rasendubi May 1, 2019
3b4fe7e
Group and sort feature_gate.rs
rasendubi May 1, 2019
c120fd8
Rework Version::parse to avoid extra allocations
rasendubi May 1, 2019
4bcc828
Make in_feature_group a simple bool flag
rasendubi May 2, 2019
201f14b
Make tidy::version::Version copy
rasendubi May 2, 2019
69fd757
fix markdown syntax in `LateContext` examples
euclio May 2, 2019
bbe7b85
mention `hir::Body` in docs for `hir::FnDecl`
euclio May 2, 2019
2fe50bc
Propagate mutability from arguments to local bindings in async fn
taiki-e May 3, 2019
e9509f8
Rollup merge of #59928 - petrochenkov:denyambass, r=varkor
Centril May 3, 2019
06e1d88
Rollup merge of #60220 - euclio:rustdoc-test-fatal-parsing-errors, r=…
Centril May 3, 2019
9199bb5
Rollup merge of #60373 - rasendubi:lang-features-sort-since, r=Centril
Centril May 3, 2019
3ca0d36
Rollup merge of #60388 - cramertj:elided-lifetime-async, r=nikomatsakis
Centril May 3, 2019
3e536e8
Rollup merge of #60393 - estebank:pat-sugg, r=oli-obk
Centril May 3, 2019
bfa22cf
Rollup merge of #60401 - JohnTitor:rename-log, r=davidtwco
Centril May 3, 2019
f622861
Rollup merge of #60409 - JohnTitor:error-for-existential-type, r=oli-obk
Centril May 3, 2019
2b5e296
Rollup merge of #60455 - estebank:resolve-match-arm-ty, r=davidtwco
Centril May 3, 2019
3fe5fac
Rollup merge of #60457 - wesleywiser:const_prop_refactoring, r=oli-obk
Centril May 3, 2019
0784755
Rollup merge of #60467 - nnethercote:less-symbol-interning, r=davidtwco
Centril May 3, 2019
d5809a8
Rollup merge of #60478 - euclio:doc-fixes, r=cramertj
Centril May 3, 2019
6f7a1ea
Rollup merge of #60501 - taiki-e:async-await-mutable-arguments, r=cra…
Centril May 3, 2019
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
Prev Previous commit
Next Next commit
Propagate mutability from arguments to local bindings in async fn
  • Loading branch information
taiki-e committed May 3, 2019
commit 2fe50bc01bf9023b64a72407bb41a1f3b7245abd
10 changes: 4 additions & 6 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/test/ui/async-await/mutable-arguments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// edition:2018
// run-pass

#![feature(async_await)]

async fn foo(n: u32, mut vec: Vec<u32>) {
vec.push(n);
}

fn main() {}