about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-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-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-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.
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-60/+50
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-04Compute widths properly when displaying spans in error messagesP1start-23/+58
Closes #8706.
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-151/+149
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 #21817: edwardw/symmetric-binopAlex Crichton-0/+14
For "symmetric" binary operators, meaning the types of two sides must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634
2015-02-02rollup merge of #21787: alexcrichton/std-envAlex Crichton-8/+8
Conflicts: src/libstd/sys/unix/backtrace.rs src/libstd/sys/unix/os.rs
2015-02-02rollup merge of #21754: semarie/openbsd-rebasedAlex Crichton-2/+4
Hi. Here a commit in order to add OpenBSD support to rust. - tests status: run-pass: test result: ok. 1879 passed; 0 failed; 24 ignored; 0 measured run-fail: test result: ok. 81 passed; 0 failed; 5 ignored; 0 measured compile-fail: test result: ok. 1634 passed; 0 failed; 22 ignored; 0 measured run-pass-fulldeps: test result: ok. 22 passed; 0 failed; 1 ignored; 0 measured compile-fail-fulldeps: test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured - The current implementation of load_self function (src/libstd/sys/unix/os.rs) isn't optimal as under OpenBSD I haven't found a reliable method to get the filename of a running process. The current implementation is enought for bootstrapping purpose. - I have disable `run-pass/tcp-stress.rs` test under openbsd. When run manually, the test pass, but when run under `compiletest`, it timeout and echo continuoulsy `Too many open files`. - For building with jemalloc, a more recent version of jemalloc would be mandatory. See https://github.com/jemalloc/jemalloc/pull/188 for more details.
2015-02-02rollup merge of #21710: alfie/libsyntaxAlex Crichton-142/+142
Conflicts: src/libsyntax/parse/parser.rs
2015-02-02remove unused mut qualifiersJorge Aparicio-4/+2
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-6/+6
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-3/+3
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-138/+138
2015-02-02Omit integer suffix when unnecessaryAlfie John-142/+142
See PR # 21378 for context
2015-02-02Tweak some ‘expected…’ error messagesP1start-60/+68
Fixes #21153.
2015-02-01std: Remove extra type params on iter adaptorsAlex 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-01Reject syntax like `use foo::bar::;` and `use foo:: as bar;` and keywords in ↵Potpourri-3/+8
view path idents