]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agolibrustc: Respect #[link_name] on extern statics. Fixes #9270
Luqman Aden [Wed, 18 Sep 2013 01:03:56 +0000 (21:03 -0400)]
librustc: Respect #[link_name] on extern statics. Fixes #9270

10 years agoauto merge of #9245 : kballard/rust/bytes-span, r=catamorphism
bors [Tue, 17 Sep 2013 15:45:44 +0000 (08:45 -0700)]
auto merge of #9245 : kballard/rust/bytes-span, r=catamorphism

This constrains the span to the appropriate argument, so you know which
one caused the problem. Instead of

    foo.rs:2:4: 2:21 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                ^~~~~~~~~~~~~~~~~

it will say

    foo.rs:2:14 2:17 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                          ^~~

10 years agoauto merge of #9244 : thestinger/rust/drop, r=catamorphism
bors [Tue, 17 Sep 2013 14:15:42 +0000 (07:15 -0700)]
auto merge of #9244 : thestinger/rust/drop, r=catamorphism

This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.

10 years agoauto merge of #9241 : alexcrichton/rust/build-rustdoc-ng, r=catamorphism
bors [Tue, 17 Sep 2013 13:00:45 +0000 (06:00 -0700)]
auto merge of #9241 : alexcrichton/rust/build-rustdoc-ng, r=catamorphism

Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).

Note that some `rustdoc_ng` tests were removed, but @cmr says they weren't supposed to be there in the first place. The rustdoc_ng code should also be included in `make install` and `make dist` now.

10 years agoauto merge of #9239 : steveklabnik/rust/rustpkg_tutorial, r=catamorphism
bors [Tue, 17 Sep 2013 11:45:45 +0000 (04:45 -0700)]
auto merge of #9239 : steveklabnik/rust/rustpkg_tutorial, r=catamorphism

First shot at a new tutorial for rustpkg. /cc @catamorphism

Right now, I'm linking to my sample package on GitHub, I'm not sure that everyone would be comfortable with me having that there. Maybe under the mozilla org? I think having one to install and hold up as a default makes sense.

10 years agoauto merge of #9234 : steveklabnik/rust/rustpkg_manpage, r=cmr
bors [Tue, 17 Sep 2013 10:30:48 +0000 (03:30 -0700)]
auto merge of #9234 : steveklabnik/rust/rustpkg_manpage, r=cmr

Closes #9221.

"rustpkg test" isn't implemented yet, so it shouldn't be in the manpage. Referring interested parties to the manual is probably
the right thing for now; eventually, these documents should merge.

/cc @catamorphism

10 years agoauto merge of #9225 : huonw/rust/closing-time, r=alexcrichton
bors [Tue, 17 Sep 2013 09:15:49 +0000 (02:15 -0700)]
auto merge of #9225 : huonw/rust/closing-time, r=alexcrichton

Closes #2074.
Closes #5008.
Closes #7519.
Closes #7673.
Closes #7770.
Closes #8171.

10 years agoTests for fixed issues.
Huon Wilson [Mon, 16 Sep 2013 13:05:47 +0000 (23:05 +1000)]
Tests for fixed issues.

Closes #2074.
Closes #5008.
Closes #7519.
Closes #7673.
Closes #7770.
Closes #8171.

10 years agoauto merge of #9214 : adridu59/rust/issue-7723, r=thestinger
bors [Tue, 17 Sep 2013 08:00:47 +0000 (01:00 -0700)]
auto merge of #9214 : adridu59/rust/issue-7723, r=thestinger

This avoids default CRLF on msysgit for Windows which can cause trouble.
Cf. https://help.github.com/articles/dealing-with-line-endings#text-eollf

Closes #7723.

10 years agoauto merge of #9130 : alexcrichton/rust/inline-globals, r=thestinger
bors [Tue, 17 Sep 2013 06:45:49 +0000 (23:45 -0700)]
auto merge of #9130 : alexcrichton/rust/inline-globals, r=thestinger

In #8185 cross-crate condition handlers were fixed by ensuring that globals
didn't start appearing in different crates with different addressed. An
unfortunate side effect of that pull request is that constants weren't inlined
across crates (uint::bits is unknown to everything but libstd).

This commit fixes this inlining by using the `available_eternally` linkage
provided by LLVM. It partially reverts #8185, and then adds support for this
linkage type. The main caveat is that not all statics could be inlined into
other crates. Before this patch, all statics were considered "inlineable items",
but an unfortunate side effect of how we deal with `&static` and `&[static]`
means that these two cases cannot be inlined across crates. The translation of
constants was modified to propogate this condition of whether a constant
should be considered inlineable into other crates.

Closes #9036

10 years agoauto merge of #9237 : brson/rust/valgrind, r=thestinger
bors [Tue, 17 Sep 2013 05:30:51 +0000 (22:30 -0700)]
auto merge of #9237 : brson/rust/valgrind, r=thestinger

This fixes valgrind on the linux snapshot bot. The command added here
makes us require a fairly recent valgrind.

10 years agoauto merge of #9233 : catamorphism/rust/issue-4208, r=catamorphism
bors [Tue, 17 Sep 2013 04:15:51 +0000 (21:15 -0700)]
auto merge of #9233 : catamorphism/rust/issue-4208, r=catamorphism

Closes #4208

10 years agoauto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton
bors [Tue, 17 Sep 2013 02:35:50 +0000 (19:35 -0700)]
auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichton

Fix uint overflow bugs in std::{at_vec, vec, str}

Closes #8742

Fix issue #8742, which summarized is: unsafe code in vec and str did assume
that a reservation for `X + Y` elements always succeeded, and didn't overflow.

Introduce the method `Vec::reserve_additional(n)` to make it easy to check for
overflow in `Vec::push` and `Vec::push_all`.

In std::str, simplify and remove a lot of the unsafe code and use `push_str`
instead. With improvements to `.push_str` and the new function
`vec::bytes::push_bytes`, it looks like this change has either no or positive
impact on performance.

I believe there are many places still where `v.reserve(A + B)` still can overflow.
This by itself is not an issue unless followed by (unsafe) code that steps aside
boundary checks.

10 years agoswitch Drop to `&mut self`
Daniel Micay [Tue, 17 Sep 2013 01:18:07 +0000 (21:18 -0400)]
switch Drop to `&mut self`

10 years agoLimit spans in bytes!() error messages to the argument in question
Kevin Ballard [Tue, 17 Sep 2013 01:02:33 +0000 (18:02 -0700)]
Limit spans in bytes!() error messages to the argument in question

This constrains the span to the appropriate argument, so you know which
one caused the problem. Instead of

  foo.rs:2:4: 2:21 error: Too large integer literal in bytes!
  foo.rs:2    bytes!(1, 256, 2)
              ^~~~~~~~~~~~~~~~~

it will say

  foo.rs:2:14 2:17 error: Too large integer literal in bytes!
  foo.rs:2    bytes!(1, 256, 2)
                        ^~~

10 years agoUpdating rustpkg tutorial from feedback.
Steve Klabnik [Tue, 17 Sep 2013 01:49:47 +0000 (18:49 -0700)]
Updating rustpkg tutorial from feedback.

10 years agoAdd the rustdoc_ng binary to the makefile rules
Alex Crichton [Mon, 16 Sep 2013 23:31:04 +0000 (16:31 -0700)]
Add the rustdoc_ng binary to the makefile rules

Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).

10 years agoauto merge of #9231 : cmr/rust/enum_encoding, r=catamorphism
bors [Tue, 17 Sep 2013 00:55:46 +0000 (17:55 -0700)]
auto merge of #9231 : cmr/rust/enum_encoding, r=catamorphism

10 years agostd::at_vec: Fix segfault on overflow when resizing ~[@T]
blake2-ppc [Thu, 12 Sep 2013 03:00:25 +0000 (05:00 +0200)]
std::at_vec: Fix segfault on overflow when resizing ~[@T]

Easy to reproduce:

    let mut v = ~[@1];
    v.resize(-1);  // success a.k.a silent failure
    v.push(@2); // segfault

10 years agort::io: Use vec::reserve_additional
blake2-ppc [Tue, 10 Sep 2013 23:57:08 +0000 (01:57 +0200)]
rt::io: Use vec::reserve_additional

10 years agostd::str: Fix overflow problems in unsafe code
blake2-ppc [Tue, 10 Sep 2013 22:53:21 +0000 (00:53 +0200)]
std::str: Fix overflow problems in unsafe code

See issue #8742

10 years agoNew rustpkg tutorial.
Steve Klabnik [Mon, 16 Sep 2013 23:30:49 +0000 (16:30 -0700)]
New rustpkg tutorial.

10 years agoUpdate syntax test
Corey Richardson [Mon, 16 Sep 2013 23:12:54 +0000 (19:12 -0400)]
Update syntax test

10 years agoauto merge of #9109 : thestinger/rust/function, r=alexcrichton
bors [Mon, 16 Sep 2013 22:50:47 +0000 (15:50 -0700)]
auto merge of #9109 : thestinger/rust/function, r=alexcrichton

10 years agoset attributes on `invoke` instructions too
Daniel Micay [Mon, 16 Sep 2013 22:30:59 +0000 (18:30 -0400)]
set attributes on `invoke` instructions too

also removes the unused `FastInvoke` wrapper, as it's never actually
going to be used (we can't *partially* switch to `fastcc`, and this is
only used for Rust functions)

10 years agomk: Fix valgrinding with jemalloc
Brian Anderson [Mon, 16 Sep 2013 22:25:01 +0000 (15:25 -0700)]
mk: Fix valgrinding with jemalloc

This fixes valgrind on the linux snapshot bot. The command added here
makes us require a fairly recent valgrind.

10 years agoFix hardcoded string in libsyntax
Corey Richardson [Mon, 16 Sep 2013 21:12:53 +0000 (17:12 -0400)]
Fix hardcoded string in libsyntax

10 years agoUpdate rustpkg man page.
Steve Klabnik [Mon, 16 Sep 2013 20:51:02 +0000 (13:51 -0700)]
Update rustpkg man page.

Closes #9221.

"rustpkg test" isn't implemented yet, so it shouldn't be in the manpage. Referring interested parties to the manual is probably
the right thing for now; eventually, these documents should merge.

10 years agoauto merge of #9223 : sfackler/rust/tasks-fix, r=catamorphism
bors [Mon, 16 Sep 2013 20:30:42 +0000 (13:30 -0700)]
auto merge of #9223 : sfackler/rust/tasks-fix, r=catamorphism

This module was removed a while ago, but the tasks tutorial wasn't
updated, and the old docs page for pipes was never deleted so the link
confusingly still worked!

10 years agotestsuite: Add test for #4208
Tim Chevalier [Mon, 16 Sep 2013 19:02:27 +0000 (12:02 -0700)]
testsuite: Add test for #4208

Closes #4208

10 years agoauto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichton
bors [Mon, 16 Sep 2013 18:30:42 +0000 (11:30 -0700)]
auto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichton

10 years agodocument why attributes are set on CallInst
Daniel Micay [Fri, 13 Sep 2013 04:48:49 +0000 (00:48 -0400)]
document why attributes are set on CallInst

10 years agoadd sret + noalias to the out pointer parameter
Daniel Micay [Tue, 10 Sep 2013 18:28:59 +0000 (14:28 -0400)]
add sret + noalias to the out pointer parameter

This brings Rust in line with how `clang` handles return pointers.

Example:

    pub fn bar() -> [uint, .. 8] {
        let a = [0, .. 8];
        a
    }

Before:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* nocapture, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %a = alloca [8 x i64], align 8
      %2 = bitcast [8 x i64]* %a to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      %3 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 64, i32 8, i1 false)
      ret void
    }

After:

    ; Function Attrs: nounwind uwtable
    define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 {
    "function top level":
      %2 = bitcast [8 x i64]* %0 to i8*
      call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false)
      ret void
    }

Closes #9072
Closes #7298
Closes #9154

10 years agofix handling of function attributes
Daniel Micay [Tue, 10 Sep 2013 22:42:01 +0000 (18:42 -0400)]
fix handling of function attributes

The `noalias` attributes were being set only on function definitions,
not on all declarations. This is harmless for `noalias`, but prevented
some optimization opportunities and is *not* harmless for other
attributes like `sret` with ABI implications.

Closes #9104

10 years agoauto merge of #9204 : lkuper/rust/workcache, r=alexcrichton
bors [Mon, 16 Sep 2013 17:15:43 +0000 (10:15 -0700)]
auto merge of #9204 : lkuper/rust/workcache, r=alexcrichton

This just removes the stray "foo.c" that `workcache::test` leaves behind when, for example, `make check` runs.

10 years agostd::str: Add bench tests for StrVector::connect() and for str::push_str
blake2-ppc [Wed, 11 Sep 2013 00:16:11 +0000 (02:16 +0200)]
std::str: Add bench tests for StrVector::connect() and for str::push_str

10 years agostd::vec: Add function vec::bytes::push_bytes
blake2-ppc [Tue, 10 Sep 2013 22:52:46 +0000 (00:52 +0200)]
std::vec: Add function vec::bytes::push_bytes

`push_bytes` is implemented with `ptr::copy_memory` here since this
function is intended to be used to implement `.push_str()` for str, so
we want to avoid the overhead.

10 years agostd::vec: Fix hazards with uint overflows in unsafe code
blake2-ppc [Tue, 10 Sep 2013 21:29:10 +0000 (23:29 +0200)]
std::vec: Fix hazards with uint overflows in unsafe code

Issue #8742

Add the method `.reserve_additional(n: uint)`: Check for overflow in
self.len() + n, and reserve that many elements (rounded up to next power
of two). Does nothing if self.len() + n < self.capacity() already.

10 years agoextra::json: use a different encoding for enums.
Corey Richardson [Sat, 10 Aug 2013 00:05:24 +0000 (20:05 -0400)]
extra::json: use a different encoding for enums.

It now uses `{"type": VariantName, "fields": [...]}`, which, according to
@Seldaek, since all enums will have the same "shape" rather than being a weird
ad-hoc array, will optimize better in javascript JITs. It also looks prettier,
and makes more sense.

10 years agoauto merge of #9192 : Kimundi/rust/master, r=huonw
bors [Mon, 16 Sep 2013 16:00:44 +0000 (09:00 -0700)]
auto merge of #9192 : Kimundi/rust/master, r=huonw

A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.

Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.

SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.

This basically reimplements #7599 and has a use case for replacing an similar type in `std::rt::logging` ( Added in #9180).

10 years agoCorrected a few small style issues
Marvin Löbel [Sun, 15 Sep 2013 12:06:30 +0000 (14:06 +0200)]
Corrected a few small style issues
Split up test function a bit

10 years agogitattributes: force LF line endings for all files
adridu59 [Sun, 15 Sep 2013 21:32:18 +0000 (23:32 +0200)]
gitattributes: force LF line endings for all files

This avoids default CRLF on msysgit for Windows which can cause trouble.
Cf. https://help.github.com/articles/dealing-with-line-endings#text-eollf

Commit dad2ccc9b3b27d3f438eeea53b771cc85f6dfa32 followup.
Closes #7723.

10 years agoAdd an SendStr type
Marvin Löbel [Sat, 14 Sep 2013 17:37:45 +0000 (19:37 +0200)]
Add an SendStr type

A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.

Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.

SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.

Replaced std::rt:logging::SendableString with SendStr
Added tests for using an SendStr as key in Hash- and Treemaps

10 years agoauto merge of #9121 : sanxiyn/rust/arm, r=alexcrichton
bors [Mon, 16 Sep 2013 14:45:45 +0000 (07:45 -0700)]
auto merge of #9121 : sanxiyn/rust/arm, r=alexcrichton

Ignore failing tests on Android to prepare for #9120.

10 years agoResume inlining globals across crates
Alex Crichton [Wed, 11 Sep 2013 17:06:16 +0000 (10:06 -0700)]
Resume inlining globals across crates

In #8185 cross-crate condition handlers were fixed by ensuring that globals
didn't start appearing in different crates with different addressed. An
unfortunate side effect of that pull request is that constants weren't inlined
across crates (uint::bits is unknown to everything but libstd).

This commit fixes this inlining by using the `available_eternally` linkage
provided by LLVM. It partially reverts #8185, and then adds support for this
linkage type. The main caveat is that not all statics could be inlined into
other crates. Before this patch, all statics were considered "inlineable items",
but an unfortunate side effect of how we deal with `&static` and `&[static]`
means that these two cases cannot be inlined across crates. The translation of
constants was modified to propogate this condition of whether a constant
should be considered inlineable into other crates.

Closes #9036

10 years agoIgnore failing tests on Android
Seo Sanghyeon [Mon, 16 Sep 2013 14:10:01 +0000 (23:10 +0900)]
Ignore failing tests on Android

10 years agoPass OS to gyp_uv
Seo Sanghyeon [Mon, 16 Sep 2013 14:09:50 +0000 (23:09 +0900)]
Pass OS to gyp_uv

10 years agoauto merge of #9220 : kballard/rust/c_str-as_str, r=thestinger
bors [Mon, 16 Sep 2013 13:30:51 +0000 (06:30 -0700)]
auto merge of #9220 : kballard/rust/c_str-as_str, r=thestinger

Also rustify .as_bytes(), so it no longer calls libc::strlen() and is
inlineable.

10 years agostd::num: Add uint::next_power_of_two_opt
blake2-ppc [Thu, 12 Sep 2013 03:05:12 +0000 (05:05 +0200)]
std::num: Add uint::next_power_of_two_opt

Like next_power_of_two, but returns None on overflow.

10 years agoauto merge of #8540 : cmr/rust/rustdoc_ng, r=catamorphism
bors [Mon, 16 Sep 2013 11:40:47 +0000 (04:40 -0700)]
auto merge of #8540 : cmr/rust/rustdoc_ng, r=catamorphism

This doesn't enable it by default yet, or include the frontend. But the tool
is pretty much done, and it'd be nice to stave off bitrot.

I couldn't get it to actually build with the Makefile though. I don't really
understand what is going on in that makefile at all. Could @graydon or
@pnkfelix lend a hand?

10 years agorustdoc_ng: add licenses and issue numbers to appease tidy
Corey Richardson [Fri, 13 Sep 2013 01:10:51 +0000 (21:10 -0400)]
rustdoc_ng: add licenses and issue numbers to appease tidy

10 years agoUpdate rustdoc_ng to syntax and metadata changes
Corey Richardson [Thu, 12 Sep 2013 19:11:06 +0000 (15:11 -0400)]
Update rustdoc_ng to syntax and metadata changes

10 years agoUpdate rustdoc_ng to new ast naming
Corey Richardson [Thu, 5 Sep 2013 14:14:35 +0000 (10:14 -0400)]
Update rustdoc_ng to new ast naming

10 years agoFinish addition of rustdoc_ng to Makefiles.
Felix S. Klock II [Sun, 1 Sep 2013 19:53:03 +0000 (21:53 +0200)]
Finish addition of rustdoc_ng to Makefiles.

10 years agoAdd rustdoc_ng
Corey Richardson [Thu, 15 Aug 2013 20:28:54 +0000 (16:28 -0400)]
Add rustdoc_ng

10 years agoauto merge of #9206 : alexcrichton/rust/issue-9188, r=catamorphism
bors [Mon, 16 Sep 2013 09:45:49 +0000 (02:45 -0700)]
auto merge of #9206 : alexcrichton/rust/issue-9188, r=catamorphism

While they may have the same name within various scopes, this changes static
names to use path_pretty_name to append some hash information at the end of the
symbol. We're then guaranteed that each static has a unique NodeId, so this
NodeId is as the "hash" of the pretty name.

Closes #9188

10 years agoauto merge of #9196 : alexcrichton/rust/attempting-9055, r=cmr
bors [Mon, 16 Sep 2013 08:30:52 +0000 (01:30 -0700)]
auto merge of #9196 : alexcrichton/rust/attempting-9055, r=cmr

Beforehand it was assumed that the standard cdecl abi was used for all extern
fns of extern crates, but this reads the abi of the extern fn type and declares
the function in the local crate with the appropriate type.

I was trying to think of how to write a test for this, but I was just drawing up blanks :(. Are there standard functions in libc which are not of the cdecl abi? If so we could try linking to them and make sure that the cal completes successfully.

Otherwise, I manually verified that the function was declared correctly by looking at the llvm assembly.

cc #9055 (I'm not sure if this will fix that issue)

10 years agoauto merge of #9187 : lkuper/rust/no-simplevisitor, r=catamorphism
bors [Mon, 16 Sep 2013 07:15:52 +0000 (00:15 -0700)]
auto merge of #9187 : lkuper/rust/no-simplevisitor, r=catamorphism

We don't seem to be using `SimpleVisitor` anywhere in rustc.  Is there any reason to keep it around?

r? anyone

10 years agoRemove references to std::pipes from task tutorial
Steven Fackler [Mon, 16 Sep 2013 06:33:00 +0000 (23:33 -0700)]
Remove references to std::pipes from task tutorial

This module was removed a while ago, but the tasks tutorial wasn't
updated, and the old docs page for pipes was never deleted so the link
confusingly still worked!

10 years agoauto merge of #9118 : alexcrichton/rust/llvm-fix, r=sanxiyn
bors [Mon, 16 Sep 2013 05:30:55 +0000 (22:30 -0700)]
auto merge of #9118 : alexcrichton/rust/llvm-fix, r=sanxiyn

I created a new branch  rust-llvm-2013-09-11 in my llvm repo to mark this momentous occasion

10 years agoHave workcache::test put `foo.c` in the same directory it runs in.
Lindsey Kuper [Mon, 16 Sep 2013 04:52:36 +0000 (00:52 -0400)]
Have workcache::test put `foo.c` in the same directory it runs in.

This prevents a stray `foo.c` from being left lying around after tests
run, and it's more consistent with the rest of the code.

10 years agoauto merge of #9219 : thestinger/rust/function-split, r=alexcrichton
bors [Mon, 16 Sep 2013 04:00:54 +0000 (21:00 -0700)]
auto merge of #9219 : thestinger/rust/function-split, r=alexcrichton

10 years agoWhen declaring extern fns from external crates, use the correct abi
Alex Crichton [Sat, 14 Sep 2013 17:46:29 +0000 (10:46 -0700)]
When declaring extern fns from external crates, use the correct abi

Beforehand it was assumed that the standard cdecl abi was used for all extern
fns of extern crates, but this reads the abi of the extern fn type and declares
the function in the local crate with the appropriate type.

10 years agoteach Call/CallWithConv to set attributes
Daniel Micay [Fri, 13 Sep 2013 04:14:17 +0000 (00:14 -0400)]
teach Call/CallWithConv to set attributes

10 years agoc_str: Add new method .as_str() -> Option<&str>
Kevin Ballard [Mon, 16 Sep 2013 03:30:03 +0000 (20:30 -0700)]
c_str: Add new method .as_str() -> Option<&str>

Also rustify .as_bytes(), so it no longer calls libc::strlen() and is
inlineable.

10 years agoUpgrade LLVM to close #9117
Alex Crichton [Wed, 11 Sep 2013 08:41:40 +0000 (01:41 -0700)]
Upgrade LLVM to close #9117

10 years agoremove unused `FastCall` wrapper
Daniel Micay [Fri, 13 Sep 2013 03:41:01 +0000 (23:41 -0400)]
remove unused `FastCall` wrapper

this can just be done using CallWithConv

10 years agostd::rt::uv::file: Enable tests on Win32
klutzy [Mon, 16 Sep 2013 03:01:24 +0000 (12:01 +0900)]
std::rt::uv::file: Enable tests on Win32

Closes #8814.

10 years agoextra::fileinput: Enable tests on Win32
klutzy [Mon, 16 Sep 2013 01:55:11 +0000 (10:55 +0900)]
extra::fileinput: Enable tests on Win32

They were blocked by #8810, but it works now.

10 years agostd::rt::uv::uvio: Enable tests on Win32
klutzy [Mon, 16 Sep 2013 01:30:00 +0000 (10:30 +0900)]
std::rt::uv::uvio: Enable tests on Win32

Closes #8816.

10 years agoauto merge of #9213 : dcrewi/rust/rust-test-arguments, r=catamorphism
bors [Sun, 15 Sep 2013 21:00:52 +0000 (14:00 -0700)]
auto merge of #9213 : dcrewi/rust/rust-test-arguments, r=catamorphism

The arguments after `rust test filename.rs` should be passed through
to the test binary. This allows the `rust` command to be used to run a
subset of tests, to run ignored tests, and to run benchmarks.

10 years agorust test: pass the remaining arguments through
David Creswick [Sun, 15 Sep 2013 19:43:35 +0000 (14:43 -0500)]
rust test: pass the remaining arguments through

The arguments after `rust test filename.rs` should be passed through
to the test binary. This allows the `rust` command to be used to run a
subset of tests, to run ignored tests, and to run benchmarks.

10 years agoauto merge of #9168 : michaelwoerister/rust/traits, r=jdm
bors [Sun, 15 Sep 2013 18:55:49 +0000 (11:55 -0700)]
auto merge of #9168 : michaelwoerister/rust/traits, r=jdm

This pull request finally adds support for recursive type definitions and provides a stub implementation for object pointers.

10 years agostd::rt::io::net::tcp: Fix one tcp test on Win32
klutzy [Sun, 15 Sep 2013 18:45:20 +0000 (03:45 +0900)]
std::rt::io::net::tcp: Fix one tcp test on Win32

Fixes `connect_error` part of #8811.

10 years agostd::rt::uv::uvll: Fix uv_req_type on Win32
klutzy [Sun, 15 Sep 2013 18:13:42 +0000 (03:13 +0900)]
std::rt::uv::uvll: Fix uv_req_type on Win32

Also enables request_sanity_check() test.

Closes #8817

10 years agostd::os: Use unicode for last_os_error() on Win32
klutzy [Sun, 15 Sep 2013 15:02:58 +0000 (00:02 +0900)]
std::os: Use unicode for last_os_error() on Win32

FormatMessageA may return non-ascii message,
which is encoded as system code page, not utf8.
This may cause `assert!(is_utf8(v))` failure on
some non-English machines.
This patch replaces it with FormatMessageW,
which returns utf-16 message.

Fixes `make check-stage2-std` failure on my machine. :)

10 years agostd::rt::io::support: Fix ignored test on Win32
klutzy [Sun, 15 Sep 2013 14:18:47 +0000 (23:18 +0900)]
std::rt::io::support: Fix ignored test on Win32

Assumes drive C: exists.

Closes #8812.

10 years agoauto merge of #9150 : catamorphism/rust/rustpkg-cleanup, r=catamorphism
bors [Sun, 15 Sep 2013 17:25:48 +0000 (10:25 -0700)]
auto merge of #9150 : catamorphism/rust/rustpkg-cleanup, r=catamorphism

Just refactoring in tests.rs.

10 years agorustpkg: Cleanup
Tim Chevalier [Fri, 13 Sep 2013 01:48:02 +0000 (18:48 -0700)]
rustpkg: Cleanup

10 years agodebuginfo: Added LLVMDICompositeTypeSetTypeArray to rustllvm.def.in
Michael Woerister [Sun, 15 Sep 2013 15:52:56 +0000 (17:52 +0200)]
debuginfo: Added LLVMDICompositeTypeSetTypeArray to rustllvm.def.in

10 years agoauto merge of #9209 : blake2-ppc/rust/from-str, r=thestinger
bors [Sun, 15 Sep 2013 15:35:50 +0000 (08:35 -0700)]
auto merge of #9209 : blake2-ppc/rust/from-str, r=thestinger

Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.

Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.

With `from_str` in the prelude, and `from_str_radix` in `std::num`, the feature is unfied under the type annotation of these functions instead of using the modules-named-as-types (std::uint and others):

What was before:

    let n = std::uint::from_str("1");
    let m = std::i32::from_str_radix("10", 16);

is now:

    let n = from_str::<uint>("1");
    let m = std::num::from_str_radix::<i32>("10", 16);

10 years agostd::rt::io::file: Enable I/O tests on Win32
klutzy [Sun, 15 Sep 2013 14:10:56 +0000 (23:10 +0900)]
std::rt::io::file: Enable I/O tests on Win32

Enable blocked tests which are now fixed by #9165.

Closes #8810.

10 years agoRemove {uint,int,u64,i64,...}::from_str,from_str_radix
blake2-ppc [Sun, 15 Sep 2013 05:27:32 +0000 (07:27 +0200)]
Remove {uint,int,u64,i64,...}::from_str,from_str_radix

Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.

Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.

10 years agodebuginfo: Some namespace-related cleanup.
Michael Woerister [Sun, 15 Sep 2013 10:26:47 +0000 (12:26 +0200)]
debuginfo: Some namespace-related cleanup.

10 years agodebuginfo: Fix style nits for pull request.
Michael Woerister [Sun, 15 Sep 2013 09:22:22 +0000 (11:22 +0200)]
debuginfo: Fix style nits for pull request.

10 years agodebuginfo: Added description of algorithm for handling recursive types.
Michael Woerister [Fri, 13 Sep 2013 14:26:35 +0000 (16:26 +0200)]
debuginfo: Added description of algorithm for handling recursive types.

Also fixed nasty bug caused by calling LLVMDIBuilderCreateStructType() with a null pointer where an empty array was expected (which would trigger an unintelligable assertion somewhere down the line).

10 years agodebuginfo: Added test cases for recursive structs.
Michael Woerister [Fri, 13 Sep 2013 09:41:49 +0000 (11:41 +0200)]
debuginfo: Added test cases for recursive structs.

10 years agodebuginfo: Support for recursive types.
Michael Woerister [Wed, 11 Sep 2013 14:37:43 +0000 (16:37 +0200)]
debuginfo: Support for recursive types.

10 years agodebuginfo: Implement DI for ty_opaque_box.
Michael Woerister [Wed, 11 Sep 2013 12:09:18 +0000 (14:09 +0200)]
debuginfo: Implement DI for ty_opaque_box.

10 years agodebuginfo: Basic support for trait objects.
Michael Woerister [Wed, 11 Sep 2013 09:08:44 +0000 (11:08 +0200)]
debuginfo: Basic support for trait objects.

10 years agoauto merge of #9153 : alexcrichton/rust/simplify-format, r=huonw
bors [Sun, 15 Sep 2013 08:50:50 +0000 (01:50 -0700)]
auto merge of #9153 : alexcrichton/rust/simplify-format, r=huonw

This follows from the discussion in #9012.

* All macros are now defined in terms of `format_args!` allowing for removal of a good bit of code in the syntax extension
* The syntax extension is now in a more aptly-named file, `format.rs`
* Documentation was added for the `format!`-related macros.

10 years agoFix expand_stmt as well as expand_expr to use the correct span
Alex Crichton [Sun, 15 Sep 2013 08:27:38 +0000 (01:27 -0700)]
Fix expand_stmt as well as expand_expr to use the correct span

The same fix as before is still relevant, I just forgot to update the
expand_stmt macro expansion site. The tests for format!() suffice as tests for
this change.

10 years agoDocument all of the format! related macros
Alex Crichton [Fri, 13 Sep 2013 03:08:50 +0000 (20:08 -0700)]
Document all of the format! related macros

10 years agoReduce the amount of complexity in format!
Alex Crichton [Fri, 13 Sep 2013 02:36:58 +0000 (19:36 -0700)]
Reduce the amount of complexity in format!

This renames the syntax-extension file to format from ifmt, and it also reduces
the amount of complexity inside by defining all other macros in terms of
format_args!

10 years agoGuarantee that statics have unique names
Alex Crichton [Sun, 15 Sep 2013 06:19:11 +0000 (23:19 -0700)]
Guarantee that statics have unique names

While they may have the same name within various scopes, this changes static
names to use path_pretty_name to append some hash information at the end of the
symbol. We're then guaranteed that each static has a unique NodeId, so this
NodeId is as the "hash" of the pretty name.

Closes #9188

10 years agoauto merge of #9203 : thestinger/rust/range_step, r=huonw
bors [Sun, 15 Sep 2013 06:00:52 +0000 (23:00 -0700)]
auto merge of #9203 : thestinger/rust/range_step, r=huonw

10 years agoiter: add the edge case tests for `range` too
Daniel Micay [Sun, 15 Sep 2013 04:54:32 +0000 (00:54 -0400)]
iter: add the edge case tests for `range` too

10 years agoauto merge of #9179 : catamorphism/rust/rustpkg-package-id, r=catamorphism,metajack
bors [Sun, 15 Sep 2013 04:45:49 +0000 (21:45 -0700)]
auto merge of #9179 : catamorphism/rust/rustpkg-package-id, r=catamorphism,metajack

r? @metajack - This solves the problem you were having earlier with things like ```extern mod geom = "rust-geom";``` (or something like that).

10 years agorm some uses of the `advance` iterator method
Daniel Micay [Sat, 14 Sep 2013 19:51:02 +0000 (15:51 -0400)]
rm some uses of the `advance` iterator method

10 years agoremove old internal iterator range tests
Daniel Micay [Sun, 15 Sep 2013 04:44:48 +0000 (00:44 -0400)]
remove old internal iterator range tests

The cases they test are well covered in the `std::iter` tests.