bors [Tue, 12 Mar 2013 04:12:43 +0000 (21:12 -0700)]
auto merge of #5304 : jld/rust/const-adjustments, r=graydon
These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right.
As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions.
There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.
bors [Tue, 12 Mar 2013 03:21:45 +0000 (20:21 -0700)]
auto merge of #5303 : brson/rust/newsched4, r=brson
r?
Followup to #5022. This is the same, but everything is in `core::rt` now. `std::uv_ll` is moved to `core::unstable::uvll`, with the intent that it eventually move into its own crate (blocked on #5192 at least). I've had to disable the uv tests because of #2064. All of `core::rt` is disabled on platforms that aren't mac or linux until I complete the windows thread local storage bindings and ARM context switching.
My immediate next priorities will be to fix #2064 and clean up the uv bindings, get everything building on all platforms.
bors [Mon, 11 Mar 2013 18:54:49 +0000 (11:54 -0700)]
auto merge of #5314 : jld/rust/adt-simplification, r=pcwalton
Struct and enum representations have some complicatedness that's no longer needed. Now that everything's in one place and has access to anything we'd want to know about the type, flatten some of that out. Slight changes to representations in some cases.
Jed Davis [Mon, 11 Mar 2013 06:16:08 +0000 (23:16 -0700)]
Get rid of the `Unit` enum representation.
The only thing we really lose is that C-like enums with one variant and a
non-zero discriminant now take up space, but I do not think this is a
common usage. As previously noted, that was mostly there for
transitional compatibility with the pre-adt.rs codebase.
Jed Davis [Mon, 11 Mar 2013 05:58:44 +0000 (22:58 -0700)]
Simplify struct representation.
Out goes the extra layer of struct wrapping; the destructedness flag is
added to the end of the struct. This means that, if the struct
previously had alignment padding at the end, the flag will live there
instead of increasing the struct size.
bors [Mon, 11 Mar 2013 04:39:46 +0000 (21:39 -0700)]
auto merge of #5308 : wanderview/rust/std-getopts-rustdoc-fix, r=luqmana
There were three issues effecting the example in the getopts rustdoc:
1. The blockquote was incorrectly formatted. Fixed by switching to using
an explicit markdown code section with ```.
2. The `fail fail_str(f)` would not compile. Fixed by using `fail!()` instead
of `fail`.
3. The line `matches.free[0]` produced a compile error about moving from
an immutable vector. Fix by using `copy`.
Ben Kelly [Mon, 11 Mar 2013 00:47:28 +0000 (20:47 -0400)]
Correct copyright year to be 2012-2013.
Previous year range of 2011-2013 was based on file creation date. The
check_license python script, however, only accepts copyrights starting
in 2012 or later.
Ben Kelly [Sun, 10 Mar 2013 17:27:11 +0000 (13:27 -0400)]
Fix formatting and errors in std::getopts example.
There were three issues effecting the example in the getopts rustdoc:
1. The blockquote was incorrectly formatted. Fixed by switching to using
an explicit markdown code section with ```.
2. The `fail fail_str(f)` would not compile. Fixed by using `fail!()` instead
of `fail`.
3. The line `matches.free[0]` produced a compile error about moving from
an immutable vector. Fix by using `copy`.
bors [Sun, 10 Mar 2013 02:42:43 +0000 (18:42 -0800)]
auto merge of #5285 : jld/rust/emacs-refix, r=brson
Without this change, rust-mode doesn't work if 'cl hasn't been required
by something else, apparently. I'm not entirely sure what changed such
that I started seeing this problem instead of not, but maybe the emacs
world has been making progress towards not loading 'cl at runtime if
it's only needed at compile time.
(This change was previously submitted as e93a58d52 and accidentally reverted by ad8b437ad.)
Jed Davis [Thu, 7 Mar 2013 20:34:58 +0000 (12:34 -0800)]
Implement most of adjustment handling for consts.
Changes the ad-hoc closure adjustment into using adjustment info instead
of being separately driven from types, and likewise for autoderef.
Also takes care of autoref (the cases we should be seeing in consts,
at least, since we can't be doing method calls which would need the
ref-to-vec mode), which didn't quite work right previously.
However, "dereference" of a newtype isn't handled yet....
Jed Davis [Sun, 10 Feb 2013 19:16:54 +0000 (11:16 -0800)]
rust-mode.el uses the 'cl macros, so it should actually require them
Without this change, rust-mode doesn't work if 'cl hasn't been required
by something else, apparently. I'm not entirely sure what changed such
that I started seeing this problem instead of not, but maybe the emacs
world has been making progress towards not loading 'cl at runtime if
it's only needed at compile time.
bors [Fri, 8 Mar 2013 20:27:39 +0000 (12:27 -0800)]
auto merge of #5278 : brson/rust/logplusplus, r=brson
r?
`log` can polymorphically log anything, but debug!, etc. requires a format string. With this patch you can equivalently write `debug!(foo)` or `debug!("%?", foo)`.
I'm doing this because I was trying to remove `log` (replacing it with nothing, at least temporarily), but there are a number of logging statements that just want to print an arbitrary value and don't care about the format string.
I'm not entirely convinced this is a good change, since it overloads the implementation of these macros and makes their usage slightly more nuanced.
bors [Fri, 8 Mar 2013 16:45:43 +0000 (08:45 -0800)]
auto merge of #5279 : alexcrichton/rust/no-dvec, r=pcwalton
Closes #4985 by removing the `dvec` module and all use cases throughout the compiler.
A number of uses were directly convertible to `let mut foo = ~[];`, while others in hash maps and some fields had to be converted to `@mut ~[T]`. A small number of `DVec` instances in fields were able to be converted directly to `~[T]` without the `@`, but this was a difficult thing to do.