]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #35015 - petrochenkov:forearg, r=nikomatsakis
authorbors <bors@rust-lang.org>
Thu, 4 Aug 2016 05:56:33 +0000 (22:56 -0700)
committerGitHub <noreply@github.com>
Thu, 4 Aug 2016 05:56:33 +0000 (22:56 -0700)
Properly enforce the "patterns aren't allowed in foreign functions" rule

Cases like `arg @ PATTERN` or `mut arg` were missing.
Apply the same rule to function pointer types.

Closes https://github.com/rust-lang/rust/issues/35203
[breaking-change], no breakage in sane code is expected though
r? @nikomatsakis

This is somewhat related to https://github.com/rust-lang/rfcs/pull/1685 (cc @matklad).
The goal is to eventually support full pattern syntax where it makes sense (function body may present) and to support *only* the following forms - `TYPE`, `ident: TYPE`, `_: TYPE` - where patterns don't make sense (function body doesn't present), i.e. in foreign functions and function pointer types.


Trivial merge