summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-11-03Allow bootstrapping without a key. Fixes #36548Brian Anderson-9/+6
This will make it easier for packagers to bootstrap rustc when they happen to have a bootstrap compiler with a slightly different version number. It's not ok for anything other than the build system to set this environment variable.
2016-10-19Stabilise attributes on statements.Nick Cameron-3/+2
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag. cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
2016-10-19Stabilise `?`Nick Cameron-7/+3
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-09-26Auto merge of #36764 - jonathandturner:rollup, r=jonathandturnerbors-533/+365
Rollup of 14 pull requests - Successful merges: #36563, #36574, #36586, #36662, #36663, #36669, #36676, #36721, #36723, #36727, #36729, #36742, #36754, #36756 - Failed merges:
2016-09-26Rollup merge of #36727 - kallisti5:master, r=AatchJonathan Turner-0/+2
Haiku: Initial work at OS support These changes should be non-invasive to non-Haiku platforms. These patches were hand reworked from Neil's original Rust 1.9.0 patches. I've done some style cleanup and design updates along the way. There are a few small additional patches to libc, rust-installer and compiler-rt that will be submitted once this one is accepted. Haiku can be compiled on Linux, and a full gcc cross-compiler with a Haiku target is available, which means bootstrapping should be fairly easy. The patches here have already successfully bootstrapped under our haiku x86_gcc2 architecture. http://rust-on-haiku.com/wiki/PortingRust I'll be focusing on our more modern gcc5 x86 and x86 architectures for now. As for support, we're not seeking official support for now. We understand Haiku isn't a top-tier OS choice, however having these patches upstream greatly reduces the amount of patchwork we have to do. Mesa has Haiku code upstream, and we submit patches to keep it going. Mesa doesn't test on Haiku and we're ok with that :-)
2016-09-26Rollup merge of #36721 - TimNN:infinite-emptiness, r=nrcJonathan Turner-1/+38
reject macros with empty repetitions Fixes #5067 by checking the lhs of `macro_rules!` for repetitions which could match an empty token tree.
2016-09-26Rollup merge of #36669 - jseyfried:refactor_tok_result, r=nrcJonathan Turner-280/+103
Unify `TokResult` and `ResultAnyMacro` Fixes #36641. r? @nrc
2016-09-26Rollup merge of #36662 - jseyfried:parse_macro_invoc_paths, r=nrcJonathan Turner-252/+222
parser: support paths in bang macro invocations (e.g. `path::to::macro!()`) r? @nrc
2016-09-26Move `ensure_complete_parse` into `expand.rs`.Jeffrey Seyfried-14/+12
2016-09-26emit feature help in cheat modeTim Neumann-6/+5
2016-09-26make is_nightly_build a method on UnstableFeaturesTim Neumann-0/+7
2016-09-26add unstable_features to ParseSessTim Neumann-0/+21
2016-09-26make emit_feature_err take a ParseSessTim Neumann-13/+15
2016-09-26reject macros with empty repetitionsTim Neumann-1/+38
2016-09-26Refactor `ensure_complete_parse`.Jeffrey Seyfried-45/+31
2016-09-26Remove `TokResult`.Jeffrey Seyfried-161/+29
2016-09-26Refactor `parse_expansion` out of `ResultAnyMacro`.Jeffrey Seyfried-92/+63
2016-09-25Auto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrcbors-108/+45
Load macros from `#[macro_use]` extern crates in `resolve` r? @nrc
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-0/+2
* Hand rebased from Niels original work on 1.9.0
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-69/+13
2016-09-24Refactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an ↵Jeffrey Seyfried-40/+33
`ExtCtxt`.
2016-09-23ICH: Add ability to test the ICH of exported metadata items.Michael Woerister-0/+10
2016-09-23Fix indents.Jeffrey Seyfried-141/+131
2016-09-23Cleanup.Jeffrey Seyfried-40/+17
2016-09-23Parse paths in item, trait item, and impl item macro invocations.Jeffrey Seyfried-21/+6
2016-09-23Parse paths in statement and pattern macro invocations.Jeffrey Seyfried-31/+46
2016-09-22Auto merge of #36573 - jseyfried:groundwork, r=nrcbors-10/+13
resolve: groundwork for building the module graph during expansion r? @nrc
2016-09-22Auto merge of #36154 - nrc:proc-macro-init, r=@jseyfriedbors-32/+362
Adds a `ProcMacro` form of syntax extension This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too. Supports both attribute-like and function-like macros. Note that RFC #1566 has not been accepted yet, but I think there is consensus that we want to head in vaguely that direction and so this PR will be useful in any case. It is also fairly easy to undo and does not break any existing programs. This is related to #35957 in that I hope it can be used in the implementation of macros 1.1, however, there is no direct overlap and is more of a complement than a competing proposal. There is still a fair bit of work to do before the two can be combined. r? @jseyfried cc @alexcrichton, @cgswords, @eddyb, @aturon
2016-09-22Use `Resolver::visit_expansion` only with monotonic expansions.Jeffrey Seyfried-10/+13
2016-09-23reviewer comments and rebasingNick Cameron-135/+167
2016-09-22Rollup merge of #36539 - mikhail-m1:36530, r=jonathandturnerJonathan Turner-1/+1
fix top level attr spans issue #36530 ?r @jonathandturner
2016-09-22Auto merge of #36618 - jseyfried:crate_root_attr_invoc, r=nrcbors-7/+14
macros: allow attribute invocations at the crate root Fixes #36617. r? @nrc
2016-09-22Refactor out `parse_struct_expr`.Jeffrey Seyfried-45/+48
2016-09-21Auto merge of #36585 - jonathandturner:misc_error_touchups, r=nrcbors-0/+77
Add the ability to merge spans to codemap This PR adds the ability to merge Spans. To do so, it builds on the Codemap's ability to verify the locations of spans, namely that following can be verified: * the expn_id of both spans much match * the lhs span needs to end on the same line the rhs span begins * the lhs span must start at or before the rhs span If all of these are met, a new span is returned that is min(lo), max(hi) of the two spans. This PR also removes an older Span merge, as this new functionality subsumes it. r? @nrc
2016-09-22Adds a `ProcMacro` form of syntax extensionNick Cameron-18/+316
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too. Supports both attribute-like and function-like macros.
2016-09-21Allow attribute macro invocations at the crate root.Jeffrey Seyfried-7/+14
2016-09-20Check for overlapping and simplify unit testJonathan Turner-8/+3
2016-09-20serialize: allow specifying the default behavior for specializations.Eduard Burtescu-2/+12
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-11/+40
2016-09-19Add the ability to merge spans to codemapJonathan Turner-0/+82
2016-09-19Auto merge of #36471 - nnethercote:rm-to_binop, r=sanxiynbors-26/+1
Remove unused Token::to_binop function Just some dead code removal.
2016-09-18Auto merge of #36555 - jseyfried:issue_36540, r=eddybbors-58/+36
Visit and fold macro invocations in the same order Fixes #36540. r? @nrc
2016-09-18Auto merge of #36527 - nnethercote:last_token_kind, r=jseyfriedbors-43/+39
Optimize the parser's last token handling. The parser currently makes a heap copy of the last token in four cases: identifiers, paths, doc comments, and commas. The identifier and interpolation cases are unused, and for doc comments and commas we only need to record their presence, not their value. This commit consolidates the last token handling and avoids the unnecessary copies by replacing `last_token`, `last_token_eof`, and `last_token_interpolated` with a new field `last_token_kind`. This simplifies the parser slightly and speeds up parsing on some files by 3--4%.
2016-09-17Auto merge of #36502 - TimNN:correct-cancel, r=jseyfriedbors-5/+11
correctly cancel some errors Fixes #36499. I also (proactively) changed all other calls in `parser.rs` to use `Handler::cancel`.
2016-09-17Ensure that macro invocations are folded and visited the same order.Jeffrey Seyfried-58/+36
2016-09-17Auto merge of #36485 - nnethercote:char_lit-2, r=nagisabors-43/+28
Overhaul char_lit() This commit does the following. - Removes parsing support for '\X12', '\u123456' and '\U12345678' char literals. These are no longer valid Rust and rejected by the lexer. (This strange-sounding situation occurs because the parser rescans char literals to compute their value.) - Rearranges the function so that all the escaped values are handled in a single `match`. The error-handling strategy is based on the one used by byte_lit().
2016-09-16Auto merge of #36482 - jseyfried:dont_load_unconfigured_noninline_modules, r=nrcbors-10/+19
Avoid loading and parsing unconfigured non-inline modules. For example, `#[cfg(any())] mod foo;` will always compile after this PR, even if `foo.rs` and `foo/mod.rs` do not exist or do not contain valid Rust. Fixes #36478 and fixes #27873. r? @nrc
2016-09-16Auto merge of #36444 - jseyfried:macro_rules_ext, r=nrcbors-62/+58
Remove variant `MacroRulesTT` of `SyntaxExtension` r? @nrc
2016-09-16fix top level attr spansMikhail Modin-1/+1
2016-09-16Optimize the parser's last token handling.Nicholas Nethercote-43/+39
The parser currently makes a heap copy of the last token in four cases: identifiers, paths, doc comments, and commas. The identifier and interpolation cases are unused, and for doc comments and commas we only need to record their presence, not their value. This commit consolidates the last token handling and avoids the unnecessary copies by replacing `last_token`, `last_token_eof`, and `last_token_interpolated` with a new field `last_token_kind`. This simplifies the parser slightly and speeds up parsing on some files by 3--4%.