Commit Graph

16348 Commits

Author SHA1 Message Date
bors
67b0f3d5b2 auto merge of #5339 : catamorphism/rust/less-copy, r=catamorphism 2013-03-13 13:57:56 -07:00
Daniel Micay
9c32de59ac work on release notes
* make the changes regarding move semantics clearer
* expand on the container work
2013-03-13 16:49:24 -04:00
bors
4d8ddff52a auto merge of #5337 : yichoi/rust/pull-0312, r=sanxiyn
libuv submodule regression patch for ARM android compilation
2013-03-13 13:04:07 -07:00
bors
7e6020db63 auto merge of #5319 : brson/rust/debuginfo, r=brson
Continuing #5140 

For the sake of getting this merged I've disabled debuginfo tests on mac (where running gdb needs root). Please feel free to follow up with further improvements.
2013-03-13 11:34:00 -07:00
bors
695e9fd13c auto merge of #5293 : brson/rust/logging, r=brson
r? @graydon

This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros.

After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later.

I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
2013-03-13 10:40:07 -07:00
Young-il Choi
2657723cc5 mk: rt.mk ar desinated by target-triples 2013-03-14 02:26:09 +09:00
Jed Davis
a301db7eef Represent enums with regular structs; no more alignment-breaking casts. 2013-03-13 10:25:49 -07:00
Brian Anderson
0ad3a110be Work around linkage bug cross-compiling from x86_64-apple-darwin to i686-apple-darwin
The correct opendir/readdir to use appear to be the 64-bit versions called
opendir$INODE64, etc. but for some reason I can't get them to link properly
on i686. Putting them in librustrt and making gcc figure it out works.
This mystery will have to wait for another day.
2013-03-12 21:01:40 -07:00
Young-il Choi
268faef63a mk: target triple rename arm-unknown-android->arm-linux-androideabi 2013-03-13 09:21:12 +09:00
Patrick Walton
b60c3bfa4a libcore: Attempt to put out burning tree on Mac by using the old symbol on 32 bit. rs=bustage 2013-03-12 15:27:45 -07:00
Brian Anderson
806732a70b core: Turn off rtdebug logging 2013-03-12 13:05:45 -07:00
Brian Anderson
3976e56bfe Disable debuginfo tests on mac since gdb requires root 2013-03-12 11:58:50 -07:00
bors
ece098667d auto merge of #5332 : jdm/rust/transitivelink, r=graydon
The original change bit Servo because rust-harfbuzz includes libharfbuzz.a in its link_args. This works fine in the rust-harfbuzz subdirectory where the static library resides, but when this is propagated to servo_gfx, the lirbrary can no longer be found since it's a relative path.
2013-03-12 11:06:55 -07:00
Brian Anderson
05c103238d Increase tidy column limit to 100 2013-03-12 10:55:39 -07:00
bors
a9643d39f8 auto merge of #5320 : apasel422/rust/metaderive, r=graydon
This is the first in a series of patches I'm working on to clean up the code related to `deriving`. This patch allows

```
#[deriving_eq]
#[deriving_iter_bytes]
#[deriving_clone]
struct Foo { bar: uint }
```
to be replaced with:
```
#[deriving(Eq, IterBytes, Clone)]
struct Foo { bar: uint }
```
It leaves the old attributes alone for the time being.

Eventually I'd like to incorporate the new closest-match-suggestion infrastructure for mistyped trait names, and also pass the sub-attributes to the deriving code, so that the following will be possible:
```
#[deriving(TotalOrd(qux, bar))]
struct Foo { bar: uint, baz: char, qux: int }
```
This says to derive an `impl` in which the objects' `qux` fields are compared first, followed by `bar`, while `baz` is ignored in the comparison. If no fields are specified explicitly, all fields will be compared in the order they're defined in the `struct`. This might also be useful for `Eq`. Coming soon.
2013-03-12 10:09:55 -07:00
Tim Chevalier
f9269a1bda rustc: One Less Bad Copy 2013-03-12 10:04:35 -07:00
Andrew Paseltiner
24efea7208 syntax: implement #[deriving] meta-attribute 2013-03-12 12:52:39 -04:00
bors
15d78fc398 auto merge of #5329 : wanderview/rust/std-getopts-opts_present, r=graydon
Currently the opts_present() function only checks to see if the option is
configured in the match, but doesn't actually check to see if the option
value has been set.  This means that opt_present('h') may return false while
opts_present([~'h']) returns true.

Add a test case to catch this condition and fix opts_present() to check
the value before returning true.

Note, there is another API difference between these two functions that this
does not address.  Currently if you pass a non-configured option to
opt_present() the program will fail!(), but opts_present() simply returns
false.  If it is acceptable to standardize on the fail!() then opts_present()
should probably be implemented in terms of the opt_present() function.
2013-03-12 09:21:56 -07:00
bors
34aaf350c2 auto merge of #5317 : luqmana/rust/inline-asm, r=graydon
```Rust
#[cfg(target_os = "macos")]
fn helloworld() {
    unsafe {
        asm!(".pushsection __RODATA, __rodata
                  msg: .asciz \"Hello World!\"
              .popsection
              movq msg@GOTPCREL(%rip), %rdi
              call _puts");
    }
}

#[cfg(target_os = "linux")]
fn helloworld() {
    unsafe {
        asm!(".pushsection .rodata
                  msg: .asciz \"Hello World!\"
              .popsection
              movq msg@GOTPCREL(%rip), %rdi
              call puts");
    }
}

fn main() {
    helloworld();
}
```

```
% rustc foo.rs
% ./foo
Hello World!
```
2013-03-12 07:51:54 -07:00
Young-il Choi
773fb1a861 regression patch libuv submodule 2013-03-12 22:50:23 +09:00
bors
014620af90 auto merge of #5335 : larryv/rust/local_stage0-libsyntax, r=luqmana
The `local_stage0.sh` script was not updated after commit 7dcbaed renamed
librustsyntax to libsyntax.

Currently, `./configure --enable-local-rust --local-rust-root=FOO && make` will
fail due to the missing libsyntax; this change corrects this.
2013-03-12 02:45:42 -07:00
bors
b5334c3095 auto merge of #5333 : brson/rust/context, r=brson
ARM definitely compiles
2013-03-12 01:51:43 -07:00
Luqman Aden
18b71a7831 Add alignstack option for inline asm. 2013-03-12 01:03:35 -07:00
Luqman Aden
7f500ab4c1 Keep everything tidy. 2013-03-12 01:03:34 -07:00
Luqman Aden
5aa734d6a1 Parse operands properly and add a way to indicate volatile asm. 2013-03-12 01:03:34 -07:00
Luqman Aden
885d0d3d33 Stop parsing __asm__. 2013-03-12 01:03:34 -07:00
Luqman Aden
666e1b4636 Create asm! syntax extension. 2013-03-12 01:03:34 -07:00
Luqman Aden
bcc6c3e3db Require unsafe block for inline assembly. 2013-03-12 01:03:34 -07:00
Luqman Aden
fc78b93c41 Wrap llvm::InlineAsm::AsmDialect 2013-03-12 01:03:34 -07:00
Luqman Aden
ecccc0d649 Parse inline assembly. 2013-03-12 01:03:34 -07:00
bors
a95b933350 auto merge of #5328 : bstrie/rust/optadd, r=graydon
This will allow you to use the `+` operator to add together any two
Options, assuming that the contents of each Option likewise implement
`+`. So Some(4) + Some(1) == Some(5), and adding with None leaves the
other value unchanged.

This might be monoidic? I don't know what that word means!
2013-03-12 00:57:43 -07:00
Lawrence Velázquez
1d315aac44 Copy libsyntax from local Rust to stage0.
The local_stage0 script was not updated after commit 7dcbaed renamed
librustsyntax to libsyntax, so builds using local Rust fail due to
missing libsyntax.
2013-03-12 03:47:28 -04:00
bors
4e350c7ce7 auto merge of #5324 : brson/rust/relnotes, r=graydon
r?
2013-03-12 00:06:45 -07:00
Brian Anderson
e28d4b3516 core: Add context switching for ARM and MIPS
ARM definitely compiles
2013-03-11 23:33:05 -07:00
Brian Anderson
9c7e16e48d Remove the log keyword (by renaming it to __log)
We can't quite remove logging from the language, but this hides the
keyword.
2013-03-11 23:19:42 -07:00
Brian Anderson
cb37d09f50 core: Remove logging constants 2013-03-11 23:19:42 -07:00
Brian Anderson
82f190355b Remove uses of log 2013-03-11 23:19:42 -07:00
bors
2fef18abf2 auto merge of #5310 : thestinger/rust/treeset, r=graydon 2013-03-11 22:09:43 -07:00
Josh Matthews
1e1efbf2c3 Avoid propagating link_arg values that are unlikely to be resolveable under arbitrary directories. 2013-03-12 00:50:19 -04:00
bors
9b9ffd5b41 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.
2013-03-11 21:12:43 -07:00
bors
48cb9a8ac0 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.
2013-03-11 20:21:45 -07:00
Ben Kelly
4f4f69d731 Fix std::getopts::opts_present() to check value.
Currently the opts_present() function only checks to see if the option is
configured in the match, but doesn't actually check to see if the option
value has been set.  This means that opt_present('h') may return false while
opts_present([~'h']) returns true.

Add a test case to catch this condition and fix opts_present() to check
the value before returning true.

Note, there is another API difference between these two functions that this
does not address.  Currently if you pass a non-configured option to
opt_present() the program will fail!(), but opts_present() simply returns
false.  If it is acceptable to standardize on the fail!() then opts_present()
should probably be implemented in terms of the opt_present() function.
2013-03-11 23:12:31 -04:00
Ben Striegel
a21b43c6bb Implement Add on Option types
This will allow you to use the + operator to add together any two
Options, assuming that the contents of each Option likewise implement
+. So Some(4) + Some(1) == Some(5), and adding with None leaves the
other value unchanged.

This might be monoidic? I don't know what that word means!
2013-03-11 22:46:16 -04:00
Brian Anderson
676e0290ed core: Add rt mod and add the new scheduler code 2013-03-11 19:44:29 -07:00
Daniel Micay
9b1a9ec4ea treemap: fix a bug in the union implementation 2013-03-11 22:36:23 -04:00
Daniel Micay
2889a8a4e5 treemap: add more set tests 2013-03-11 22:36:23 -04:00
Daniel Micay
66afa5d17a treemap: refactor the set operation tests 2013-03-11 22:36:19 -04:00
Brian Anderson
5d3d0890a7 Work on 0.6 release notes 2013-03-11 18:29:13 -07:00
bors
a6bb4a0f1a auto merge of #5292 : thestinger/rust/nil, r=graydon 2013-03-11 17:27:43 -07:00
bors
f4dba956ec auto merge of #5322 : brson/rust/4812, r=brson
Supersedes #5013
2013-03-11 16:39:43 -07:00