about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-06 01:36:39 -0700
committerbors <bors@rust-lang.org>2014-04-06 01:36:39 -0700
commit667f82a79b2275a696b21086ddf5148a617fe20a (patch)
tree563c7ec6a927ebf26af2d2154ca1311073233657 /src/rustllvm/RustWrapper.cpp
parent4e9e25907b6c63e3bde3dd122160ec07ef1ba6b9 (diff)
parentd1c584e41bc4f7c49123911dd93c2b3db38b0f8f (diff)
downloadrust-667f82a79b2275a696b21086ddf5148a617fe20a.tar.gz
rust-667f82a79b2275a696b21086ddf5148a617fe20a.zip
auto merge of #13268 : alexcrichton/rust/parse-closure, r=cmr
In summary these are some example transitions this change makes:

    'a ||       => ||: 'a
    proc:Send() => proc():Send

The intended syntax for closures is to put the lifetime bound not at the front
but rather in the list of bounds. Currently there is no official support in the
AST for bounds that are not 'static, so this case is currently specially handled
in the parser to desugar to what the AST is expecting. Additionally, this moves
the bounds on procedures to the correct position, which is after the argument
list.

The current grammar for closures and procedures is:

    procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
                        [ ':' bound-list ] [ '->' type ]
    closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|'
                        [ ':' bound-list ] [ '->' type ]
    lifetime-list := lifetime | lifetime ',' lifetime-list
    arg-list := ident ':' type | ident ':' type ',' arg-list
    bound-list := bound | bound '+' bound-list
    bound := path | lifetime

This does not currently handle the << ambiguity in `Option<<'a>||>`, I am
deferring that to a later patch. Additionally, this removes the support for the
obsolete syntaxes of ~fn and &fn.

Closes #10553
Closes #10767 
Closes #11209
Closes #11210
Closes #11211
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions