about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-10-27Fix prefix range expressions being not parsedSimonas Kazlauskas-74/+77
2015-10-27Generalise associative operator parsingSimonas Kazlauskas-157/+332
This commit generalises parsing of associative operators from left-associative only (with some ugly hacks to support right-associative assignment) to properly left/right-associative operators. Parsing still is not general enough to handle non-associative, non-highest-precedence prefix or non-highest-precedence postfix operators (e.g. `..` range syntax), though. That should be fixed in the future. Lastly, this commit adds support for parsing right-associative `<-` (left arrow) operator with precedence higher than assignment as the operator for placement-in feature.
2015-10-26Auto merge of #29274 - thepowersgang:issues-29107-const-unsafe-fn-order, ↵bors-11/+16
r=nikomatsakis This PR switches the implemented ordering from `unsafe const fn` (as was in the original RFC) to `const unsafe fn` (which is what the lang team decided on)
2015-10-26Auto merge of #29287 - Ryman:fn_nopat, r=alexcrichtonbors-15/+13
Previously, if you copied a signature from a trait definition such as: ```rust fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-26Auto merge of #29303 - petrochenkov:unistrimp, r=eddybbors-73/+47
And use `VariantData` instead of `P<VariantData>` in `Item_` and `Variant_` Improvements suggested by @eddyb in https://github.com/rust-lang/rust/pull/28816#discussion_r42483587 and https://github.com/rust-lang/rust/pull/28816#discussion_r42483648 plugin-[breaking-change] r? @eddyb
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-4/+1
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-73/+47
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-11/+16
2015-10-25rustc_privacy: Expand public node set, build exported node set more correctlyVadim Petrochenkov-0/+6
2015-10-25libsyntax: Consolidate branch to benefit from exhaustive checking instead of ↵Kevin Butler-6/+6
unwrapping
2015-10-25libsyntax: remove panics from Parser::parse_pat_nopanicKevin Butler-9/+3
2015-10-25libsyntax: better error for lifetimes in patternsKevin Butler-0/+4
Previously, if you copied a signature from a trait definition such as: ``` fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-23Auto merge of #29242 - matklad:fix-comment, r=alexcrichtonbors-2/+15
Qualified paths allow full path after the `>::`. For example ```rust <T as Foo>::U::generic_method::<f64>() ``` The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-23parser: fix erroneous commentAleksey Kladov-2/+15
Qualified paths allow full path after the `>::`. For example ```rust <T as Foo>::U::generic_method::<f64>() ``` The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-20Auto merge of #29148 - petrochenkov:noshow, r=alexcrichtonbors-5/+3
Closes https://github.com/rust-lang/rust/issues/29145 [breaking-change], needs a crater run.
2015-10-20Auto merge of #29152 - petrochenkov:derstab, r=alexcrichtonbors-1/+1
The attributes are copied from the item for which the trait impl is derived I think now we can close these two issues: https://github.com/rust-lang/rust/issues/13054 - `allow`, `deny` etc. were already copied, now `stable` and `unstable` are copied as well. https://github.com/rust-lang/rust/issues/18969 - I'm not sure this is needed, insta-stability were good enough so far, copied stability will be better. Nonetheless, it can be subsumed by some more general mechanism for supplying arbitrary not necessarily stability related attributes (for example `inline`) to derived impls and their methods (I haven't found an open issue for such mechanism). r? @alexcrichton
2015-10-19Generate stability attributes for derived implsVadim Petrochenkov-1/+1
The attributes are copied from the item for which the trait impl is derived
2015-10-18Remove #[derive(Show)]Vadim Petrochenkov-5/+3
2015-10-18Fix span for pattern literalsMarcus Klaas-2/+2
2015-10-17Auto merge of #29102 - petrochenkov:spanvis, r=alexcrichtonbors-5/+8
Closes https://github.com/rust-lang/rust/issues/28750 `Arm` and `Generics` don't have spans at all, so it's not a visitor's problem, `visit_struct_def` was fixed in https://github.com/rust-lang/rust/pull/28816
2015-10-16Auto merge of #29014 - petrochenkov:stability, r=brsonbors-125/+173
Stricter checking of stability attributes + enforcement of their invariants at compile time (+ removed dead file librustc_front/attr.rs) I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s. r? @aturon I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
2015-10-16Provide span for visit_enum_defVadim Petrochenkov-5/+8
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-105/+2
This is a [breaking change]. @brson could you do a Crater run with this PR please? Lets not land till Crater says its OK. This was discussed at https://internals.rust-lang.org/t/does-anyone-use-the-push-pop-unsafe-macros/2702
2015-10-14Auto merge of #28827 - thepowersgang:unsafe-const-fn-2, r=Aatchbors-3/+8
This is the original test implementation, which works according to the tests I wrote, but might need a review.
2015-10-13Comment on the purpose(s) of NodeId in VariantDataVadim Petrochenkov-0/+11
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-72/+57
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-59/+104
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-56/+56
2015-10-13Test and gate empty structures and variants betterVadim Petrochenkov-26/+21
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-22/+8
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-29/+16
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-40/+46
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-156/+70
2015-10-13Refactor attr::StabilityVadim Petrochenkov-125/+173
Stricter checking + enforcement of invariants at compile time
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-105/+2
This is a [breaking change].
2015-10-10Auto merge of #28932 - barosl:empty-comment, r=alexcrichtonbors-2/+3
Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input. Fixes #28844.
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-0/+9
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-10Prevent `/**/` from being parsed as a doc commentBarosl Lee-2/+3
Previously, `/**/` was incorrectly regarded as a doc comment because it starts with `/**` and ends with `*/`. However, this caused an ICE because some code assumed that the length of a doc comment is at least 5. This commit adds an additional check to `is_block_doc_comment` that tests the length of the input. Fixes #28844.
2015-10-09Auto merge of #28857 - nrc:lowering, r=nikomatsakisbors-444/+91
r? @nikomatsakis
2015-10-09Auto merge of #28919 - huonw:placement-tracking-issue, r=alexcrichtonbors-2/+2
cc #28244
2015-10-09Point `placement_in_syntax`/`box_syntax` lang features at tracking issue #27779.Huon Wilson-2/+2
cc #28244.
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-49/+13
2015-10-09Cache ids between lowering runsNick Cameron-0/+1
So that lowering is reproducible
2015-10-09hygiene for `for` loops, `if let`, `while let`Nick Cameron-15/+72
and some unrelated test cleanups
2015-10-09Fix stabilityNick Cameron-2/+2
2015-10-09Move placement in desugaring to loweringNick Cameron-154/+3
2015-10-09if let and while letNick Cameron-140/+4
2015-10-09Move `for` loop desugaring to loweringNick Cameron-94/+6
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-5/+4
2015-10-06Add RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.Felix S. Klock II-4/+4
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to bootstrap; but of course that alone was not sufficient for `make check`. Later I added `unsafe_destructor_blind_to_params` to collections, in particular `LinkedList` and `RawTable` (the backing representation for `HashMap` and `HashSet`), to get the regression tests exercising cyclic structure from PR #27185 building. ---- Note that the feature is `dropck_parametricity` (which is not the same as the attribute's name). We will almost certainly vary our strategy here in the future, so it makes some sense to have a not-as-ugly name for the feature gate. (The attribute name was deliberately selected to be ugly looking.)