about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-01-31Kill more `isize`sTobias Bucher-13/+13
2015-01-30Test fixes and rebase conflictsAlex Crichton-8/+7
Also some tidying up of a bunch of crate attributes
2015-01-30rollup merge of #21713: alexcrichton/second-pass-fmtAlex Crichton-75/+61
2015-01-30rollup merge of #21718: alexcrichton/stabilize-from-strAlex Crichton-12/+13
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30rollup merge of #21704: FlaPer87/macro-reexportAlex Crichton-0/+7
Conflicts: src/libstd/lib.rs
2015-01-30std: Stabilize the std::fmt moduleAlex Crichton-75/+61
This commit performs a final stabilization pass over the std::fmt module, marking all necessary APIs as stable. One of the more interesting aspects of this module is that it exposes a good deal of its runtime representation to the outside world in order for `format_args!` to be able to construct the format strings. Instead of hacking the compiler to assume that these items are stable, this commit instead lays out a story for the stabilization and evolution of these APIs. There are three primary details used by the `format_args!` macro: 1. `Arguments` - an opaque package of a "compiled format string". This structure is passed around and the `write` function is the source of truth for transforming a compiled format string into a string at runtime. This must be able to be constructed in stable code. 2. `Argument` - an opaque structure representing an argument to a format string. This is *almost* a trait object as it's just a pointer/function pair, but due to the function originating from one of many traits, it's not actually a trait object. Like `Arguments`, this must be constructed from stable code. 3. `fmt::rt` - this module contains the runtime type definitions primarily for the `rt::Argument` structure. Whenever an argument is formatted with nonstandard flags, a corresponding `rt::Argument` is generated describing how the argument is being formatted. This can be used to construct an `Arguments`. The primary interface to `std::fmt` is the `Arguments` structure, and as such this type name is stabilize as-is today. It is expected for libraries to pass around an `Arguments` structure to represent a pending formatted computation. The remaining portions are largely "cruft" which would rather not be stabilized, but due to the stability checks they must be. As a result, almost all pieces have been renamed to represent that they are "version 1" of the formatting representation. The theory is that at a later date if we change the representation of these types we can add new definitions called "version 2" and corresponding constructors for `Arguments`. One of the other remaining large questions about the fmt module were how the pending I/O reform would affect the signatures of methods in the module. Due to [RFC 526][rfc], however, the writers of fmt are now incompatible with the writers of io, so this question has largely been solved. As a result the interfaces are largely stabilized as-is today. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md Specifically, the following changes were made: * The contents of `fmt::rt` were all moved under `fmt::rt::v1` * `fmt::rt` is stable * `fmt::rt::v1` is stable * `Error` is stable * `Writer` is stable * `Writer::write_str` is stable * `Writer::write_fmt` is stable * `Formatter` is stable * `Argument` has been renamed to `ArgumentV1` and is stable * `ArgumentV1::new` is stable * `ArgumentV1::from_uint` is stable * `Arguments::new_v1` is stable (renamed from `new`) * `Arguments::new_v1_formatted` is stable (renamed from `with_placeholders`) * All formatting traits are now stable, as well as the `fmt` method. * `fmt::write` is stable * `fmt::format` is stable * `Formatter::pad_integral` is stable * `Formatter::pad` is stable * `Formatter::write_str` is stable * `Formatter::write_fmt` is stable * Some assorted top level items which were only used by `format_args!` were removed in favor of static functions on `ArgumentV1` as well. * The formatting-flag-accessing methods remain unstable Within the contents of the `fmt::rt::v1` module, the following actions were taken: * Reexports of all enum variants were removed * All prefixes on enum variants were removed * A few miscellaneous enum variants were renamed * Otherwise all structs, fields, and variants were marked stable. In addition to these actions in the `std::fmt` module, many implementations of `Show` and `String` were stabilized as well. In some other modules: * `ToString` is now stable * `ToString::to_string` is now stable * `Vec` no longer implements `fmt::Writer` (this has moved to `String`) This is a breaking change due to all of the changes to the `fmt::rt` module, but this likely will not have much impact on existing programs. Closes #20661 [breaking-change]
2015-01-30std: Stabilize FromStr and parseAlex Crichton-12/+13
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30fixes after rebaseJorge Aparicio-1/+0
2015-01-30s/while let/for/g now that #21245 has been fixedJorge Aparicio-8/+4
2015-01-30custom message for refutable patterns in for loopsJorge Aparicio-2/+3
2015-01-30fix falloutJorge Aparicio-4/+11
2015-01-30implement for loop desugaringJorge Aparicio-3/+93
2015-01-30Change from core::ops::RangeFull to std::opsNick Cameron-1/+1
2015-01-30Rename FullRange to RangeFullNick Cameron-3/+3
2015-01-30Use absolute path to FullRange, rather than assuming it is in the preludeNick Cameron-53/+65
Closes #21263 [breaking-change] If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-151/+156
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
2015-01-29bring back `#[derive(Show)]` with a deprecation warningJorge Aparicio-0/+8
2015-01-29s/Show/Debug/gJorge Aparicio-128/+128
2015-01-29register snaphotsJorge Aparicio-2/+0
2015-01-29remove unused importsJorge Aparicio-1/+0
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-4/+4
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-15/+15
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-1/+1
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-29Feature gate macro_reexport. Fixes #20906Flavio Percoco-0/+7
2015-01-29Rollup merge of 21662 - oli-obk:hashmap_enum_json, r=alexcrichtonManish Goregaokar-1/+1
2015-01-29Rollup merge of 21681 - japaric:no-warn, r=alexcrichtonManish Goregaokar-5/+1
2015-01-29Rollup merge of #21626 - Ms2ger:various-cleanup, r=eddybManish Goregaokar-31/+11
2015-01-28Auto merge of #21019 - nikomatsakis:issue-20871-ret-as-assoc-type, r=nrcbors-3/+12
Fixes https://github.com/rust-lang/rust/issues/20871 r? @aturon (at least until we decide definitively if this is a good idea)
2015-01-28Move return type an associated type of the `Fn*` traits. Mostly this ↵Niko Matsakis-3/+12
involves tweaking things in the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs` to project `Output` from the unboxed closure and fn traits.
2015-01-28Remove unnecessary to_string() call.Ms2ger-1/+1
2015-01-28Remove a custom variant of iter::Cloned.Ms2ger-16/+3
2015-01-28Simplify the implementation of segments_name_eq.Ms2ger-14/+7
2015-01-28Auto merge of #21158 - alkor:issue-21131, r=nick29581bors-6/+10
Closes #21131
2015-01-27fix #[cfg(test)] warningsJorge Aparicio-5/+1
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-60/+61
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-26Make '-A warnings' apply to all warnings, including feature gate warningsBrian Anderson-7/+15
2015-01-26std: Rename Writer::write to Writer::write_allAlex Crichton-3/+3
In preparation for upcoming changes to the `Writer` trait (soon to be called `Write`) this commit renames the current `write` method to `write_all` to match the semantics of the upcoming `write_all` method. The `write` method will be repurposed to return a `usize` indicating how much data was written which differs from the current `write` semantics. In order to head off as much unintended breakage as possible, the method is being deprecated now in favor of a new name. [breaking-change]
2015-01-26Fallout of io => old_ioAlex Crichton-50/+50
2015-01-26Merge remote-tracking branch 'rust-lang/master'Brian Anderson-159/+106
Conflicts: src/librustc/lint/builtin.rs src/librustc/lint/context.rs
2015-01-26Auto merge of #21617 - alexcrichton:less-quotes, r=nikomatsakisbors-7/+8
This ends up propagating all the way out to the output of dep-info which then makes Cargo think that files are not existent (it thinks the files have quotes in their name) when they in fact do.
2015-01-26Auto merge of #21614 - kvark:typedef, r=huonwbors-16/+55
Fixes #21497 I don't know if this can be tested with built-in tests.
2015-01-26falloutOliver Schneider-1/+1
2015-01-26Auto merge of #21605 - huonw:omg-muscle-memory, r=eddybbors-0/+10
I'm beginning to suspect it's impossible to avoid accidentally writing `#[deriving]` at least once in every program, and it results in non-intuitive error messages: "Foo doesn't have any method in scope `clone`" despite there being a `#[deriv...(Clone)]` attribute! Also, lots of documentation around the internet uses `#[deriving]` so providing this guidance is very helpful (lots of people ask in #rust about this error).
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-23/+30
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2015-01-26Adjust most comments and messages to not use "unboxed".Eduard Burtescu-1/+1
2015-01-26Remove every mention of "onceness".Eduard Burtescu-16/+0
2015-01-26Remove dead code related to old closures.Eduard Burtescu-94/+11
2015-01-26Remove "unboxed" attribute in code referring to new closures.Eduard Burtescu-32/+29
2015-01-25Auto merge of #21582 - FlaPer87:rollup, r=brsonbors-0/+2
- Successful merges: #21108, #21445, #21498, #21504, #21532, #21535, #21539, #21540, #21541, #21550, #21560, #21573, #21579 - Failed merges:
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-1422/+1028
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs