Commit Graph

16233 Commits

Author SHA1 Message Date
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
Brian Anderson
7e5995197f core: Convert obsolete fn syntax 2013-03-11 15:42:00 -07:00
Jeff Olson
3aa92a91c9 core: convert asserts to fail_unless! 2013-03-11 15:38:55 -07:00
Jeff Olson
5ff66f0405 core: link pthreads explicitly in linux build 2013-03-11 15:38:55 -07:00
Jeff Olson
cf82360e72 core: formatting appeasement 2013-03-11 15:38:55 -07:00
Jeff Olson
a04ba76f8e core: fix broken tests on windows 2013-03-11 15:38:55 -07:00
Jeff Olson
25c3c363a8 core: change import of exchange_alloc for win32 os::_list_dir 2013-03-11 15:38:55 -07:00
Jeff Olson
a69a2acfba rt/core: port os::list_dir to rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
53db6c7e2a core: rt/core: impl os::env() in rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
4bc26ce575 rt/core: impl os::getcwd() in rust ref #4812 2013-03-11 15:38:55 -07:00
Brian Leibig
6152425180 More descriptive error messages for debug info tests 2013-03-11 14:09:06 -07:00
Brian Leibig
f1928d8e2c Re-enable struct value printing in debug info tests with gdb pretty printing off 2013-03-11 14:09:06 -07:00
Brian Leibig
c913eff51d Disable struct value printing in debug info tests
This is due to the way different versions of gdb print out structs: older versions have them always spread out with fields on different lines, while newer versions will compactly print them on one line. This makes it hard for the output checker to verify the expected output.
2013-03-11 14:09:06 -07:00
Brian Leibig
c978025d0d Debuginfo revamp 2013-03-11 14:09:06 -07:00
bors
878a31066d auto merge of #5305 : brson/rust/mut_buf_as_slice, r=brson
r?

Like `buf_as_slice` but for mutable pointers and slices.
2013-03-11 14:06:50 -07:00
Brian Anderson
c88ce30c48 core: Add vec::raw::mut_buf_as_slice 2013-03-11 13:44:32 -07:00