rust/src/libsyntax
Alex Crichton d1c584e41b syntax: Tweak parsing lifetime bounds on closures
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
2014-04-06 00:08:21 -07:00
..
ext syntax: remove obsolete mutability from ExprVec and ExprRepeat. 2014-04-04 13:23:03 -07:00
parse syntax: Tweak parsing lifetime bounds on closures 2014-04-06 00:08:21 -07:00
print syntax: Tweak parsing lifetime bounds on closures 2014-04-06 00:08:21 -07:00
util syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
abi.rs Test fixes from the rollup 2014-04-03 17:11:26 -07:00
ast_map.rs auto merge of #13237 : alexcrichton/rust/private-tuple-structs, r=brson 2014-04-03 18:41:45 -07:00
ast_util.rs syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
ast.rs syntax: remove obsolete mutability from ExprVec and ExprRepeat. 2014-04-04 13:23:03 -07:00
attr.rs syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
codemap.rs Switch some tuple structs to pub fields 2014-03-31 19:50:51 -07:00
crateid.rs syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
diagnostic.rs Added session.fileline_note() method and support infrastucture for it. 2014-04-05 03:46:43 +02:00
fold.rs syntax: remove obsolete mutability from ExprVec and ExprRepeat. 2014-04-04 13:23:03 -07:00
lib.rs Register new snapshots 2014-04-04 13:23:08 -07:00
owned_slice.rs syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
visit.rs syntax: remove obsolete mutability from ExprVec and ExprRepeat. 2014-04-04 13:23:03 -07:00