summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-11-09auto merge of #10367 : alexcrichton/rust/system-abi, r=nikomatsakisbors-13/+36
This adds an other ABI option which allows a custom selection over the target architecture and OS. The only current candidate for this change is that kernel32 on win32 uses stdcall, but on win64 it uses the cdecl calling convention. Otherwise everywhere else this is defined as using the Cdecl calling convention. cc #10049 Closes #8774
2013-11-09Add a "system" ABIAlex Crichton-13/+36
This adds an other ABI option which allows a custom selection over the target architecture and OS. The only current candidate for this change is that kernel32 on win32 uses stdcall, but on win64 it uses the cdecl calling convention. Otherwise everywhere else this is defined as using the Cdecl calling convention. cc #10049 Closes #8774
2013-11-09auto merge of #10153 : ↵bors-114/+229
nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-7, r=pnkfelix Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`. Fixes #4846
2013-11-08Fix pretty printer when there are multiple lifetime parametersNiko Matsakis-6/+13
2013-11-08Address comments from @pnkfelix (thanks for the detailed review)Niko Matsakis-6/+0
2013-11-08Update FIXMEs with issue numbersNiko Matsakis-1/+1
2013-11-08Rename and modernize region enum namesNiko Matsakis-2/+2
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-93/+120
2013-11-08Create a new pass to resolve named lifetimes; rscope is not onlyNiko Matsakis-15/+102
used to indicate when anonymous regions (i.e., &T) are permitted
2013-11-08Specify package_id for rust libs, to avoid spurious warningsAndrei Formiga-0/+1
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-07auto merge of #10243 : mattcarberry/rust/master, r=brsonbors-0/+13
Associated with Issue #6563. Useful for Apollo Guidance Computer simulation, Unix file system permissions, and maybe one or two other things.
2013-11-05auto merge of #10285 : sfackler/rust/weird-derivings, r=huonwbors-3/+0
They seem to have been added by accident.
2013-11-04Remove #[deriving]s on implsSteven Fackler-3/+0
They seem to have been added by accident.
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-27/+90
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-7/+5
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-27/+14
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-11-03Rename files to match current recommendations.Chris Morgan-0/+0
New standards have arisen in recent months, mostly for the use of rustpkg, but the main Rust codebase has not been altered to match these new specifications. This changeset rectifies most of these issues. - Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for consistency with current styles; this affects extra, rustc, rustdoc, rustpkg, rustuv, std, syntax. - Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for `std::num` and `std::terminfo`. - Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str` directory, to be consistent with its import path of `std::ascii`; libstd is flat at present so it's more appropriate thus. While this removes some `#[path = "..."]` directives, it does not remove all of them, and leaves certain other inconsistencies, such as `std::u8` et al. which are actually stored in `src/libstd/num/` (one subdirectory down). No quorum has been reached on this issue, so I felt it best to leave them all alone at present. #9208 deals with the possibility of making libstd more hierarchical (such as changing the crate to match the current filesystem structure, which would make the module path `std::num::u8`). There is one thing remaining in which this repository is not rustpkg-compliant: rustpkg would have `src/std/` et al. rather than `src/libstd/` et al. I have not endeavoured to change that at this point as it would guarantee prompt bitrot and confusion. A change of that magnitude needs to be discussed first.
2013-11-02Added octal literal support.Matt Carberry-0/+13
2013-10-31auto merge of #10187 : pcwalton/rust/remove-mocks, r=pcwaltonbors-35/+196
r? @alexcrichton
2013-10-31Implement a concat!() format extensionAlex Crichton-3/+84
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-31librustc: Implement `|A| -> B` syntax for closures and make bare `fn`Patrick Walton-35/+196
work
2013-10-30auto merge of #10166 : brson/rust/meta, r=alexcrichtonbors-0/+10
This doesn't fix #623 but works around it by limiting the grammar.
2013-10-30auto merge of #10120 : Kimundi/rust/remove_sys, r=alexcrichtonbors-59/+51
- `begin_unwind` and `fail!` is now generic over any `T: Any + Send`. - Every value you fail with gets boxed as an `~Any`. - Because of implementation issues, `&'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-30syntax: Forbid non-string literals in meta items. #623Brian Anderson-0/+10
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-30auto merge of #9613 : jld/rust/enum-discrim-size.r0, r=alexcrichtonbors-1/+113
Allows an enum with a discriminant to use any of the primitive integer types to store it. By default the smallest usable type is chosen, but this can be overridden with an attribute: `#[repr(int)]` etc., or `#[repr(C)]` to match the target's C ABI for the equivalent C enum. Also adds a lint pass for using non-FFI safe enums in extern declarations, checks that specified discriminants can be stored in the specified type if any, and fixes assorted code that was assuming int.
2013-10-29auto merge of #10134 : reedlepee123/rust/priv_fields, r=brsonbors-7/+4
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-26/+145
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-29Assorted cleanups suggested by reviewers.Jed Davis-2/+1
2013-10-29Lint non-FFI-safe enums.Jed Davis-0/+19
2013-10-29Add parser for `#[repr(...)]`; nothing uses it yet.Jed Davis-1/+95
Also export enum attrs into metadata, and add a convenient interface for obtaining the repr hint from either a local or remote definition.
2013-10-29removed extra linereedlepee-1/+0
2013-10-29Indentationreedlepee-1/+1
2013-10-29updated the places where the struct is created #7427reedlepee-2/+3
2013-10-29Changed name to non_copyable #7427reedlepee-1/+1
2013-10-29Added the comment #7427reedlepee-1/+1
2013-10-29Replaced empty destructors with NonCopyable #7427reedlepee-5/+2
closes #7427
2013-10-28Field identifiers now include specific spans (Closes #8263).Joshua Yanovski-7/+11
2013-10-28auto merge of #10117 : huonw/rust/dead-visits, r=sanxiynbors-126/+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-4/+3
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-126/+70
Also, move some code only uses in the tests into the test module, and replace some needless @mut ~[] with plain ~[].
2013-10-25libsyntax: Get rid of obsolete obsolete warning.Luqman Aden-6/+0
2013-10-25libsyntax: Get rid of some logic for some obsolete syntax.Luqman Aden-14/+5
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-56/+40
2013-10-24Test fixes and merge conflictsAlex Crichton-0/+1
2013-10-24Remove io::read_errorAlex Crichton-8/+4
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-108/+151
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-23register snapshotsDaniel Micay-1/+1
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-4/+15