]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #9897 : thestinger/rust/rusti, r=alexcrichton
bors [Thu, 17 Oct 2013 08:36:33 +0000 (01:36 -0700)]
auto merge of #9897 : thestinger/rust/rusti, r=alexcrichton

Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038

10 years agoauto merge of #9863 : csainty/rust/issue-9755-once-fns-feature-directive, r=alexcrichton
bors [Thu, 17 Oct 2013 07:21:20 +0000 (00:21 -0700)]
auto merge of #9863 : csainty/rust/issue-9755-once-fns-feature-directive, r=alexcrichton

Hello,

First time rust contributor here, please let me know if I need to sort out the contribution agreement for this.

I picked issue #9755 to dip my toe in the water, this pull request isn't quite complete though as I have not updated the documentation. The reason for this is that I haven't tracked down why this feature is gated so I don't feel I can write a justification of the same quality as the other features have been documented.
If someone would like to explain or point me at a mail thread I am happy to update with this change.

Hopefully I have understood the process of converting the old flag into a directive correctly.

Also just to call out what I am sure if a known quirk when adding feature directives, you can't build this code unless you have a snapshot of the compiler which knows about the feature directive. Chicken and the egg. I split the change into two commits, the first should be able to build a snapshot that can compile the second.

10 years agoauto merge of #9891 : alexcrichton/rust/allow-warnings, r=brson
bors [Thu, 17 Oct 2013 05:56:17 +0000 (22:56 -0700)]
auto merge of #9891 : alexcrichton/rust/allow-warnings, r=brson

Closes #9754

10 years agoauto merge of #9846 : cmr/rust/serialize_uuid, r=alexcrichton
bors [Thu, 17 Oct 2013 04:41:23 +0000 (21:41 -0700)]
auto merge of #9846 : cmr/rust/serialize_uuid, r=alexcrichton

10 years agoRemoved the -Z once_fns compiler flag and added the new feature directive of the...
Chris Sainty [Tue, 15 Oct 2013 05:21:54 +0000 (07:21 +0200)]
Removed the -Z once_fns compiler flag and added the new feature directive of the same name to replace it.
Changed the frame_address intrinsic to no longer be a once fn.
This removes the dependency on once_fns from std.

10 years agoauto merge of #9585 : vky/rust/num-docs, r=alexcrichton
bors [Thu, 17 Oct 2013 03:31:23 +0000 (20:31 -0700)]
auto merge of #9585 : vky/rust/num-docs, r=alexcrichton

Copied existing comments from other files, and added comments to functions that did not have existing comments available.

cc #7511

10 years agoAdded comments to public functions in num.rs.
Vijay Korapaty [Tue, 24 Sep 2013 17:25:45 +0000 (10:25 -0700)]
Added comments to public functions in num.rs.

Copied existing comments from other files, and added comments to
functions that did not have existing comments available.

10 years agodrop the linenoise library
Daniel Micay [Thu, 17 Oct 2013 02:51:51 +0000 (22:51 -0400)]
drop the linenoise library

Closes #5038

10 years agoremove the rusti command
Daniel Micay [Thu, 17 Oct 2013 02:23:12 +0000 (22:23 -0400)]
remove the rusti command

Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220

10 years agoauto merge of #9721 : klutzy/rust/uv-net-read-fix, r=alexcrichton
bors [Thu, 17 Oct 2013 02:21:25 +0000 (19:21 -0700)]
auto merge of #9721 : klutzy/rust/uv-net-read-fix, r=alexcrichton

See #9605 for detailed information.

This also fixes two tests of #8811.

10 years agouuid: serialize test and documentations
Corey Richardson [Thu, 17 Oct 2013 01:36:41 +0000 (21:36 -0400)]
uuid: serialize test and documentations

10 years agoauto merge of #9833 : alexcrichton/rust/fixes, r=brson
bors [Thu, 17 Oct 2013 01:11:22 +0000 (18:11 -0700)]
auto merge of #9833 : alexcrichton/rust/fixes, r=brson

Commits have all the fun details

10 years agoauto merge of #9634 : blake2-ppc/rust/by-ref-iter, r=thestinger
bors [Thu, 17 Oct 2013 00:01:30 +0000 (17:01 -0700)]
auto merge of #9634 : blake2-ppc/rust/by-ref-iter, r=thestinger

std::iter: Introduce .by_ref() adaptor

Creates a wrapper around a mutable reference to the iterator.

This is useful to allow applying iterator adaptors while still
retaining ownership of the original iterator value.

Example::

    let mut xs = range(0, 10);
    // sum the first five values
    let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b);
    assert!(partial_sum == 10);
    // xs.next() is now `5`
    assert!(xs.next() == Some(5));

---

This adaptor requires the user to have good understanding of
iterators or what a particular adaptor does. There could be some
pitfalls here with the iterator protocol, it's mostly the same issues
as other places regarding what happens after the iterator
returns None for the first time.

There could also be other ways to achieve the same thing, for
example Implementing iterator on `&mut T` itself:
`impl <T: Iterator<..>> Iterator for &mut T`  but that would only
lead to confusion I think.

10 years agoauto merge of #9885 : thestinger/rust/vector, r=brson
bors [Wed, 16 Oct 2013 22:21:35 +0000 (15:21 -0700)]
auto merge of #9885 : thestinger/rust/vector, r=brson

The goal here is to avoid requiring a division or multiplication to compare against the length. The bounds check previously used an incorrect micro-optimization to replace the division by a multiplication, but now neither is necessary *for slices*. Unique/managed vectors will have to do a division to get the length until they are reworked/replaced.

10 years agoauto merge of #9892 : Kimundi/rust/ResultToStr, r=alexcrichton
bors [Wed, 16 Oct 2013 21:11:58 +0000 (14:11 -0700)]
auto merge of #9892 : Kimundi/rust/ResultToStr, r=alexcrichton

10 years agoAllow stage0 warnings
Alex Crichton [Wed, 16 Oct 2013 18:27:24 +0000 (11:27 -0700)]
Allow stage0 warnings

10 years agoAdded Result implementations for ToStr and fmt::Default
Marvin Löbel [Wed, 16 Oct 2013 18:35:45 +0000 (20:35 +0200)]
Added Result implementations for ToStr and fmt::Default

10 years agoauto merge of #9655 : kballard/rust/path-rewrite, r=alexcrichton
bors [Wed, 16 Oct 2013 18:26:35 +0000 (11:26 -0700)]
auto merge of #9655 : kballard/rust/path-rewrite, r=alexcrichton

Rewrite the entire `std::path` module from scratch.

`PosixPath` is now based on `~[u8]`, which fixes #7225.
Unnecessary allocation has been eliminated.

There are a lot of clients of `Path` that still assume utf-8 paths.
This is covered in #9639.

10 years agopath2: Update for privacy changes
Kevin Ballard [Wed, 16 Oct 2013 16:55:55 +0000 (09:55 -0700)]
path2: Update for privacy changes

Remove redundant `contains_nul` definition.

Make `parse_prefix` private.

10 years agopath2: Update for latest master
Kevin Ballard [Wed, 16 Oct 2013 06:32:14 +0000 (23:32 -0700)]
path2: Update for latest master

Also fix some issues that crept into earlier commits during the conflict
resoution for the rebase.

10 years agopath2: Remove Path.into_str()
Kevin Ballard [Wed, 16 Oct 2013 03:01:33 +0000 (20:01 -0700)]
path2: Remove Path.into_str()

10 years agopath2: Remove some API functions
Kevin Ballard [Thu, 10 Oct 2013 05:05:14 +0000 (22:05 -0700)]
path2: Remove some API functions

Delete the following API functions:
- set_dirname()
- with_dirname()
- set_filestem()
- with_filestem()
- add_extension()
- file_path()

Also change pop() to return a boolean instead of an owned copy of the
old filename.

10 years agopath2: Update based on more review feedback
Kevin Ballard [Tue, 8 Oct 2013 02:16:58 +0000 (19:16 -0700)]
path2: Update based on more review feedback

Standardize the is_sep() functions to be the same in both posix and
windows, and re-export from path. Update extra::glob to use this.

Remove the usage of either, as it's going away.

Move the WindowsPath-specific methods out of WindowsPath and make them
top-level functions of path::windows instead. This way you cannot
accidentally write code that will fail to compile on non-windows
architectures without typing ::windows anywhere.

Remove GenericPath::from_c_str() and just impl BytesContainer for
CString instead.

Remove .join_path() and .push_path() and just implement BytesContainer
for Path instead.

Remove FilenameDisplay and add a boolean flag to Display instead.

Remove .each_parent(). It only had one caller, so just inline its
definition there.

10 years agointroduce `base_and_len` fns for element length
Daniel Micay [Wed, 16 Oct 2013 16:04:51 +0000 (12:04 -0400)]
introduce `base_and_len` fns for element length

10 years agorename `base_and_len` -> `base_and_byte_len`
Daniel Micay [Wed, 16 Oct 2013 15:59:35 +0000 (11:59 -0400)]
rename `base_and_len` -> `base_and_byte_len`

10 years agoauto merge of #9857 : brson/rust/mainsched, r=alexcrichton
bors [Wed, 16 Oct 2013 05:56:36 +0000 (22:56 -0700)]
auto merge of #9857 : brson/rust/mainsched, r=alexcrichton

...al work

This is causing really awful scheduler behavior where the main thread scheduler is
continually waking up, stealing work, discovering it can't actually run the work,
and sending it off to another scheduler.

No test cases because we don't have suitable instrumentation for it.

10 years agoBuild a few extra features into format! parsing
Alex Crichton [Sun, 13 Oct 2013 03:00:58 +0000 (20:00 -0700)]
Build a few extra features into format! parsing

* Allow named parameters to specify width/precision
* Intepret the format string '0$' as "width is the 0th argument" instead of
  thinking the lone '0' was the sign-aware-zero-padding flag. To get both you'd
  need to put '00$' which makes more sense if you want both to happen.

Closes #9669

10 years agoRequire module documentation with missing_doc
Alex Crichton [Sun, 13 Oct 2013 02:02:46 +0000 (19:02 -0700)]
Require module documentation with missing_doc

Closes #9824

10 years agopath2: Remove .with_display_str and friends
Kevin Ballard [Mon, 7 Oct 2013 01:51:49 +0000 (18:51 -0700)]
path2: Remove .with_display_str and friends

Rewrite these methods as methods on Display and FilenameDisplay. This
turns

  do path.with_display_str |s| { ... }

into

  do path.display().with_str |s| { ... }

10 years agopath2: Adjust the API to remove all the _str mutation methods
Kevin Ballard [Sun, 6 Oct 2013 02:49:32 +0000 (19:49 -0700)]
path2: Adjust the API to remove all the _str mutation methods

Add a new trait BytesContainer that is implemented for both byte vectors
and strings.

Convert Path::from_vec and ::from_str to one function, Path::new().

Remove all the _str-suffixed mutation methods (push, join, with_*,
set_*) and modify the non-suffixed versions to use BytesContainer.

10 years agopath2: Remove Path::normalize()
Kevin Ballard [Thu, 3 Oct 2013 05:29:46 +0000 (22:29 -0700)]
path2: Remove Path::normalize()

There are no clients of this API, so just remove it.

Update the module docstring to mention normalization.

10 years agopath2: Write a few paragraphs of module documentation
Kevin Ballard [Thu, 3 Oct 2013 05:06:03 +0000 (22:06 -0700)]
path2: Write a few paragraphs of module documentation

10 years agopath2: Update for loop -> continue
Kevin Ballard [Thu, 3 Oct 2013 03:26:28 +0000 (20:26 -0700)]
path2: Update for loop -> continue

10 years agopath2: Update asserts for new format!() style
Kevin Ballard [Wed, 2 Oct 2013 06:41:59 +0000 (23:41 -0700)]
path2: Update asserts for new format!() style

10 years agopath2: Replace the path module outright
Kevin Ballard [Fri, 27 Sep 2013 00:21:59 +0000 (17:21 -0700)]
path2: Replace the path module outright

Remove the old path.
Rename path2 to path.
Update all clients for the new path.

Also make some miscellaneous changes to the Path APIs to help the
adoption process.

10 years agoauto merge of #9886 : sfackler/rust/flatpipe, r=cmr
bors [Wed, 16 Oct 2013 04:46:35 +0000 (21:46 -0700)]
auto merge of #9886 : sfackler/rust/flatpipe, r=cmr

Closes #9884

10 years agopath2: Add format helpers .display() and .filename_display()
Kevin Ballard [Tue, 1 Oct 2013 21:03:41 +0000 (14:03 -0700)]
path2: Add format helpers .display() and .filename_display()

These methods return an object that can be formatted using {} to print
display strings.

Path itself does not implement fmt::Default to avoid accidental usage of
display strings in incorrect places (e.g. process arguments).

10 years agopath2: Convert typedefs to `pub use`s
Kevin Ballard [Fri, 27 Sep 2013 00:10:55 +0000 (17:10 -0700)]
path2: Convert typedefs to `pub use`s

Turns out you can't call static methods on typedefs. Use `pub use`
instead to work around this issue.

10 years agopath2: Rename pop_opt() to pop() and add each_parent()
Kevin Ballard [Thu, 26 Sep 2013 21:38:26 +0000 (14:38 -0700)]
path2: Rename pop_opt() to pop() and add each_parent()

10 years agopath2: Implement stat support
Kevin Ballard [Thu, 26 Sep 2013 21:24:06 +0000 (14:24 -0700)]
path2: Implement stat support

10 years agopath2: Implement IterBytes for Path
Kevin Ballard [Thu, 26 Sep 2013 19:58:56 +0000 (12:58 -0700)]
path2: Implement IterBytes for Path

10 years agopath2: Implement .as_display_str() and .to_display_str()
Kevin Ballard [Thu, 26 Sep 2013 09:10:16 +0000 (02:10 -0700)]
path2: Implement .as_display_str() and .to_display_str()

These functions are for working with a string representation of the path
even if it's not UTF-8 encoded. They replace invalid UTF-8 sequences
with the replacement char.

10 years agopath2: Add opt variants for from_vec/from_str
Kevin Ballard [Thu, 26 Sep 2013 07:54:30 +0000 (00:54 -0700)]
path2: Add opt variants for from_vec/from_str

10 years agopath2: Rename Path::new() to Path::from_vec()
Kevin Ballard [Thu, 26 Sep 2013 06:19:30 +0000 (23:19 -0700)]
path2: Rename Path::new() to Path::from_vec()

10 years agopath2: Implement WindowsPath
Kevin Ballard [Tue, 27 Aug 2013 07:51:08 +0000 (00:51 -0700)]
path2: Implement WindowsPath

10 years agopath2: Update for changes from master
Kevin Ballard [Tue, 1 Oct 2013 00:13:13 +0000 (17:13 -0700)]
path2: Update for changes from master

10 years agopath2: Add more tests to posix impl
Kevin Ballard [Mon, 2 Sep 2013 06:35:32 +0000 (23:35 -0700)]
path2: Add more tests to posix impl

10 years agopath2: Extract posix/windows into their own files
Kevin Ballard [Sun, 1 Sep 2013 19:44:07 +0000 (12:44 -0700)]
path2: Extract posix/windows into their own files

Move PosixPath into posix::Path.

10 years agopath2: Add tests for the [u8]-based methods
Kevin Ballard [Mon, 26 Aug 2013 21:39:13 +0000 (14:39 -0700)]
path2: Add tests for the [u8]-based methods

10 years agopath2: Update all the tests for the new [u8]-based approach
Kevin Ballard [Mon, 26 Aug 2013 05:24:05 +0000 (22:24 -0700)]
path2: Update all the tests for the new [u8]-based approach

10 years agopath2: Reimplement PosixPath in terms of ~[u8]
Kevin Ballard [Mon, 26 Aug 2013 03:46:26 +0000 (20:46 -0700)]
path2: Reimplement PosixPath in terms of ~[u8]

10 years agopath2: Start reimplementing in terms of ~[u8] instead of ~str
Kevin Ballard [Mon, 26 Aug 2013 02:18:32 +0000 (19:18 -0700)]
path2: Start reimplementing in terms of ~[u8] instead of ~str

As documented in #7225, we cannot rely on paths being representable in
utf-8. Specifically, Linux allows anything (besides NUL) in a path.
Redesign GenericPath in light of this.

PosixPath hasn't been reimplemented yet for ~[u8].

10 years agopath2: Implement PosixPath
Kevin Ballard [Sat, 24 Aug 2013 06:30:17 +0000 (23:30 -0700)]
path2: Implement PosixPath

Fixes #5389 (new conventions for Path constructor)

10 years agoInitial sketching out of the new path module
Kevin Ballard [Sat, 24 Aug 2013 03:15:08 +0000 (20:15 -0700)]
Initial sketching out of the new path module

Define the basic types, and the GenericPath trait.

This module is currently called path2. It will be renamed later.

10 years agoRemove extra::flatpipes
Steven Fackler [Wed, 16 Oct 2013 01:54:35 +0000 (18:54 -0700)]
Remove extra::flatpipes

Closes #9884

10 years agoremove executable flag from source file
Daniel Micay [Tue, 15 Oct 2013 23:34:45 +0000 (19:34 -0400)]
remove executable flag from source file

10 years agouse element count in slices, not size in bytes
Daniel Micay [Tue, 15 Oct 2013 04:37:32 +0000 (00:37 -0400)]
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.

10 years agofix overflow on bounds checks
Daniel Micay [Tue, 15 Oct 2013 03:25:33 +0000 (23:25 -0400)]
fix overflow on bounds checks

Closes #9020

10 years agofix bounds checking failure message
Daniel Micay [Tue, 15 Oct 2013 02:43:03 +0000 (22:43 -0400)]
fix bounds checking failure message

casting the `uint` to an `int` can result in printing high values as
negative intege

10 years agoauto merge of #9860 : thestinger/rust/abort, r=Aatch
bors [Tue, 15 Oct 2013 02:51:34 +0000 (19:51 -0700)]
auto merge of #9860 : thestinger/rust/abort, r=Aatch

This should be preferred to calling the libc `abort` function.

10 years agoadd an `abort` intrinsic
Daniel Micay [Tue, 15 Oct 2013 01:51:03 +0000 (21:51 -0400)]
add an `abort` intrinsic

This should be preferred to the libc `abort` function.

10 years agorustdoc: Don't abort if there's nothing to document
Alex Crichton [Sat, 12 Oct 2013 21:58:37 +0000 (14:58 -0700)]
rustdoc: Don't abort if there's nothing to document

Instead there's no index.html file emitted because there wasn't anything to
document.

Closes #9828

10 years agorustdoc: Use privacy visibility for pruning
Alex Crichton [Sat, 12 Oct 2013 21:40:41 +0000 (14:40 -0700)]
rustdoc: Use privacy visibility for pruning

This commit ends rustdoc's approximation of privacy and instead uses the result
of the various compiler passes instead.

Closes #9827

10 years agostd::rt: Fix the set up of the main thread so that it doesn't try to steal work
Brian Anderson [Mon, 14 Oct 2013 23:08:18 +0000 (16:08 -0700)]
std::rt: Fix the set up of the main thread so that it doesn't try to steal work

This is causing really awful scheduler behavior where the main thread scheduler is
continually waking up, stealing work, discovering it can't actually run the work,
and sending it off to another scheduler.

10 years agoauto merge of #9823 : pnkfelix/rust/issue7655-bench-papercuts, r=alexcrichton
bors [Mon, 14 Oct 2013 22:06:36 +0000 (15:06 -0700)]
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.  :)

10 years agoOnly use padded test names to calculate the target padding size.
Felix S. Klock II [Mon, 14 Oct 2013 19:45:57 +0000 (15:45 -0400)]
Only use padded test names to calculate the target padding size.

10 years agoIssue 7655: align the bench printouts so that the numbers tend to be aligned.
Felix S. Klock II [Sat, 12 Oct 2013 13:49:50 +0000 (09:49 -0400)]
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.

10 years agoauto merge of #9606 : steveklabnik/rust/abi_removal, r=alexcrichton
bors [Mon, 14 Oct 2013 14:26:47 +0000 (07:26 -0700)]
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.

10 years agoauto merge of #9848 : huonw/rust/move-trait-doc, r=alexcrichton
bors [Mon, 14 Oct 2013 13:16:32 +0000 (06:16 -0700)]
auto merge of #9848 : huonw/rust/move-trait-doc, r=alexcrichton

This means the text is visible in rustdoc.

10 years agoRemoving ccdecl
Steve Klabnik [Mon, 14 Oct 2013 12:33:05 +0000 (14:33 +0200)]
Removing ccdecl

as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872

10 years agostd::vec: move documentation from impls to traits.
Huon Wilson [Mon, 14 Oct 2013 11:21:47 +0000 (22:21 +1100)]
std::vec: move documentation from impls to traits.

This means the text is visible in rustdoc.

10 years agoRemove unused abi attributes.
Steve Klabnik [Sun, 29 Sep 2013 14:46:26 +0000 (07:46 -0700)]
Remove unused abi attributes.

They've been replaced by putting the name on the extern block.

  #[abi = "foo"]

goes to

  extern "foo" { }

Closes #9483.

10 years agoauto merge of #9844 : bytbox/rust/master, r=alexcrichton
bors [Mon, 14 Oct 2013 06:41:30 +0000 (23:41 -0700)]
auto merge of #9844 : bytbox/rust/master, r=alexcrichton

10 years agoextra: implement Encodable/Decodable for Uuid
Corey Richardson [Mon, 14 Oct 2013 05:47:52 +0000 (01:47 -0400)]
extra: implement Encodable/Decodable for Uuid

10 years agoauto merge of #9843 : sfackler/rust/rustdoc-strip-private, r=alexcrichton
bors [Mon, 14 Oct 2013 05:31:29 +0000 (22:31 -0700)]
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

10 years agoMake Rustdoc strip private fields
Steven Fackler [Mon, 14 Oct 2013 03:37:43 +0000 (20:37 -0700)]
Make Rustdoc strip private fields

In addition, the renderer will add comments to structs and enums saying
that fields or variants have been stripped.

10 years agostd::libc: rustdoc indicates reexports now
Scott Lawrence [Mon, 14 Oct 2013 04:46:02 +0000 (00:46 -0400)]
std::libc: rustdoc indicates reexports now

10 years agoauto merge of #9836 : eriklyon/rust/doc-typos, r=alexcrichton
bors [Sun, 13 Oct 2013 18:31:26 +0000 (11:31 -0700)]
auto merge of #9836 : eriklyon/rust/doc-typos, r=alexcrichton

10 years agofix typos in doc/tutorial.md
Erik Lyon [Sun, 13 Oct 2013 17:49:44 +0000 (10:49 -0700)]
fix typos in doc/tutorial.md

10 years agoauto merge of #9832 : luqmana/rust/sps, r=alexcrichton
bors [Sun, 13 Oct 2013 04:26:20 +0000 (21:26 -0700)]
auto merge of #9832 : luqmana/rust/sps, r=alexcrichton

Fixes #9830.

10 years agolibrustc: Combine C_struct and C_packed_struct.
Luqman Aden [Sun, 13 Oct 2013 03:19:22 +0000 (23:19 -0400)]
librustc: Combine C_struct and C_packed_struct.

10 years agoauto merge of #9608 : hmarr/rust/vec-get-opt, r=huonw
bors [Sun, 13 Oct 2013 03:16:19 +0000 (20:16 -0700)]
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`?)

10 years agoUpdate test for packed structs to also test being placed in statics.
Luqman Aden [Sun, 13 Oct 2013 01:52:14 +0000 (21:52 -0400)]
Update test for packed structs to also test being placed in statics.

10 years agolibrustc: Don't ICE on packed structs in statics.
Luqman Aden [Sun, 13 Oct 2013 01:42:24 +0000 (21:42 -0400)]
librustc: Don't ICE on packed structs in statics.

10 years agoauto merge of #9825 : thestinger/rust/rc, r=thestinger
bors [Sat, 12 Oct 2013 14:26:20 +0000 (07:26 -0700)]
auto merge of #9825 : thestinger/rust/rc, r=thestinger

10 years agorc: fix docstring
Daniel Micay [Sat, 12 Oct 2013 14:19:56 +0000 (10:19 -0400)]
rc: fix docstring

10 years agoauto merge of #9815 : thestinger/rust/type, r=huonw
bors [Sat, 12 Oct 2013 02:21:16 +0000 (19:21 -0700)]
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.

10 years agoauto merge of #9799 : catamorphism/rust/rustpkg-exitcodes, r=catamorphism,metajack
bors [Sat, 12 Oct 2013 01:11:17 +0000 (18:11 -0700)]
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)

10 years agohave LLVM print type strings for us
Daniel Micay [Fri, 11 Oct 2013 23:56:11 +0000 (19:56 -0400)]
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.

10 years agorustpkg: Set exit codes properly and make tests take advantage of that
Tim Chevalier [Thu, 10 Oct 2013 20:48:11 +0000 (13:48 -0700)]
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)

10 years agoauto merge of #9809 : fhahn/rust/remove-old-cratemap-code, r=alexcrichton
bors [Fri, 11 Oct 2013 19:21:20 +0000 (12:21 -0700)]
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.

10 years agoauto merge of #9794 : thestinger/rust/rc, r=alexcrichton
bors [Fri, 11 Oct 2013 18:11:21 +0000 (11:11 -0700)]
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.

10 years agoclean up the `Rc`/`RcMut` types and move to libstd
Daniel Micay [Thu, 10 Oct 2013 15:45:52 +0000 (11:45 -0400)]
clean up the `Rc`/`RcMut` types and move to libstd

10 years agoRemove support for older CrateMap versions
Florian Hahn [Fri, 11 Oct 2013 10:32:02 +0000 (12:32 +0200)]
Remove support for older CrateMap versions

10 years agocorrect names for `#[no_send]`/`#[no_freeze]` tests
Daniel Micay [Fri, 11 Oct 2013 15:59:26 +0000 (11:59 -0400)]
correct names for `#[no_send]`/`#[no_freeze]` tests

10 years agoauto merge of #9803 : alexcrichton/rust/less-pub2, r=brson
bors [Fri, 11 Oct 2013 15:56:19 +0000 (08:56 -0700)]
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

10 years agoauto merge of #9802 : ben0x539/rust/mkdtemp-raii, r=alexcrichton
bors [Fri, 11 Oct 2013 14:11:23 +0000 (07:11 -0700)]
auto merge of #9802 : ben0x539/rust/mkdtemp-raii, r=alexcrichton

this incidentally stops `make check` from leaving directories in `/tmp` (Closes #9764)

10 years agoextra::tempfile: replace mkdtemp with an RAII wrapper
Benjamin Herr [Fri, 11 Oct 2013 13:55:37 +0000 (15:55 +0200)]
extra::tempfile: replace mkdtemp with an RAII wrapper

this incidentally stops `make check` from leaving directories in `/tmp`

10 years agoDe-pub some private runtime components
Alex Crichton [Wed, 9 Oct 2013 17:34:27 +0000 (10:34 -0700)]
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

10 years agoauto merge of #9805 : alexcrichton/rust/needstest, r=brson
bors [Fri, 11 Oct 2013 05:51:20 +0000 (22:51 -0700)]
auto merge of #9805 : alexcrichton/rust/needstest, r=brson

Closes #4545
Closes #5791
Closes #6470
Closes #8044