about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2015-02-22Fix errors from #22592Manish Goregaokar-4/+4
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-20/+20
where possible.
2015-02-20make span on obsolete syntax very preciseNiko Matsakis-1/+2
2015-02-18Round 3 test fixes and conflictsAlex Crichton-26/+25
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-76/+91
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-65/+66
2015-02-18Declare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism toNiko Matsakis-10/+25
support warnings.
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-4/+6
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18For now, accept the `i`, `u`, `is`, and `us` suffixes, but warn whenNiko Matsakis-11/+4
they are used without a feature-gate. This is both kinder to existing code and should make it easier to land this PR, since we don't have to catch EVERY SINGLE SUFFIX.
2015-02-18Modify parser to require `isize`/`usize` suffixes.Niko Matsakis-4/+13
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-1/+1
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-7/+6
2015-02-15Rollup merge of #22285 - kmcallister:pub-macro, r=nick29581Manish Goregaokar-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-15Rollup merge of #22339 - petrochenkov:int, r=huonwManish Goregaokar-1/+1
Some function signatures have changed, so this is a [breaking-change]. In particular, radixes and numerical values of digits are represented by `u32` now. Part of #22240
2015-02-15Fix the falloutVadim Petrochenkov-1/+1
2015-02-14Auto merge of #22158 - Kimundi:the_lonely_uppercase_keyword, r=pnkfelixbors-25/+59
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-13Forbid `pub mymacro!();`Keegan McAllister-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-12Made `Self` a keyword.Marvin Löbel-25/+59
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
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-09Accept quantification of lifetimes outside the self type in where clauses.Nick Cameron-5/+28
Closes #20022
2015-02-07Auto merge of #21505 - GuillaumeGomez:interned_string, r=alexcrichtonbors-13/+8
It's in order to make the code more homogeneous.
2015-02-06librustdoc has been updatedGuillaumeGomez-4/+4
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-06Update to last version, remove "[]" as much as possibleGuillaumeGomez-1/+1
2015-02-06Libsyntax has been updatedGuillaumeGomez-5/+4
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-17/+5
2015-02-06Add Str trait to InternedString, set get method deprecatedGuillaumeGomez-0/+8
2015-02-06Rollup merge of #21954 - jbcrail:fix-misspelled-comments, r=steveklabnikManish Goregaokar-1/+1
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-2/+2
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-19/+14
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-05make codemap more robust in face of ill-formed spans.Felix S. Klock II-2/+2
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-11/+11
2015-02-04Fix for misspelled comments.Joseph Crail-1/+1
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-5/+5
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-03rollup merge of #21899: nikomatsakis/closure-unify-anyhowAlex Crichton-29/+38
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-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-03Update for new snapshot after rebasing.Niko Matsakis-1/+1
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-29/+38
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-02-02rollup merge of #21845: Potpourri/import-syntaxAlex Crichton-3/+8
syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
2015-02-02rollup merge of #21842: alexcrichton/issue-21839Alex Crichton-2/+2
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-7/+7
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21825: kmcallister/ttdelim-spanAlex Crichton-1/+24
2015-02-02rollup merge of #21710: alfie/libsyntaxAlex Crichton-29/+29
Conflicts: src/libsyntax/parse/parser.rs
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-1/+1
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-6/+6