Commit Graph

23096 Commits

Author SHA1 Message Date
Daniel Micay
ef3ec1fe97 rename base_and_len -> base_and_byte_len 2013-10-16 12:00:31 -04:00
Daniel Micay
1e128d7931 remove executable flag from source file 2013-10-15 19:34:45 -04:00
Daniel Micay
e1a26ad271 use element count in slices, not size in bytes
This allows the indexing bounds check or other comparisons against an
element length to avoid a multiplication by the size.
2013-10-15 16:23:28 -04:00
Daniel Micay
aa93381e14 fix overflow on bounds checks
Closes #9020
2013-10-15 16:23:28 -04:00
Daniel Micay
420b4260b4 fix bounds checking failure message
casting the `uint` to an `int` can result in printing high values as
negative intege
2013-10-15 16:23:26 -04:00
bors
a7e8957c59 auto merge of #9823 : pnkfelix/rust/issue7655-bench-papercuts, r=alexcrichton
r? anyone.

You can see a bit more discussion on #7655.

This does not close any ticket; I am just scratching an itch.  Note in particular that I picked the value `{:>9} ns/iter` pretty much out of a hat.  :)
2013-10-14 15:06:36 -07:00
Felix S. Klock II
602b3cd56c Only use padded test names to calculate the target padding size. 2013-10-14 17:19:15 -04:00
Felix S. Klock II
c56bf67150 Issue 7655: align the bench printouts so that the numbers tend to be aligned.
(scratching an itch.)

Rebased and updated.
Fixed bug: omitted field init from embedded struct literal in a test.
Fixed bug: int underflow during padding length calculation.
2013-10-14 17:18:34 -04:00
bors
c8e77d5586 auto merge of #9606 : steveklabnik/rust/abi_removal, r=alexcrichton
They've been replaced by putting the name on the extern block.

  #[abi = "foo"]

goes to

  extern "foo" { }

Closes #9483.
2013-10-14 07:26:47 -07:00
bors
b571039021 auto merge of #9848 : huonw/rust/move-trait-doc, r=alexcrichton
This means the text is visible in rustdoc.
2013-10-14 06:16:32 -07:00
Steve Klabnik
309ab958e6 Removing ccdecl
as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872
2013-10-14 14:33:05 +02:00
Huon Wilson
a6d7fe6209 std::vec: move documentation from impls to traits.
This means the text is visible in rustdoc.
2013-10-14 22:21:47 +11:00
Steve Klabnik
16fc6a694c Remove unused abi attributes.
They've been replaced by putting the name on the extern block.

  #[abi = "foo"]

goes to

  extern "foo" { }

Closes #9483.
2013-10-14 13:10:36 +02:00
bors
5b10781c7b auto merge of #9844 : bytbox/rust/master, r=alexcrichton 2013-10-13 23:41:30 -07:00
bors
6aa556db3b auto merge of #9843 : sfackler/rust/rustdoc-strip-private, r=alexcrichton
In addition, the renderer will add comments to structs and enums saying
that fields or variants have been stripped.

The comments are currently
```rust
// some fields stripped
// some variants stripped
```

I was thinking of changing that to "some private..." but passes other than
strip-private may strip fields or variants as well.

cc @alexcrichton
2013-10-13 22:31:29 -07:00
Steven Fackler
d6d31d788d Make Rustdoc strip private fields
In addition, the renderer will add comments to structs and enums saying
that fields or variants have been stripped.
2013-10-13 22:28:45 -07:00
Scott Lawrence
85f19a845d std::libc: rustdoc indicates reexports now 2013-10-14 00:48:34 -04:00
bors
009c3d8bae auto merge of #9836 : eriklyon/rust/doc-typos, r=alexcrichton 2013-10-13 11:31:26 -07:00
Erik Lyon
8b65a45879 fix typos in doc/tutorial.md 2013-10-13 10:49:44 -07:00
bors
91abfd425d auto merge of #9832 : luqmana/rust/sps, r=alexcrichton
Fixes #9830.
2013-10-12 21:26:20 -07:00
Luqman Aden
e88064d18f librustc: Combine C_struct and C_packed_struct. 2013-10-12 23:19:22 -04:00
bors
0bad7e1a37 auto merge of #9608 : hmarr/rust/vec-get-opt, r=huonw
This adds `get_opt` to `std::vec`, which looks up an item by index and returns an `Option`. If the given index is out of range, `None` will be returned, otherwise a `Some`-wrapped item will be returned.

Example use case:

```rust
use std::os;

fn say_hello(name: &str) {
  println(fmt!("Hello, %s", name));
}

fn main(){
  // Try to get the first cmd line arg, but default to "World"
  let args = os::args();
  let default = ~"World";
  say_hello(*args.get_opt(1).unwrap_or(&default));
}
```

If there's an existing way of implementing this pattern that's cleaner, I'll happily close this. I'm also open to naming suggestions (`index_opt`?)
2013-10-12 20:16:19 -07:00
Luqman Aden
95609699e3 Update test for packed structs to also test being placed in statics. 2013-10-12 21:52:14 -04:00
Luqman Aden
4b4b2136e0 librustc: Don't ICE on packed structs in statics. 2013-10-12 21:42:24 -04:00
bors
c6e3501da1 auto merge of #9825 : thestinger/rust/rc, r=thestinger 2013-10-12 07:26:20 -07:00
Daniel Micay
ea0fc0e32b rc: fix docstring 2013-10-12 10:19:56 -04:00
bors
35a944a488 auto merge of #9815 : thestinger/rust/type, r=huonw
Example:

    void ({ i64, %tydesc*, i8*, i8*, i8 }*, i64*, %"struct.std::fmt::Formatter[#1]"*)*

Before, we would print 20 levels deep due to recursion in the type
definition.
2013-10-11 19:21:16 -07:00
bors
399a42575a auto merge of #9799 : catamorphism/rust/rustpkg-exitcodes, r=catamorphism,metajack
r? @metajack When I started writing the rustpkg tests, task failure didn't set the
exit code properly. But bblum's work from July fixed that. Hooray! I
just didn't know about it till now.

So, now rustpkg uses exit codes in a more conventional way, and some of
the tests are simpler.

The bigger issue will be to make task failure propagate the error message.
Right now, rustpkg does most of the work in separate tasks, which means if
a task fails, rustpkg can't distinguish between different types of failure
(see #3408)
2013-10-11 18:11:17 -07:00
Daniel Micay
7bad416765 have LLVM print type strings for us
Example:

    void ({ i64, %tydesc*, i8*, i8*, i8 }*, i64*, %"struct.std::fmt::Formatter[#1]"*)*

Before, we would print 20 levels deep due to recursion in the type
definition.
2013-10-11 20:26:08 -04:00
Tim Chevalier
7472bae5e7 rustpkg: Set exit codes properly and make tests take advantage of that
When I started writing the rustpkg tests, task failure didn't set the
exit code properly. But bblum's work from July fixed that. Hooray! I
just didn't know about it till now.

So, now rustpkg uses exit codes in a more conventional way, and some of
the tests are simpler.

The bigger issue will be to make task failure propagate the error message.
Right now, rustpkg does most of the work in separate tasks, which means if
a task fails, rustpkg can't distinguish between different types of failure
(see #3408)
2013-10-11 17:15:52 -07:00
bors
80878ff369 auto merge of #9809 : fhahn/rust/remove-old-cratemap-code, r=alexcrichton
This patch removes the code responsible for handling older CrateMap versions (as discussed during #9593). Only the new (safer) layout is supported now.
2013-10-11 12:21:20 -07:00
bors
c147ec6d06 auto merge of #9794 : thestinger/rust/rc, r=alexcrichton
I've left out a way to construct from a `Send` type until #9509 is resolved. I am confident that this interface can remain backwards compatible though, assuming we name the `Pointer` trait method `borrow`.

When there is a way to convert from `Send` (`from_send`), a future RAII-based `Mut` type can be used with this to implemented a mutable reference-counted pointer. For now, I've left around the `RcMut` type but it may drastically change or be removed.
2013-10-11 11:11:21 -07:00
Daniel Micay
18be986c99 clean up the Rc/RcMut types and move to libstd 2013-10-11 13:28:36 -04:00
Florian Hahn
f3b1f79716 Remove support for older CrateMap versions 2013-10-11 19:16:20 +02:00
Daniel Micay
e192b6d7c5 correct names for #[no_send]/#[no_freeze] tests 2013-10-11 12:21:19 -04:00
bors
ed37b00b06 auto merge of #9803 : alexcrichton/rust/less-pub2, r=brson
This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.

Closes #4427
2013-10-11 08:56:19 -07:00
bors
93a08f49fa auto merge of #9802 : ben0x539/rust/mkdtemp-raii, r=alexcrichton
this incidentally stops `make check` from leaving directories in `/tmp` (Closes #9764)
2013-10-11 07:11:23 -07:00
Benjamin Herr
63e9e496f6 extra::tempfile: replace mkdtemp with an RAII wrapper
this incidentally stops `make check` from leaving directories in `/tmp`
2013-10-11 15:55:37 +02:00
Alex Crichton
8b4423b04f De-pub some private runtime components
This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.

Closes #4427
2013-10-11 06:49:18 -07:00
bors
5bddcc1ead auto merge of #9805 : alexcrichton/rust/needstest, r=brson
Closes #4545
Closes #5791
Closes #6470
Closes #8044
2013-10-10 22:51:20 -07:00
bors
e5fc0ca6dc auto merge of #9804 : alexcrichton/rust/always-anon-extern, r=brson
There's currently a fair amount of code which is being ignored on unnamed blocks
(which are the default now), and I opted to leave it commented out for now. I
intend on very soon revisiting on how we perform linking with extern crates in
an effort to support static linking.
2013-10-10 21:31:21 -07:00
bors
0daced63fc auto merge of #9517 : crabtw/rust/cabi, r=nikomatsakis
I borrow some ideas from clang's ABIInfo.h and TargetInfo.cpp.
LLVMType is replaced with ArgType, which is similar to clang's ABIArgInfo,
and I also merge attrs of FnType into it.

Now ABI implementation doesn't need to insert hidden return pointer
to arg_tys of FnType. Instead it is handled in foreign.rs.

This change also fixes LLVM assertion failure when compiling MIPS target.
2013-10-10 19:56:22 -07:00
Alex Crichton
478c9b701e Add tests and un-xfail a few issues
Closes #4545
Closes #5791
Closes #6470
Closes #8044
2013-10-10 18:48:52 -07:00
bors
afa42a0237 auto merge of #9785 : catamorphism/rust/remove-convenience-tool, r=pcwalton
r? @pcwalton Sadly, there's a lack of resources for maintaining the `rust` tool,
and we decided in the 2013-10-08 Rust team meeting that it's better
to remove it altogether than to leave it in a broken state.

This deletion is without prejudice. If a person or people appear who
would like to maintain the tool, we will probably be happy to
resurrect it!

Closes #9775
2013-10-10 18:46:23 -07:00
Alex Crichton
b70306158f Remove named extern blocks from the AST
There's currently a fair amount of code which is being ignored on unnamed blocks
(which are the default now), and I opted to leave it commented out for now. I
intend on very soon revisiting on how we perform linking with extern crates in
an effort to support static linking.
2013-10-10 18:04:58 -07:00
bors
2e1df8e35b auto merge of #9732 : catamorphism/rust/rustpkg-read-only, r=brson
r? @metajack rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480
2013-10-10 17:36:21 -07:00
Jyun-Yan You
95fc31ae9b improve C ABI
I borrow some ideas from clang's ABIInfo.h and TargetInfo.cpp.
LLVMType is replaced with ArgType, which is similar to clang's ABIArgInfo,
and I also merge attrs of FnType into it.

Now ABI implementation doesn't need to insert hidden return pointer
to arg_tys of FnType. Instead it is handled in foreign.rs.

This change also fixes LLVM assertion failure when compiling MIPS target.
2013-10-11 08:03:34 +08:00
bors
6ad1d0f861 auto merge of #9800 : vmx/rust/fix-random-doc, r=thestinger
The example for std::rand::random was still
using <float>, which got removed from Rust.
2013-10-10 16:26:20 -07:00
Tim Chevalier
8854b78b55 rustpkg: Make checked-out source files read-only, and overhaul where temporary files are stored
rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480
2013-10-10 15:16:31 -07:00
bors
6aa5934e2b auto merge of #9798 : mtwilliams/rust/master, r=brson
I also removed superfluous trailing whitespace.

I don't think I need to run the test suite.
2013-10-10 14:36:34 -07:00