about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-02-10rollup merge of #22116: kmcallister/cfg_attrAlex Crichton-54/+68
Fixes #22070. Fixes #19372. r? @sfackler
2015-02-10rollup merge of #22103: pczarn/fix-ice-22091Alex Crichton-2/+9
Fixes #22091 I'm not sure how to write a test for this. An ICE happens with spans that start near (after?) a null character or some other zero-width unicode character.
2015-02-10rollup merge of #22094: alkor/cleanup-show-stringAlex Crichton-1/+0
Rename several remaining `Show`s to Debug, `String`s to Display (mostly in comments and docs). Update reference.md: - derive() no longer supports Zero trait - derive() now supports Copy trait
2015-02-10rollup merge of #21943: hugwijst/extctxt_ufcsAlex Crichton-0/+56
Add `QPath` construction support to `ExtCtxt`. Allows compiler plugins to generate calls with UFCS.
2015-02-10rollup merge of #21918: ranma42/replace-beAlex Crichton-1/+1
Conflicts: src/test/compile-fail/reserved-be.rs src/test/compile-fail/reserved-become.rs src/test/parse-fail/reserved-be.rs
2015-02-10Auto merge of #22026 - kmcallister:plugin, r=sfacklerbors-5/+5
```rust #[plugin] #[no_link] extern crate bleh; ``` becomes a crate attribute ```rust #![plugin(bleh)] ``` The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-02-10Auto merge of #21961 - nick29581:hrl-syntax, r=nmatsakisbors-15/+52
Closes # 20022 r? @nikomatsakis
2015-02-10TestsNick Cameron-4/+10
2015-02-09Use a crate attribute to load pluginsKeegan McAllister-5/+5
#[plugin] #[no_link] extern crate bleh; becomes a crate attribute #![plugin(bleh)] The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-02-09Process cfg_attr right before stripping cfgKeegan McAllister-38/+48
Fixes #22070. Fixes #19372.
2015-02-09syntax::fold: Allow removing attributesKeegan McAllister-16/+20
2015-02-09Refactor compilation to make it easier to use for toolsNick Cameron-0/+1
2015-02-08syntax: Fix integer underflow in diagnosticPiotr Czarnecki-2/+9
Fixes #22091
2015-02-09Accept quantification of lifetimes outside the self type in where clauses.Nick Cameron-11/+42
Closes #20022
2015-02-08Rename Show to Debug, String to DisplayAlexander Korolkov-1/+0
Update reference.md: - derive() no longer supports Zero trait - derive() now supports Copy trait
2015-02-08Auto merge of #22054 - LeoTestard:include-parse-errors, r=alexcrichtonbors-2/+6
Makes the compilation abort when a parse error is encountered while trying to parse an item in an included file. The previous behaviour was to stop processing the file when a token that can't start an item was encountered, without producing any error. Fixes #21146.
2015-02-08Auto merge of #21988 - kmcallister:no-std, r=sfacklerbors-78/+163
Fixes #21833. [breaking-change] r? @alexcrichton The tests in #21912 will also need `#[feature(no_std)]`. If you're okay with both PRs, I can merge and test them.
2015-02-07Fake up #![no_std] on pretty-printing; keep it out of ASTKeegan McAllister-14/+22
2015-02-07Feature-gate #![no_std]Keegan McAllister-1/+9
Fixes #21833. [breaking-change]
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-55/+114
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-28/+38
2015-02-07Auto merge of #21984 - pnkfelix:make-for-loops-a-terminating-scope, ↵bors-8/+20
r=nikomatsakis make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR. In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer. ---- There is one case I know of that this breaks, demonstrated to me by @nikomatsakis (but it is also a corner-case that is useless in practice). Here is that case: ``` fn main() { let mut foo: Vec<&i8> = Vec::new(); for i in &[1, 2, 3] { foo.push(i) } } ``` Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.) (The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.) ---- So, technically this is a: [breaking-change]
2015-02-07Fix handling of parse errors when using `include!()`.Leo Testard-2/+6
Makes the compilation abort when a parse error is encountered while trying to parse an item in an included file. The previous behaviour was to stop processing the file when a token that can't start an item was encountered, without producing any error. Fixes #21146.
2015-02-07Fix libsyntax so we can bootstrap even with move out of array restriction.Felix S. Klock II-2/+2
2015-02-07Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichtonbors-105/+103
It's in order to make the code more homogeneous.
2015-02-06librustdoc has been updatedGuillaumeGomez-7/+7
Fixes run build error Fix test failure Fix tests' errors
2015-02-07Rollup merge of #22005 - nagisa:obsolete-ctx, r=alexcrichtonManish Goregaokar-3/+3
The word is repeated twice in the message like: error: obsolete syntax: `:`, `&mut:`, or `&:` syntax This removes the word syntax that appears in messages after the second colon (:).
2015-02-06Remove word syntax from obsolete syntax messagesSimonas Kazlauskas-3/+3
The word is repeated twice in the message like error: obsolete syntax: `:`, `&mut:`, or `&:` syntax This removes the word syntax that appears in messages after the second colon (:).
2015-02-06Fix infinite loop errorGuillaumeGomez-1/+1
2015-02-06Remove getenv warningGuillaumeGomez-4/+3
2015-02-06Update to last version, remove "[]" as much as possibleGuillaumeGomez-46/+46
2015-02-06Libsyntax has been updatedGuillaumeGomez-118/+90
2015-02-06Update HEAD:masterGuillaumeGomez-1/+1
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-104/+123
2015-02-06Add Str trait to InternedString, set get method deprecatedGuillaumeGomez-0/+8
2015-02-06Rollup merge of #21958 - brson:stable-features, r=alexcrichtonManish Goregaokar-5/+10
.... The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features' lint, which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
2015-02-06Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnikManish Goregaokar-2/+2
The spelling corrections were made in both documentation comments and regular comments.
2015-02-06Rollup merge of #21980 - pnkfelix:more-robust-span-to-snippet, r=huonwManish Goregaokar-10/+48
This can be considered partial work on #8256. The main observable change: macro expansion sometimes results in spans where `lo > hi`; so for now, when we have such a span, do not attempt to return a snippet result. (Longer term, we might think about whether we could still present a snippet for the cases where this arises, e.g. perhaps by showing the whole macro as the snippet, assuming that is the sole cause of such spans; or by somehow looking up the closest AST node that holds both `lo` and `hi`, and showing that.) As a drive-by, revised the API to return a `Result` rather than an `Option`, with better information-packed error value that should help us (and maybe also our users) identify the causes of such problems in the future. Ideally the call-sites that really want an actual snippet would be updated to catch the newly added `Err` case and print something meaningful about it, but that is not part of this PR.
2015-02-06Auto merge of #21947 - bluss:full-range-syntax, r=brsonbors-22/+15
Implement step 1 of rust-lang/rfcs#702 Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-06make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR.Felix S. Klock II-8/+20
In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer. ---- There is one case I know of that this breaks, demonstrated to me by niko (but it is also a corner-case that is useless in practice). Here is that case: ``` fn main() { let mut foo: Vec<&i8> = Vec::new(); for i in &[1, 2, 3] { foo.push(i) } } ``` Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.) (The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.) ---- So, technically this is a: [breaking-change]
2015-02-05make codemap more robust in face of ill-formed spans.Felix S. Klock II-10/+48
This can be considered partial work on #8256. The main observable change: macro expansion sometimes results in spans where `lo > hi`; so for now, when we have such a span, do not attempt to return a snippet result. (Longer term, we might think about whether we could still present a snippet for the cases where this arises, e.g. perhaps by showing the whole macro as the snippet, assuming that is the sole cause of such spans; or by somehow looking up the closest AST node that holds both `lo` and `hi`, and showing that.) As a drive-by, revised the API to return a `Result` rather than an `Option`, with better information-packed error value that should help us (and maybe also our users) identify the causes of such problems in the future. Ideally the call-sites that really want an actual snippet would be updated to catch the newly added `Err` case and print something meaningful about it, but that is not part of this PR.
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-62/+62
2015-02-05Implement pretty-printing of `..` and update tests.Ulrik Sverdrup-3/+1
Update tests to change all `&expr[]` to `&expr[..]` to make sure pretty printing passes.
2015-02-04Add a lint for writing `#[feature]` for stable features, warn by default.Brian Anderson-5/+10
The 'stable_features' lint helps people progress from unstable to stable Rust by telling them when they no longer need a `feature` attribute because upstream Rust has declared it stable. This compares to the existing 'unstable_features', which is used to implement feature staging, and triggers on *any* use of `#[feature]`.
2015-02-04Fix for misspelled comments.Joseph Crail-2/+2
The spelling corrections were made in both documentation comments and regular comments.
2015-02-04register snapshotsJorge Aparicio-5/+3
2015-02-04remove all kind annotations from closuresJorge Aparicio-23/+23
2015-02-04Implement `..` syntax for RangeFull as expressionUlrik Sverdrup-19/+14
Allows the expression `..` (without either endpoint) in general, can be used in slicing syntax `&expr[..]` where we previously wrote `&expr[]`. The old syntax &expr[] is not yet removed or warned for.
2015-02-04Add QPath construction to ExtCtxt for UFCS support.Hugo van der Wijst-0/+56
2015-02-04Auto merge of #21499 - P1start:issue-8706, r=huonwbors-23/+58
Closes #8706.