about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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.
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-0/+4
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-03rollup merge of #21910: Manishearth/missing_stabilityAlex Crichton-0/+6
Currently, if a `#![staged_api]` crate contains an exported item without a stability marker (or inherited stability), the item is useless. This change introduces a check to ensure that all exported items have a defined stability. it also introduces the `unmarked_api` feature, which lets users import unmarked features. While this PR should in theory forbid these from existing, in practice we can't be so sure; so this lets users bypass this check instead of having to wait for the library and/or compiler to be fixed (since otherwise this is a hard error). r? @aturon
2015-02-03rollup merge of #21899: nikomatsakis/closure-unify-anyhowAlex Crichton-61/+51
This *almost* completes the job for #16440. The idea is that even if we do not know whether some closure type `C` implements `Fn` or `FnMut` (etc), we still know its argument and return types. So if we see an obligation `C : Fn(_0)`, we can unify `_0` with those argument types while still considering the obligation ambiguous and unsatisfied. This helps to make a lot of progress with type inference even before closure kind inference is done. As part of this PR, the explicit `:` syntax is removed from the AST and completely ignored. We still infer the closure kind based on the expected type if that is available. There are several reasons for this. First, deciding the closure kind earlier is always better, as it allows us to make more progress. Second, this retains a (admittedly obscure) way for users to manually specify the closure kind, which is useful for writing tests if nothing else. Finally, there are still some cases where inference can fail, so it may be useful to have this manual override. (The expectation is that we will eventually revisit an explicit syntax for specifying the closure kind, but it will not be `:` and may be some sort of generalization of the `||` syntax to handle other traits as well.) This commit does not *quite* fix #16640 because a snapshot is still needed to enable the obsolete syntax errors for explicit `&mut:` and friends. r? @eddyb as he reviewed the prior patch in this direction
2015-02-04Replace `be` with `become`Andrea Canciani-1/+1
As per rust-lang/rfcs#601, replace `be` with `become` as reserved keyword for tail call optimization.
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+4
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-03Rename std::path to std::old_pathAaron Turon-1/+1
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]
2015-02-04Add unmarked_api feature (fixes #21884)Manish Goregaokar-0/+6
2015-02-03Update for new snapshot after rebasing.Niko Matsakis-1/+1
2015-02-03Correct one case where the inference was detecting a looser result than theNiko Matsakis-1/+1
explicit annotation, leading to "extra `mut` declaration" lint errors.