about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2016-04-24syntax: Merge keywords and remaining special idents in one listVadim Petrochenkov-10/+8
Simplify the macro used for generation of keywords Make `Keyword::ident` private
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-8/+8
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-2/+2
2016-04-22Remove the MacroVisitor pass.Leo Testard-30/+64
This pass was supposed to check use of gated features before `#[cfg]`-stripping but this was not the case since it in fact happens after. Checks that are actually important and must be done before macro expansion are now made where the features are actually used. Close #32648. Also ensure that attributes on macro-generated macro invocations are checked as well. Close #32782 and #32655.
2016-04-14Auto merge of #32908 - oli-obk:hygienic_derive_encodable, r=alexcrichtonbors-7/+10
prevent other `encode` methods from breaking `derive(RustcEncodable)` fixes https://github.com/rust-lang-nursery/rustc-serialize/issues/151
2016-04-12prevent other `encode` methods from breaking `derive(RustcEncodable)`Oliver Schneider-7/+10
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-6/+6
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-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-3/+1
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06Move span into `StructField`Vadim Petrochenkov-4/+4
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-44/+11
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-3/+1
2016-03-27deriving: factor out discriminant_value constructionAlex Burka-37/+33
2016-03-27fix #21714 by using discriminant_value in #[derive(Hash)]Alex Burka-9/+12
This is the same approach taken in #24270, except that this should not be a breaking change because it only changes the output of hash functions, which nobody should be relying on.
2016-03-25fix cargo.toml for new dependencyNiko Matsakis-0/+1
2016-03-25check for both partialeq and eqNiko Matsakis-36/+45
2016-03-25modify #[deriving(Eq)] to emit #[structural_match]Niko Matsakis-2/+47
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-21Auto merge of #32253 - durka:derive-31886, r=alexcrichtonbors-1/+1
derive: assume enum repr defaults to isize derive: assume enum repr defaults to isize Fixes #31886. Spawned from #32139. r? @alexcrichton
2016-03-18Auto merge of #31977 - bluss:partial-eq-save, r=brsonbors-11/+43
derive: Avoid emitting provided PartialEq, PartialOrd methods for c-like enums derive: Avoid emitting provided PartialEq, PartialOrd method for c-like enums `ne` is completely symmetrical with the method `eq`, and we can save rust code size and compilation time here if we only emit one of them when possible. One case where it's easy to recognize is when it's a C-like enum. Most other cases can not omit ne, because any value field may have a custom PartialEq implementation.
2016-03-18derive: assume enum repr defaults to isizeAlex Burka-1/+1
It was originally intended to be i32, but it isn't. Fixes #31886.
2016-03-17Re-add double underscores in derive (fixes #32292)Manish Goregaokar-43/+43
2016-03-15Auto merge of #32251 - durka:derive-2810, r=alexcrichtonbors-114/+136
derive: clean up hygiene derive: clean up hygiene Fixes #2810. Spawned from #32139. r? @alexcrichton
2016-03-15Auto merge of #32250 - durka:derive-31574, r=alexcrichtonbors-11/+18
derive: use intrinsics::unreachable over unreachable!() derive: use intrinsics::unreachable over unreachable!() Fixes #31574. Spawned from #32139. r? @alexcrichton
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-0/+2
2016-03-14derive: improve hygiene for type parameters (see #2810)Alex Burka-17/+46
When deriving Hash, RustcEncodable and RustcDecodable, the syntax extension needs a type parameter to use in the inner method. They used to use __H, __S and __D respectively. If this conflicts with a type parameter already declared for the item, bad times result (see the test). There is no hygiene for type parameters, but this commit introduces a better heuristic by concatenating the names of all extant type parameters (and prepending __H).
2016-03-14derive: remove most __ strings FIXME(#2810)Alex Burka-48/+48
This changes local variable names in all derives to remove leading double-underscores. As far as I can tell, this doesn't break anything because there is no user code in these generated functions except for struct, field and type parameter names, and this doesn't cause shadowing of those. But I am still a bit nervous.
2016-03-14fix FIXME(#6449) in #[derive(PartialOrd, Ord)]Alex Burka-55/+48
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
2016-03-14derive: emit intrinsics::unreachable for impls on empty enumsAlex Burka-11/+18
fixes #31574
2016-03-01derive: Emit only PartialOrd::partial_cmp for simple enumsUlrik Sverdrup-24/+35
Using the same logic as for `PartialEq`, when possible define only `partial_cmp` and leave `lt, le, gt, ge` to their default implementations. This works well for c-like enums.
2016-02-29derive: Skip PartialEq::ne for any zero-field enum or structUlrik Sverdrup-17/+15
Also detect unit structs and enums with zero field struct variants.
2016-02-29derive: Avoid emitting PartialEq::ne for c-like enumsUlrik Sverdrup-5/+28
`ne` is completely symmetrical with the method `eq`, and we can save rust code size and compilation time here if we only emit one of them when possible. One case where it's easy to recognize is when it's a C-like enum. Most other cases can not omit ne, because any value field may have a custom PartialEq implementation.
2016-02-23Some refactoring in deriving/debug.rsVadim Petrochenkov-8/+3
2016-02-22Fix #[derive] for empty structs with bracesVadim Petrochenkov-37/+49
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-3/+3
2016-02-12Use more autoderef in libsyntax_extJonas Schievink-2/+2
2016-02-12Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearthbors-13/+13
cc #31487 plugin-[breaking-change] The AST part of https://github.com/rust-lang/rust/pull/30087 r? @Manishearth
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-13/+13
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+13
These describe the structure of all our crate dependencies.
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-3/+2
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-19/+22
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-9/+9
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-14/+14
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] remove the sign from integer literals in the astOliver Schneider-6/+2
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-11/+11
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-17/+15
2016-02-11[breaking-change] don't glob export ast::ExplicitSelf_ variantsOliver Schneider-4/+4