Commit Graph

34875 Commits

Author SHA1 Message Date
Jorge Aparicio
a0621f8eba libtest: remove unnecessary as_slice() calls 2014-12-06 23:53:01 -05:00
Jorge Aparicio
53b479c195 libterm: remove unnecessary as_slice() calls 2014-12-06 23:53:01 -05:00
Jorge Aparicio
39f44c0c20 libsyntax: remove unnecessary as_slice() calls 2014-12-06 23:53:01 -05:00
Jorge Aparicio
60338d91c4 libstd: remove unnecessary as_slice() calls 2014-12-06 23:53:00 -05:00
bors
f7d18b92f8 auto merge of #19407 : frewsxcv/rust/rm-reexports, r=cmr
In regards to:

https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729

This commit:

* Changes the #deriving code so that it generates code that utilizes fewer
  reexports (in particur Option::\*, Result::\*, and Ordering::\*), which is necessary to
  remove those reexports in the future
* Changes other areas of the codebase so that fewer reexports are utilized
2014-12-07 04:12:20 +00:00
Mukilan Thiyagarajan
4b75a5d8da Add compile-fail tests for #19498 2014-12-07 07:37:15 +05:30
Jorge Aparicio
09f7713dd4 libserialize: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
e6bd217ce8 librustdoc: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
8bb5ef9df5 librustc_trans: remove unnecessary as_slice calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
7d8eabb226 librustc_back: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
00f3c3f7a7 librustc: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
ae555a99a6 libregex_macros: remove unnecessary as_slice calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
89e6a81ef9 libregex: remove unnecessary as_slice calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
0ea31348d9 liblog: remove unnecessary as_slice calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
c0ef959b31 libgraphviz: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
6efc87945b libgetops: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
a7960136ac libfmt_macros: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
0f54f32a9c libflate: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
5257a5b284 libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
0ac3b166df liballoc: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Jorge Aparicio
f2af07e6d5 libcollections: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
Steven Fackler
3246d4f369 Change from message to expected 2014-12-06 15:16:38 -08:00
Steven Fackler
616af6eb83 Allow message specification for should_fail
The test harness will make sure that the panic message contains the
specified string. This is useful to help make `#[should_fail]` tests a
bit less brittle by decreasing the chance that the test isn't
"accidentally" passing due to a panic occurring earlier than expected.
The behavior is in some ways similar to JUnit's `expected` feature:
`@Test(expected=NullPointerException.class)`.

Without the message assertion, this test would pass even though it's not
actually reaching the intended part of the code:
```rust
 #[test]
 #[should_fail(message = "out of bounds")]
fn test_oob_array_access() {
    let idx: uint = from_str("13o").unwrap(); // oops, this will panic
    [1i32, 2, 3][idx];
}
```
2014-12-06 15:13:48 -08:00
bors
a31ad6bfcd auto merge of #19579 : alexcrichton/rust/snapshots, r=nikomatsakis 2014-12-06 23:12:17 +00:00
bors
de83d7dd19 auto merge of #19431 : erickt/rust/buf-writer-error, r=alexcrichton
Previously, `BufWriter::write` would just return an `std::io::OtherIoError` if someone attempted to write past the end of the wrapped buffer. This pull request changes the error to support partial writes and return a `std::io::ShortWrite`, or an `io::io::EndOfFile` if it's been fully exhausted.

 I've also optimized away a bounds check inside `BufWriter::write`, which should help shave off some nanoseconds in an inner loops.
2014-12-06 20:12:13 +00:00
bors
358db12a89 auto merge of #19590 : sfackler/rust/fix-android, r=sfackler
Seems to be blocking forever
2014-12-06 17:42:16 +00:00
Steven Fackler
2e2aca9eb8 Ignore wait-forked-but-failed-child
Test will be fixed in #19588
2014-12-06 08:13:57 -08:00
Corey Richardson
6e18b5af93 rustc: check supertraits for object safety
Closes #18959

Technically, this causes code that once compiled to no longer compile, but
that code probably never ran.

[breaking-change]
2014-12-05 22:27:21 -08:00
Steven Fackler
8a288d3aff Ignore issue #16671 test on android
Seems to be blocking forever
2014-12-05 20:22:35 -08:00
Chase Southwood
da50db0ca2 Implement BitOps for TreeSet 2014-12-05 18:03:45 -06:00
Alex Crichton
9b443289cf Register new snapshots 2014-12-05 15:39:26 -08:00
Corey Farwell
4ef16741e3 Utilize fewer reexports
In regards to:

https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729

This commit:

* Changes the #deriving code so that it generates code that utilizes fewer
  reexports (in particur Option::* and Result::*), which is necessary to
  remove those reexports in the future
* Changes other areas of the codebase so that fewer reexports are utilized
2014-12-05 18:13:04 -05:00
jbranchaud
451cc7e5c0 Add doctests for union, diff, sym_diff, and intersection.
Add a rustdoc test for union to exhibit how it is used.

There is already a test for union in the test namespace, but this commit
adds a doctest that will appear in the rustdocs.

Add a doctest for the difference function.

Add a doctest for the symmetric_difference function.

Add a doctest for the intersection function.

Update the union et al. doctests based on @Gankro's comments.

Make the union et al. doctests a bit more readable.
2014-12-05 17:00:24 -06:00
jbranchaud
d6b6df0dfa Add doctests for keys() and values() of the BTreeMap collection.
Update keys() and values() for BTreeMap based on @Gankro's comments.

Assign keys and values to variables before doing assertion.
2014-12-05 15:40:46 -06:00
bors
6f4c11be3b auto merge of #19508 : cmr/rust/rollup-2014_12_03, r=cmr 2014-12-05 20:23:10 +00:00
Erick Tryzelaar
e20ea0b67d collections: dramatically speed up Vec::reserve with magic
Somehow llvm is able to optimize this version of Vec::reserve
into dramatically faster than the old version. In micro-benchmarks
this was 2-10 times faster. It also shaved 14 minutes off of
rust's compile times.

Closes #19281.
2014-12-05 11:29:41 -08:00
Corey Richardson
33f34bdb4e Merge remote-tracking branch 'csouth3/trieset-bitops' into rollup-2014_12_03
Conflicts:
	src/libcollections/trie/set.rs
2014-12-05 11:19:50 -08:00
Luqman Aden
2dccb5a77f librustc: Don't reuse same alloca for match on struct/tuple field which we reassign to in match body. 2014-12-05 14:16:20 -05:00
Chase Southwood
309ab34b7a Implement BitOps for TrieSet 2014-12-05 12:58:45 -06:00
Corey Richardson
090110779f rollup merge of #19553: sfackler/issue-19543
Closes #19543
2014-12-05 10:08:33 -08:00
Corey Richardson
a90e0d70cc rollup merge of #19534: scialex/liballoc-cfg
Adds the ability to use a custom allocator heap by passing either --cfg
external_crate and --extern external=<allocator_crate_name> or --cfg
external_funcs and defining the allocator functions prefixed by 'rust_'
somewhere.

This is useful for many applications including OS/embedded development,
and allocator development and testing.
2014-12-05 10:08:28 -08:00
Corey Richardson
b8eaf7bc8a rollup merge of #19530: aochagavia/remove-test
Fixes https://github.com/rust-lang/rust/issues/19510
2014-12-05 10:08:26 -08:00
Corey Richardson
d602c058ae rollup merge of #19528: aliblong/add_vecmap_capacity
Part of #18424

Adds `capacity()` function to VecMap, as per the collections reform.

(Salvaged from #19516, #19523, while we await an RFC regarding `reserve`/`reserve_index` for `VecMap`)
2014-12-05 10:08:24 -08:00
Corey Richardson
39646d2ff6 rollup merge of #19526: steveklabnik/gh19402
Fixes #19402.
2014-12-05 10:07:49 -08:00
Corey Richardson
0fb040f4bd rollup merge of #19525: steveklabnik/guide_edits
Fixes #19335. (or at least, the actionable parts)
2014-12-05 10:07:48 -08:00
Corey Richardson
c7d545e2f7 rollup merge of #19520: csouth3/derefmut-unsized
Right now, `DerefMut` is not `for Sized?`, so you can't impl `DerefMut<T> for Foo` where `Foo` is unsized.  However, there is no reason that it can't be `for Sized?`, so this pull request fixes the issue.

Closes #19493.
2014-12-05 10:07:47 -08:00
Corey Richardson
d58aecb6b3 rollup merge of #19518: csouth3/trieset-bitops
Implement the `BitOr`, `BitAnd`, `BitXor`, and `Sub` traits from `std::ops` for TrieSet.  The behavior of these operator overloads is consistent with [RFC 235](https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md#combinations).
2014-12-05 10:07:45 -08:00
Corey Richardson
4e492cbaf8 rollup merge of #19515: lifthrasiir/rustdoc-wrong-dedup
Fixes #17332.
2014-12-05 10:07:44 -08:00
Corey Richardson
f3a85cf822 rollup merge of #19513: lifthrasiir/rustdoc-fat-redirect
We heavily rely on queries and fragments in the URL structure, so it is desired to preserve them even in the redirects. The generated redirect pages try to preserve them with scripts, which take precedence over the original `Refresh` metadata. Non-scripting browsers would continue to work (with no queries and fragments).

(This in turn solves a number of semi-broken links to the source code, which are actually linked to redirect pages.)
2014-12-05 10:07:42 -08:00
Corey Richardson
33e96be299 rollup merge of #19512: cybergeek94/master
Added the example from [this Reddit thread][1], reworked to be more robust with correct logic (first link skipped the 0th and 1st Fibonacci numbers, second forgot about the last two valid values before overflow). Will yield all Fibonacci numbers sequentially in the range `[0, <u32 as Int>::max_value())`.

If the example is too complicated I can change it to a more naive version, perhaps using signed integers to check for overflow instead of `Option` and `.checked_add()`.

Also reworded the doc comments to clarify the usage and behavior of `Unfold`, as the thread suggested that it wasn't really clear how `Unfold` worked and when one should use it.

This change is in the `core` crate but I based the example on `std` since that's where most readers will find the example. I included a note about `core` for clarity. Edit: removed.

Tested with `rustdoc src/libcore/lib.rs`. Rebased against latest master as of the creation of this PR.

[1]: http://www.reddit.com/r/rust/comments/2ny8r1/a_question_about_loops/cmighu4?context=10000
2014-12-05 10:07:41 -08:00