about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-179/+107
2016-04-24syntax: Don't rely on token::IdentStyle in the parserVadim Petrochenkov-131/+53
2016-04-21pacify the merciless acrichto (somewhat)Niko Matsakis-8/+6
Also add a comment or two to pacify the merciless self-critic, who hates a closure without a comment.
2016-04-21port compiletest to use JSON outputNiko Matsakis-122/+226
This uncovered a lot of bugs in compiletest and also some shortcomings of our existing JSON output. We had to add information to the JSON output, such as suggested text and macro backtraces. We also had to fix various bugs in the existing tests. Joint work with jntrnr.
2016-04-17Rollup merge of #33044 - petrochenkov:prefix, r=eddybManish Goregaokar-111/+63
syntax: Parse import prefixes as paths Fixes https://github.com/rust-lang/rust/issues/10415 r? @eddyb (This partially intersects with https://github.com/rust-lang/rust/pull/33041)
2016-04-16Auto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichtonbors-7/+0
Remove unused trait imports
2016-04-17syntax: Parse import prefixes as pathsVadim Petrochenkov-111/+63
2016-04-16Auto merge of #32875 - jseyfried:1422_implementation, r=nikomatsakisbors-23/+50
Implement `pub(restricted)` privacy (RFC 1422) This implements `pub(restricted)` privacy from RFC 1422 (cc #32409) behind a feature gate. `pub(restricted)` paths currently cannot use re-exported modules both for simplicity of implementation and for future compatibility with RFC 1560 (cf #31783). r? @nikomatsakis
2016-04-16Rollup merge of #32945 - durka:rfc1494, r=pnkfelixManish Goregaokar-0/+1
implement RFC amendment 1494 Adds `:block` to the follow set for `:ty` and `:path`. See rust-lang/rfcs#1494.
2016-04-16Rollup merge of #32929 - LeoTestard:featureck-comment, r=GuillaumeGomezManish Goregaokar-2/+2
Update a comment to reflect changes in tidy checks.
2016-04-16Rollup merge of #32923 - jseyfried:fix_hygiene, r=nrcManish Goregaokar-8/+9
Fix macro hygiene bug This fixes #32922 (EDIT: and fixes #31856), macro hygiene bugs. It is a [breaking-change]. For example, the following would break: ```rust fn main() { let x = true; macro_rules! foo { () => { let x = 0; macro_rules! bar { () => {x} } let _: bool = bar!(); //^ `bar!()` used to resolve the first `x` (a bool), //| but will now resolve to the second x (an i32). }} foo! {}; } ``` r? @nrc
2016-04-14Improve message for raw pointer missing mut and constDavid Tolnay-2/+2
"Bare raw pointer" does not exist as a concept.
2016-04-14Feature gate `pub(restricted)`Jeffrey Seyfried-0/+15
2016-04-14Parse `pub(restricted)`Jeffrey Seyfried-16/+25
2016-04-14Visit visibilities in the ast visitor's `walk_*` functionsJeffrey Seyfried-4/+7
2016-04-14Add a span to the `Crate` variant of `ast::Visibility`Jeffrey Seyfried-3/+3
2016-04-13implement RFC amendment 1494Alex Burka-0/+1
2016-04-13Update a comment to reflect changes in tidy checks.Leo Testard-2/+2
2016-04-13Fixes #32922, a macro hygiene bugJeffrey Seyfried-8/+9
2016-04-12Bare raw pointers have been disallowed foreverDavid Tolnay-3/+2
This change was in 0.12.0, a year and a half ago. Let's move on!
2016-04-12Remove unused trait importsSeo Sanghyeon-7/+0
2016-04-12Auto merge of #32804 - alexcrichton:stabilize-1.9, r=brsonbors-7/+8
std: Stabilize APIs for the 1.9 release This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-11Auto merge of #32711 - marcusklaas:try-shorthand-span-fix, r=nagisabors-1/+1
Fix the span for try shorthand expressions My five character contribution to the rust parser! Fixes https://github.com/rust-lang/rust/issues/32709.
2016-04-11Fix the span for try shorthand expressionsMarcus Klaas-1/+1
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-7/+8
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-10Auto merge of #32806 - brson:fix-features, r=alexcrichtonbors-2/+2
Set the version number for stabilization of braced_empty_structs and augmented_assignment to 1.8.0. Per the comments, the numbers in this table reflect the "current status". cc @rust-lang/libs @rust-lang/lang Discovered this while hunting for 1.8 features. I'm afraid there may be more of these that are incorrect and we may have created a mess.
2016-04-07Set the version number for stabilization of braced_empty_structsBrian Anderson-2/+2
and augmented_assignment to 1.8.0. Per the comments, the numbers in this table reflect the "current status".
2016-04-07Auto merge of #32016 - nikomatsakis:incr-comp-save, r=mwbors-0/+8
Save/load incremental compilation dep graph Contains the code to serialize/deserialize the dep graph to disk between executions. We also hash the item contents and compare to the new hashes. Also includes a unit test harness. There are definitely some known limitations, such as https://github.com/rust-lang/rust/issues/32014 and https://github.com/rust-lang/rust/issues/32015, but I am leaving those for follow-up work. Note that this PR builds on https://github.com/rust-lang/rust/pull/32007, so the overlapping commits can be excluded from review. r? @michaelwoerister
2016-04-06Rollup merge of #32727 - matklad:fix-comment, r=alexcrichtonSteve Klabnik-6/+6
minor: update old comments No more lifetimes in function types after https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f
2016-04-06add code to persist graph and for unit-testingNiko Matsakis-0/+8
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-416/+38
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06Move span into `StructField`Vadim Petrochenkov-34/+35
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-72/+26
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-422/+38
2016-04-05Auto merge of #32688 - jseyfried:ast_groundwork_for_1422, r=pnkfelixbors-64/+86
[breaking-batch] Add support for `pub(restricted)` syntax in the AST This PR allows the AST to represent the `pub(restricted)` syntax from RFC 1422 (cc #32409). More specifically, it makes `ast::Visibility` non-`Copy` and adds two new variants, `Visibility::Crate` for `pub(crate)` and `Visitibility::Restricted { path: P<Path>, id: NodeId }` for `pub(path)`. plugin-[breaking-change] cc #31645 r? @pnkfelix
2016-04-05Rollup merge of #32714 - nrc:json-err-end-span, r=sfacklerManish Goregaokar-15/+60
JSON errors: give better spans for SpanEnd errors
2016-04-05Fixes bug which accepting using `super` in use statemet.vlastachu-6/+6
Issue: #32225
2016-04-04minor: update old commentsAleksey Kladov-6/+6
No more lifetimes in function types after https://github.com/rust-lang/rust/commit/f945190e6352a1bc965a117569532643319b400f
2016-04-04Give better spans for SpanEnd errorsNick Cameron-15/+60
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-7/+38
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-48/+48
2016-04-02Remove `ast::Visibility::inherit_from` (it is unused and has obsolete semantics)Jeffrey Seyfried-9/+0
2016-04-01Auto merge of #32544 - alexcrichton:rustbuild-dist-libtest, r=brsonbors-1/+0
rustbuild: Fix dist for non-host targets The `rust-std` package that we produce is expected to have not only the standard library but also libtest for compiling unit tests. Unfortunately this does not currently happen due to the way rustbuild is structured. There are currently two main stages of compilation in rustbuild, one for the standard library and one for the compiler. This is primarily done to allow us to fill in the sysroot right after the standard library has finished compiling to continue compiling the rest of the crates. Consequently the entire compiler does not have to explicitly depend on the standard library, and this also should allow us to pull in crates.io dependencies into the build in the future because they'll just naturally build against the std we just produced. These phases, however, do not represent a cross-compiled build. Target-only builds also require libtest, and libtest is currently part of the all-encompassing "compiler build". There's unfortunately no way to learn about just libtest and its dependencies (in a great and robust fashion) so to ensure that we can copy the right artifacts over this commit introduces a new build step, libtest. The new libtest build step has documentation, dist, and link steps as std/rustc already do. The compiler now depends on libtest instead of libstd, and all compiler crates can now assume that test and its dependencies are implicitly part of the sysroot (hence explicit dependencies being removed). This makes the build a tad less parallel as in theory many rustc crates can be compiled in parallel with libtest, but this likely isn't where we really need parallelism either (all the time is still spent in the compiler). All in all this allows the `dist-std` step to depend on both libstd and libtest, so `rust-std` packages produced by rustbuild should start having both the standard library and libtest. Closes #32523
2016-04-01rustbuild: Fix dist for non-host targetsAlex Crichton-1/+0
The `rust-std` package that we produce is expected to have not only the standard library but also libtest for compiling unit tests. Unfortunately this does not currently happen due to the way rustbuild is structured. There are currently two main stages of compilation in rustbuild, one for the standard library and one for the compiler. This is primarily done to allow us to fill in the sysroot right after the standard library has finished compiling to continue compiling the rest of the crates. Consequently the entire compiler does not have to explicitly depend on the standard library, and this also should allow us to pull in crates.io dependencies into the build in the future because they'll just naturally build against the std we just produced. These phases, however, do not represent a cross-compiled build. Target-only builds also require libtest, and libtest is currently part of the all-encompassing "compiler build". There's unfortunately no way to learn about just libtest and its dependencies (in a great and robust fashion) so to ensure that we can copy the right artifacts over this commit introduces a new build step, libtest. The new libtest build step has documentation, dist, and link steps as std/rustc already do. The compiler now depends on libtest instead of libstd, and all compiler crates can now assume that test and its dependencies are implicitly part of the sysroot (hence explicit dependencies being removed). This makes the build a tad less parallel as in theory many rustc crates can be compiled in parallel with libtest, but this likely isn't where we really need parallelism either (all the time is still spent in the compiler). All in all this allows the `dist-std` step to depend on both libstd and libtest, so `rust-std` packages produced by rustbuild should start having both the standard library and libtest. Closes #32523
2016-03-31Auto merge of #32506 - petrochenkov:use, r=Manishearthbors-12/+6
syntax: Extra diagnostics for `_` used in an identifier position Closes https://github.com/rust-lang/rust/issues/32501
2016-03-31syntax: Extra diagnostics for `_` used in an identifier positionVadim Petrochenkov-12/+6
2016-03-31Rollup merge of #32494 - pnkfelix:gate-parser-recovery-via-debugflag, r=nrcManish Goregaokar-0/+9
Gate parser recovery via debugflag Gate parser recovery via debugflag Put in `-Z continue_parse_after_error` This works by adding a method, `fn abort_if_no_parse_recovery`, to the diagnostic handler in `syntax::errors`, and calling it after each error is emitted in the parser. (We might consider adding a debugflag to do such aborts in other places where we are currently attempting recovery, such as resolve, but I think the parser is the really important case to handle in the face of #31994 and the parser bugs of varying degrees that were injected by parse error recovery.) r? @nikomatsakis
2016-03-30Put in `-Z continue-parse-after-error`Felix S. Klock II-0/+9
This works by adding a boolean flag, `continue_after_error`, to `syntax::errors::Handler` that can be imperatively set to `true` or `false` via a new `fn set_continue_after_error`. The flag starts off true (since we generally try to recover from compiler errors, and `Handler` is shared across all phases). Then, during the `phase_1_parse_input`, we consult the setting of the `-Z continue-parse-after-error` debug flag to determine whether we should leave the flag set to `true` or should change it to `false`. ---- (We might consider adding a debugflag to do such aborts in other places where we are currently attempting recovery, such as resolve, but I think the parser is the really important case to handle in the face of #31994 and the parser bugs of varying degrees that were injected by parse error recovery.)
2016-03-28Auto merge of #32479 - eddyb:eof-not-even-twice, r=nikomatsakisbors-9/+28
Prevent bumping the parser past the EOF. Makes `Parser::bump` after EOF into an ICE, forcing callers to avoid repeated EOF bumps. This ICE is intended to break infinite loops where EOF wasn't stopping the loop. For example, the handling of EOF in `parse_trait_items`' recovery loop fixes #32446. But even without this specific fix, the ICE is triggered, which helps diagnosis and UX. This is a `[breaking-change]` for plugins authors who eagerly eat multiple EOFs. See https://github.com/docopt/docopt.rs/pull/171 for such an example and the necessary fix.
2016-03-28Auto merge of #32267 - durka:inclusive-range-error, r=nrcbors-29/+44
melt the ICE when lowering an impossible range Emit a fatal error instead of panicking when HIR lowering encounters a range with no `end` point. This involved adding a method to wire up `LoweringContext::span_fatal`. Fixes #32245 (cc @nodakai). r? @nrc