summary refs log tree commit diff
path: root/src/libsyntax/print
AgeCommit message (Collapse)AuthorLines
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-7/+5
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26Some TLC for the MoveMap traitMarvin Löbel-2/+0
2015-11-26Moved and refactored ThinAttributesMarvin Löbel-5/+6
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-84/+145
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-23Avoid some code duplication around getting names of numeric types.Michael Woerister-3/+3
2015-11-17Auto merge of #29887 - sanxiyn:match-ref-pats, r=sfacklerbors-18/+18
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-18/+18
2015-11-16rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`Oliver Schneider-4/+4
2015-11-12Auto merge of #29780 - KyleMayes:quote-ext, r=nrcbors-0/+1
This is my first code contribution to Rust, so I'm sure there are some issues with the changes I've made. I've added the `quote_arg!`, `quote_block!`, `quote_path!`, and `quote_meta_item!` quasiquoting macros. From my experience trying to build AST in compiler plugins, I would like to be able to build any AST piece with a quasiquoting macro (e.g., `quote_struct_field!` or `quote_variant!`) and then use those AST pieces in other quasiquoting macros, but this pull request just adds some of the low-hanging fruit. I'm not sure if these additions are desirable, and I'm sure these macros can be implemented in an external crate if not.
2015-11-12libsyntax: deny warnings in doctestsKevin Butler-2/+4
2015-11-11libsyntax: Add more quasiquoting macrosKyle Mayes-0/+1
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-7/+7
[breaking change]
2015-10-31Remove PatWildMultiVadim Petrochenkov-8/+4
2015-10-27Generalise associative operator parsingSimonas Kazlauskas-6/+8
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-1/+2
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-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-16/+2
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-1/+2
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-2/+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-13Merge VariantData and VariantData_Vadim Petrochenkov-2/+1
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-8/+19
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-4/+4
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-1/+0
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-3/+5
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-21/+11
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-2/+2
This is a [breaking change].
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-1/+1
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-4/+4
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-4/+3
This PR removes random remaining `Ident`s outside of libsyntax and performs general cleanup In particular, interfaces of `Name` and `Ident` are tidied up, `Name`s and `Ident`s being small `Copy` aggregates are always passed to functions by value, and `Ident`s are never used as keys in maps, because `Ident` comparisons are tricky. Although this PR closes https://github.com/rust-lang/rust/issues/6993 there's still work related to it: - `Name` can be made `NonZero` to compress numerous `Option<Name>`s and `Option<Ident>`s but it requires const unsafe functions. - Implementation of `PartialEq` on `Ident` should be eliminated and replaced with explicit hygienic, non-hygienic or member-wise comparisons. - Finally, large parts of AST can potentially be converted to `Name`s in the same way as HIR to clearly separate identifiers used in hygienic and non-hygienic contexts. r? @nrc
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-4/+3
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-9/+12
2015-09-21Use ast::AsmDialect's variants qualified, and drop the pointless prefix.Ms2ger-1/+1
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-26/+18
Closes #28527.
2015-09-18Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichtonbors-3/+1
Followup on #28440 Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18Implement empty struct with braces (RFC 218)Vadim Petrochenkov-25/+25
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-3/+1
Followup on #28440
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-310/+350
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-04Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichtonbors-2/+2
r? @alexcrichton
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-3/+3
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+2
Fixes #28109
2015-08-21Auto merge of #27613 - GSam:binop, r=nrcbors-3/+30
In the case where there are no paren in the AST, the pretty printer doesn't correctly print binary operations where precedence is concerned. Parenthesis may be missing due to some kind of expansion or manipulation of the AST. Example: Pretty printer prints Expr(*, Expr(+, 1, 1), 2) as 1 + 1 * 2, as opposed to (1 + 1) * 2 r? @nrc
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-4/+16
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219). The RFC is not merged yet, but once merged, this could be.
2015-08-10Avoid adding extra paren with two castsGarming Sam-1/+5
2015-08-09Casts are a type of binopGarming Sam-1/+1
This just adds paren following the same cases as before
2015-08-09Add operator precedence for pretty printerGarming Sam-2/+25
Previously it just added parentheses in excess. e.g. ((1 + 2) + 3) + 4
2015-08-09Binary ops should add parenthesis to each sideGarming Sam-2/+2
Otherwise, we get (1 + 2) * 3 looking like 1 + 2 * 3
2015-08-08rustc: rename multiple imports in a listSean McArthur-4/+16
2015-08-06Auto merge of #27296 - jroesch:type-macros, r=huonwbors-0/+3
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message. @nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-04Add a macro invocation to the type ASTJared Roesch-0/+3
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540 to a clean branch of master
2015-08-03syntax: Implement #![no_core]Alex Crichton-1/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-16/+16