summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-11-10Auto merge of #29714 - petrochenkov:strparse, r=nrcbors-46/+37
In particular, attributes are now parsed on fields of tuple variants
2015-11-10Use lifetime elisionSeo Sanghyeon-10/+10
2015-11-10Use deref coercionsSeo Sanghyeon-20/+20
2015-11-09std: Migrate to the new libcAlex Crichton-5/+8
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-11-09Use enum ParsePub instead of bool in field parsing + typoVadim Petrochenkov-13/+26
2015-11-09Improve error messageVadim Petrochenkov-0/+2
2015-11-09syntax: Use `let _` in #[derive(Debug)]Alex Crichton-4/+21
This should help avoid triggering the unused_results lint which can frequently be turned on. Closes #29710
2015-11-09Tag feature gates with issuesAaron Turon-45/+59
This commit adds issue numbers to the vast majority of active feature gates. The few that are left without issues are rustc/runtime-internal features that are essentially private APIs. Closes #28244
2015-11-09syntax: Merge parsing code for structures and variantsVadim Petrochenkov-44/+20
2015-11-06Auto merge of #29582 - oli-obk:token_tree, r=sfacklerbors-204/+214
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-204/+214
[breaking change]
2015-11-06Auto merge of #29615 - steveklabnik:lol_strings, r=alexcrichtonbors-4/+2
&format!("...") is the same as "" if we're not doing any interpolation, and doesn't allocate an intermediate String.
2015-11-05Auto merge of #29565 - sfackler:issue-29540, r=huonwbors-24/+35
Closes #29540 r? @huonw
2015-11-05remove excess string allocationSteve Klabnik-4/+2
&format!("...") is the same as "" if we're not doing any interpolation, and doesn't allocate an intermediate String.
2015-11-05Auto merge of #28887 - steveklabnik:gh28851, r=alexcrichtonbors-5/+6
If you try to put something that's bigger than a char into a char literal, you get an error: fn main() { let c = 'ஶ்ரீ'; } error: unterminated character constant: This is a very compiler-centric message. Yes, it's technically 'unterminated', but that's not what you, the user did wrong. Instead, this commit changes it to error: character literal that's larger than a char: As this actually tells you what went wrong. Fixes #28851
2015-11-05Improve error message for char literalsSteve Klabnik-5/+6
If you try to put something that's bigger than a char into a char literal, you get an error: fn main() { let c = 'ஶ்ரீ'; } error: unterminated character constant: This is a very compiler-centric message. Yes, it's technically 'unterminated', but that's not what you, the user did wrong. Instead, this commit changes it to error: character literal may only contain one codepoint As this actually tells you what went wrong. Fixes #28851
2015-11-03Don't chain method calls in #[derive(Debug)]Steven Fackler-24/+35
Closes #29540
2015-11-03Allow indirect operands to be used as inputs for inline asmAmanieu d'Antras-2/+2
2015-11-03Auto merge of #29285 - eefriedman:libsyntax-panic, r=nrcbors-177/+161
A set of commits which pushes some panics out of core parser methods, and into users of those parser methods.
2015-11-02Auto merge of #29291 - petrochenkov:privacy, r=alexcrichtonbors-0/+6
The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set. This is needed for https://github.com/rust-lang/rust/pull/29083 because stability annotation pass uses the public set and all things listed above need to be annotated. Rustdoc can now be migrated to the public set as well, I guess. Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public. r? @alexcrichton or maybe someone else
2015-11-01Auto merge of #29501 - Manishearth:pat-docs, r=alexcrichtonbors-3/+3
None
2015-11-01Add code formatting on PatVec docsManish Goregaokar-2/+2
2015-11-01Fix PatEnum docsManish Goregaokar-1/+1
2015-10-31Remove PatWildMultiVadim Petrochenkov-28/+13
2015-10-29Auto merge of #29441 - Ryman:match_refactor_msg, r=alexcrichtonbors-1/+7
This helps for the case where a match, such as below: ```rust let foo = match foo { Some(x) => x, None => 0 }; ``` gets refactored to no longer need the match, but the match keyword has been left accidentally: ```rust let foo = match foo.unwrap_or(0); ``` This can be hard to spot as the expression grows more complex. r? @alexcrichton
2015-10-29Auto merge of #29289 - DiamondLovesYou:pnacl-std-crates, r=alexcrichtonbors-0/+2
2015-10-28libsyntax: improve error message when a statement is prefixed with a match ↵Kevin Butler-1/+7
keyword
2015-10-28Port the standard crates to PNaCl/NaCl.Richard Diamond-0/+2
2015-10-28Make quote plugin use parsing functions which explicitly panic.Eli Friedman-14/+18
Rename parse_* to parse_*_panic, and add parse_attribute_panic.
2015-10-27Update libsyntax tests.Eli Friedman-15/+13
2015-10-27Make fatal errors more consistent.Eli Friedman-15/+11
2015-10-27Start pushing panics outward in lexer.Eli Friedman-34/+38
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-54/+56
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-25/+4
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-25/+26
2015-10-27Add tests for newly introduced syntaxSimonas Kazlauskas-3/+5
Also add some (regression) tests for discovered parser oddities
2015-10-27Fix restrictions when parsing rhs of equalitiesSimonas Kazlauskas-8/+39
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`.