summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2013-12-13auto merge of #10698 : metajack/rust/dep-info, r=alexcrichtonbors-1/+15
This isn't super useful for libraries yet without #10593. Fixes #7633.
2013-12-11Make 'self lifetime illegal.Erik Price-53/+53
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10Fix missing code map entry for uses of `include_str!`.Jack Moffitt-1/+15
2013-12-10Extend allocation lint for boxing expressionsSeo Sanghyeon-11/+11
2013-12-08Remove dead codesKiet Tran-16/+2
2013-12-08Add dead-code warning passKiet Tran-40/+9
2013-12-07syntax::deriving: indicate from which trait type errors (etc) ariseHuon Wilson-4/+22
using the expansion info. Previously something like struct NotEq; #[deriving(Eq)] struct Error { foo: NotEq } would just point to the `foo` field, with no mention of the `deriving(Eq)`. With this patch, the compiler creates a note saying "in expansion of #[deriving(Eq)]" pointing to the Eq.
2013-12-07syntax: print expansion info from #[attribute] macros in the correctHuon Wilson-1/+6
format. Previously, any attempt to use this information from inside something like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.
2013-12-07syntax::deriving: add the cx and span to the TraitDef to reduce duplication.Huon Wilson-226/+251
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-4/+4
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-02Add a macro to check if logging at a given label is enabledPhilipp Brüschweiler-0/+7
This is useful when the information that is needed to do useful logging is expensive to produce.
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-131/+113
critical enum sizes.
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-4/+4
2013-11-28Register new snapshotsAlex Crichton-34/+34
2013-11-27Freeze the AST by removing a couple of unused @mut ~[T] from token_tree.Eduard Burtescu-7/+6
2013-11-26Clean up SmallVector use a bitSteven Fackler-19/+7
2013-11-26Support multiple item macrosSteven Fackler-62/+68
Closes #4375
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-92/+98
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-16/+17
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-1/+1
2013-11-26rustc: Add lint for obsolete attributesklutzy-42/+1
This also moves `#[auto_{en,de}code]` checker from syntax to lint.
2013-11-26Take &Pat in visit_patSeo Sanghyeon-1/+1
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-24/+39
2013-11-19Mark some derived methods as #[inline].Huon Wilson-1/+27
ToStr, Encodable and Decodable are not marked as such, since they're already expensive, and lead to large methods, so inlining will bloat the metadata & the binaries. This means that something like #[deriving(Eq)] struct A { x: int } creates an instance like #[doc = "Automatically derived."] impl ::std::cmp::Eq for A { #[inline] fn eq(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0) } } } #[inline] fn ne(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0) } } } } (The change being the `#[inline]` attributes.)
2013-11-17Forbid privacy in inner functionsAlex Crichton-1/+1
Closes #10111
2013-11-11Move std::rt::io to std::ioAlex Crichton-5/+5
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-78/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-27/+29
2013-11-08syntax::ext: Make type errors in deriving point to the field itself.Huon Wilson-312/+327
This rearranges the deriving code so that #[deriving] a trait on a field that doesn't implement that trait will point to the field in question, e.g. struct NotEq; // doesn't implement Eq #[deriving(Eq)] struct Foo { ok: int, also_ok: ~str, bad: NotEq // error points here. } Unfortunately, this means the error is disconnected from the `deriving` itself but there's no current way to pass that information through to rustc except via the spans, at the moment. Fixes #7724.
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-0/+1
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-4/+3
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-17/+8
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-10-31Implement a concat!() format extensionAlex Crichton-3/+83
This extension can be used to concatenate string literals at compile time. C has this useful ability when placing string literals lexically next to one another, but this needs to be handled at the syntax extension level to recursively expand macros. The major use case for this is something like: macro_rules! mylog( ($fmt:expr $($arg:tt)*) => { error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*); }) Where the mylog macro will automatically prepend the filename/line number to the beginning of every log message.
2013-10-30Prepared `std::sys` for removal, and made `begin_unwind` simplerMarvin Löbel-59/+51
- `begin_unwind` is now generic over any `T: Any + Send`. - Every value you fail with gets boxed as an `~Any`. - Because of implementation details, `&'static str` and `~str` are still handled specially behind the scenes. - Changed the big macro source string in libsyntax to a raw string literal, and enabled doc comments there.
2013-10-28Field identifiers now include specific spans (Closes #8263).Joshua Yanovski-1/+1
2013-10-28auto merge of #10117 : huonw/rust/dead-visits, r=sanxiynbors-63/+70
Used nowhere, and these are likely incorrect anyway: self needs to be dereferenced once more otherwise the method calls will be reusing the current impl... bam! Infinite recursion.
2013-10-28Remove the extension traits for Readers/WritersAlex Crichton-1/+1
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits.
2013-10-28syntax: remove dead @mut Visitor impl (only used in tests).Huon Wilson-63/+70
Also, move some code only uses in the tests into the test module, and replace some needless @mut ~[] with plain ~[].
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-16/+20
2013-10-24Test fixes and merge conflictsAlex Crichton-0/+1
2013-10-24Remove io::read_errorAlex Crichton-5/+3
The general idea is to remove conditions completely from I/O, so in the meantime remove the read_error condition to mean the same thing as the io_error condition.
2013-10-24Remove even more of std::ioAlex Crichton-35/+53
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-1/+1
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-1/+1
2013-10-22Remove the now-duplicate logging macrosAlex Crichton-8/+0
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-32/+32
Who doesn't like a massive renaming?
2013-10-21std: Move sys::log_str to repr::repr_to_str. Further work on #2240.Brian Anderson-3/+4
2013-10-20Don't allocate a string when calling printlnAlex Crichton-7/+2
Instead use format_args! to pass around a struct to pass along into std::fmt
2013-10-18auto merge of #9919 : alexcrichton/rust/fmt-begone, r=huonwbors-362/+25
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)
2013-10-18Remove the fmt! syntax extensionAlex Crichton-362/+25
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)