about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-09Remove redundant call to `expand_item_multi_modifier`Jeffrey Seyfried-3/+1
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
2016-03-27Type macro is tracked at rust-lang/rust#27245, not 27336NODA, Kai-1/+1
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-26syntax: Stop the bump loop for trait items at } and EOF.Eduard Burtescu-9/+17
2016-03-26syntax: Prevent bumping the parser EOF to stop infinite loops.Eduard Burtescu-0/+11
2016-03-26Rollup merge of #32435 - nrc:fix-err-recover, r=nikomatsakisManish Goregaokar-24/+71
Some fixes for error recovery in the compiler
2016-03-26Rollup merge of #32199 - nikomatsakis:limiting-constants-in-patterns-2, ↵Manish Goregaokar-7/+69
r=pnkfelix Restrict constants in patterns This implements [RFC 1445](https://github.com/rust-lang/rfcs/blob/master/text/1445-restrict-constants-in-patterns.md). The primary change is to limit the types of constants used in patterns to those that *derive* `Eq` (note that implementing `Eq` is not sufficient). This has two main effects: 1. Floating point constants are linted, and will eventually be disallowed. This is because floating point constants do not implement `Eq` but only `PartialEq`. This check replaces the existing special case code that aimed to detect the use of `NaN`. 2. Structs and enums must derive `Eq` to be usable within a match. This is a [breaking-change]: if you encounter a problem, you are most likely using a constant in an expression where the type of the constant is some struct that does not currently implement `Eq`. Something like the following: ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` The easiest and most future compatible fix is to annotate the type in question with `#[derive(Eq)]` (note that merely *implementing* `Eq` is not enough, it must be *derived*): ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` Another good option is to rewrite the match arm to use an `if` condition (this is also particularly good for floating point types, which implement `PartialEq` but not `Eq`): ```rust match foo { c if c == SOME_CONST => ... } ``` Finally, a third alternative is to tag the type with `#[structural_match]`; but this is not recommended, as the attribute is never expected to be stabilized. Please see RFC #1445 for more details. cc https://github.com/rust-lang/rust/issues/31434 r? @pnkfelix
2016-03-25unit-test symbol-names and item-pathsNiko Matsakis-0/+7
2016-03-25do not overwrite spans as eagerlyNiko Matsakis-6/+61
this was required to preserve the span from the #[structural_match] attribute -- but honestly I am not 100% sure if it makes sense.
2016-03-25modify #[deriving(Eq)] to emit #[structural_match]Niko Matsakis-1/+8
to careful use of the span from deriving, we can permit it in stable code if it derives from deriving (not-even-a-pun intended)
2016-03-24Rollup merge of #32459 - nrc:json-err-text, r=nikomatsakisSteve Klabnik-1/+39
Include source text in JSON errors
2016-03-24address nitsAlex Burka-3/+4