about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-06-04syntax: Make quasiquoter use absolute pathsklutzy-69/+54
As part of removing `pub use` glob, two extra import globs were injected to make `quote_expr!` work. However the globs caused `unused_import` warning in some places. Quasiquoter needed the globs since it generated idents (e.g. `TyU`) rather than absolute paths (`::syntax::ast::TyU`). This patch removes the extra globs and makes quasiquoter use absolute paths. Fixes #14618
2014-06-02auto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichtonbors-7/+7
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. `norust` as a negative statement is a bad tag. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code. Amends the documentation to reflect the new behaviour.
2014-06-02auto merge of #14509 : klutzy/rust/de-pub-use-glob, r=alexcrichtonbors-12/+40
This patchset removes `pub use` usage except for `test/`. cc #11870
2014-06-02syntax: Remove use of `pub use` globsklutzy-12/+40
`quote_expr!` now injects two more (priv) `use` globs. This may cause extra unused_imports warning.
2014-06-02docs: Stop using `notrust`Florian Gilcher-7/+7
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code.
2014-06-02Fix deriving Encodable trait for unit structsPiotr Jawniak-0/+8
Closes #14021
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-98/+98
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-05-31syntax: Fix an accidental hyperlink in a commentAlex Crichton-1/+1
2014-05-30syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}Alex Crichton-6/+7
This commit adds the groundwork for the renaming of the Total{Eq,Ord} traits. After this commit hits a snapshot, the traits can be renamed.
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-127/+126
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-30libsyntax: Fix snake_case errors.Kevin Butler-68/+73
A number of functions/methods have been moved or renamed to align better with rust standard conventions. syntax::ext::mtwt::xorPush => xor_push syntax::parse::parser::Parser => Parser::new [breaking-change]
2014-05-30auto merge of #14517 : lucy/rust/issue-14499, r=alexcrichtonbors-1/+1
Fixes #8537 Fixes #14499 (duplicate of #8537) Old: ```rust test.rs:2 pub extern "xxxxx" fn add(x: int, y: int) -> int { ^~ ``` New: ```rust test.rs:2 pub extern "xxxxx" fn add(x: int, y: int) -> int { ^~~~~~~ ```
2014-05-29auto merge of #14427 : alexcrichton/rust/librand, r=huonwbors-2/+3
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for libcore to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. cc #13851 [breaking-change]
2014-05-29std: Recreate a `rand` moduleAlex Crichton-2/+3
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for librand to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. * The `sample` method on `Rng` has been moved to a top-level function in the `rand` module due to its dependence on `Vec`. cc #13851 [breaking-change]
2014-05-29auto merge of #14483 : ahmedcharles/rust/patbox, r=alexcrichtonbors-8/+8
2014-05-29syntax: Fix span on illegal ABI errorslucy-1/+1
Fixes #8537 Fixes #14499
2014-05-29auto merge of #14492 : alexcrichton/rust/totaleq, r=pnkfelixbors-4/+5
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
2014-05-29auto merge of #14481 : alexcrichton/rust/no-format-strbuf, r=sfacklerbors-2/+2
* Removes `format_strbuf!()`
2014-05-28Parse macros in patternsKeegan McAllister-7/+20
Fixes #6830.
2014-05-28Expand macros in patternsKeegan McAllister-5/+90
2014-05-28Add patterns to MacResultKeegan McAllister-0/+35
2014-05-28Add AST node for pattern macrosKeegan McAllister-1/+6
2014-05-28rustc: Accept PartialOrd/PartialOrdEq for Eq/OrdAlex Crichton-4/+5
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
2014-05-28std: Remove format_strbuf!()Alex Crichton-2/+2
This was only ever a transitionary macro.
2014-05-27Rename PatUniq to PatBox. Fixes part of #13910.Ahmed Charles-8/+8
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-18/+19
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, ↵bors-279/+279
r=alexcrichton This should block on #14323
2014-05-27std: Rename strbuf operations to stringRicho Healey-260/+260
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-19/+19
2014-05-27syntax: desugar a `for` loop to a let binding to get better errorHuon Wilson-4/+32
messages when the pattern is refutable. This means the compiler points directly to the pattern and said that the problem is the pattern being refutable (rather than just saying that some value isn't covered in the `match` as it did previously). Fixes #14390.
2014-05-26syntax: Add a source field to `Local` for tracking if it comes from `let`s ↵Huon Wilson-2/+17
or `for`s.
2014-05-25Allow $foo:block nonterminals in expression positionKevin Ballard-7/+11
Fixes #13678.
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-195/+195
[breaking-change]
2014-05-24Changes from feedbackSteven Fackler-42/+32
2014-05-24Get "make check" to work with unused-attributeSteven Fackler-3/+4
There's a fair number of attributes that have to be whitelisted since they're either looked for by rustdoc, in trans, or as needed. These can be cleaned up in the future.
2014-05-24Port more stuff to mark used attributesSteven Fackler-24/+43
2014-05-24First sketch of lint passSteven Fackler-4/+12
Enough attributes are marked to cleanly compile an empty library.
2014-05-24Add AttrId to Attribute_Steven Fackler-21/+74
2014-05-24auto merge of #14389 : Ryman/rust/14303, r=alexcrichtonbors-1/+13
Closes #14303.
2014-05-23Make most lexer errors non-fatalKevin Ballard-143/+104
Most errors that arise in the lexer can be recovered from. This allows for more than one syntax error to be reported at a time.
2014-05-23Improve error message for lifetimes after type params.Kevin Butler-1/+13
Closes #14303.
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-248/+51
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-23syntax: Clean out obsolete syntax parsingAlex Crichton-248/+51
All of these features have been obsolete since February 2014, where most have been obsolete since 2013. There shouldn't be any more need to keep around the parser hacks after this length of time.
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-4/+4
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22auto merge of #14314 : alexcrichton/rust/deriving-hash, r=brsonbors-1/+2
One of the long-term goals of the libstd facade is to move the collections library underneath the standard library. This would imply that libcollections today would invert its dependency with libstd. One of the primary blockers for doing this is the HashMap collection. Of its two major dependencies, hashing and randomness, this commit is the first step in dealing with hashing. When moving the hash module beneath libstd, it must break its primary dependence on the io::Writer trait (used as the hashing state). The proposed strategy for breaking this dependence is taking a similar path as core::fmt, which is to have the hash module define its own "writer trait". This trait would be similar to std::io::Writer, except that it would not return errors and it would have fewer convenience methods. The Hash trait today has its type parameter behind a feature gate (default type parameters), so this pending change will likely break no code which hasn't opted in to the feature gate. The SipState struct will lose its implementation of io::Writer, but it will regain similar methods for dealing with writing data. This change specifically prepares for the hash migration by modifying deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer bound. This bound is currently wired to std::io::Writer, but after a snapshot it will have no need to be wired to the io writer trait.
2014-05-22auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonwbors-3/+3
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-5/+14
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-24/+32
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-170/+275
2014-05-22syntax: put the correct span on doc-comments inside a module.Huon Wilson-4/+4
The position of the .bump call (before extracting the span fields) was causing a doc-comment to have the span of the next token, not itself.