]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13845 : alexcrichton/rust/regex-deps, r=brson
bors [Tue, 29 Apr 2014 19:31:52 +0000 (12:31 -0700)]
auto merge of #13845 : alexcrichton/rust/regex-deps, r=brson

There is currently not much precedent for target crates requiring syntax
extensions to compile their test versions. This dependency is possible, but
can't be encoded through the normal means of DEPS_regex because it is a
test-only dependency and it must be a *host* dependency (it's a syntax
extension).

Closes #13844

10 years agomk: Depend on regex_macros for tests appropriately
Alex Crichton [Tue, 29 Apr 2014 15:55:40 +0000 (08:55 -0700)]
mk: Depend on regex_macros for tests appropriately

There is currently not much precedent for target crates requiring syntax
extensions to compile their test versions. This dependency is possible, but
can't be encoded through the normal means of DEPS_regex because it is a
test-only dependency and it must be a *host* dependency (it's a syntax
extension).

Closes #13844

10 years agoauto merge of #13807 : ipetkov/rust/issue-13771, r=alexcrichton
bors [Tue, 29 Apr 2014 07:26:48 +0000 (00:26 -0700)]
auto merge of #13807 : ipetkov/rust/issue-13771, r=alexcrichton

All links inside docblocks will have their color set to `#4e8bca` (a light blue color to contrast against the black text). This color also offers a visible contrast from the surrounding text if viewed as grayscale, making it suitable for accessability.

Docblock links will also be underlined when hovered over.

Before:
![screen shot 2014-04-27 at 12 47 06 pm](https://cloud.githubusercontent.com/assets/1638690/2812157/00e53a32-ce45-11e3-81e8-7b1dc692f6b7.png)

After (links underlined only on hover, cursor not shown in image):
![screen shot 2014-04-27 at 12 47 48 pm](https://cloud.githubusercontent.com/assets/1638690/2812158/04fa94b4-ce45-11e3-9ead-2344753c251d.png)

Fix #13771

10 years agoauto merge of #13829 : alexcrichton/rust/dead-strip, r=thestinger
bors [Tue, 29 Apr 2014 06:06:50 +0000 (23:06 -0700)]
auto merge of #13829 : alexcrichton/rust/dead-strip, r=thestinger

This flag to the linker asks it to strip away all dead code during linking, as
well as dead data. This reduces the size of hello world from 1.7MB to 458K on my
system (70% reduction).

I have not seen this impact link times negatively, and I have seen this pass
'make check' successfully. I am slightly wary of adding this option, but the
benefits are so huge tha I think we should work hard to work around any issues
rather than avoid using the flag entirely.

10 years agorustdoc: #13771: Make html links inside paragraphs more readable
Ivan Petkov [Sun, 27 Apr 2014 19:37:48 +0000 (12:37 -0700)]
rustdoc: #13771: Make html links inside paragraphs more readable

All links inside docblocks will have their color set to `#4e8bca` (a
light blue color to contrast against the black text). This color also
offers a visible contrast from the surrounding text if viewed as
grayscale, making it suitable for accessability.

Docblock links will also be underlined when hovered over.

10 years agoauto merge of #13834 : nick29581/rust/str_fix, r=luqmana
bors [Tue, 29 Apr 2014 02:41:47 +0000 (19:41 -0700)]
auto merge of #13834 : nick29581/rust/str_fix, r=luqmana

10 years agoRemove internal support for fixed length strings
Nick Cameron [Tue, 29 Apr 2014 01:10:23 +0000 (13:10 +1200)]
Remove internal support for fixed length strings

10 years agoauto merge of #13830 : noamraph/rust/doc-browser-history, r=kballard
bors [Tue, 29 Apr 2014 00:32:00 +0000 (17:32 -0700)]
auto merge of #13830 : noamraph/rust/doc-browser-history, r=kballard

Currently, in both chrome and firefox, if I type something in the search box in the reference docs I get immediately the search results. That's great. However, if I want to go back to the doc I was reading and try to press the back button, I am immediately forwarded again to the search results. This is caused by the fact that the search term is (deliberately) left in the search box, and the search() function is called as if I typed the search term again.
I disabled calling the search() function if there's no search term in the URL, and now it seems to work fine.

I hope I'm sending the pull request correctly - I'm not really used to git and github.

10 years agoauto merge of #13827 : lifthrasiir/rust/rustdoc-hidden-pub-field, r=alexcrichton
bors [Mon, 28 Apr 2014 22:56:45 +0000 (15:56 -0700)]
auto merge of #13827 : lifthrasiir/rust/rustdoc-hidden-pub-field, r=alexcrichton

Fixes #13806. Also adds a note to `HiddenStructField` about why it doesn't appear in the `clean` module itself.

10 years agorustdoc: Make going back in browser history work after typing a search term
Noam Yorav-Raphael [Mon, 28 Apr 2014 20:52:54 +0000 (23:52 +0300)]
rustdoc: Make going back in browser history work after typing a search term

10 years agoauto merge of #13819 : nick29581/rust/ty_str, r=pcwalton
bors [Mon, 28 Apr 2014 21:26:48 +0000 (14:26 -0700)]
auto merge of #13819 : nick29581/rust/ty_str, r=pcwalton

Similar to my recent changes to ~[T]/&[T], these changes remove the vstore abstraction and represent str types as ~(str) and &(str). The Option<uint> in ty_str is the length of the string, None if the string is dynamically sized.

10 years agorustc: Pass -dead_strip on OSX
Alex Crichton [Mon, 28 Apr 2014 20:20:08 +0000 (13:20 -0700)]
rustc: Pass -dead_strip on OSX

This flag to the linker asks it to strip away all dead code during linking, as
well as dead data. This reduces the size of hello world from 1.7MB to 458K on my
system (70% reduction).

I have not seen this impact link times negatively, and I have seen this pass
'make check' successfully. I am slightly wary of adding this option, but the
benefits are so huge tha I think we should work hard to work around any issues
rather than avoid using the flag entirely.

10 years agoauto merge of #13812 : alxgnon/rust/master, r=alexcrichton
bors [Mon, 28 Apr 2014 19:56:49 +0000 (12:56 -0700)]
auto merge of #13812 : alxgnon/rust/master, r=alexcrichton

This is a quick fix for repeated documentation descriptions in certain modules.
Following is a list of the faulty modules I found. I ran `pcregrep -r -M "<p>(.+)\n\1" doc` on the html documentation to help identify them.

- [rustuv::uvio](http://static.rust-lang.org/doc/master/rustuv/uvio/index.html)
- [rustuv::uvll](http://static.rust-lang.org/doc/master/rustuv/uvll/index.html)
- [std::rt::backtrace](http://static.rust-lang.org/doc/master/std/rt/backtrace/index.html)
- [std::rt::env](http://static.rust-lang.org/doc/master/std/rt/env/index.html)
- [std::rt::global_heap](http://static.rust-lang.org/doc/master/std/rt/global_heap/index.html)
- [std::rt::local_heap](http://static.rust-lang.org/doc/master/std/rt/local_heap/index.html)
- [std::rt::rtio](http://static.rust-lang.org/doc/master/std/rt/rtio/index.html)
- [std::rt::task](http://static.rust-lang.org/doc/master/std/rt/task/index.html)
- [std::rt::thread](http://static.rust-lang.org/doc/master/std/rt/thread/index.html)
- [std::rt::unwind](http://static.rust-lang.org/doc/master/std/rt/unwind/index.html)
- [syntax::parse::classify](http://static.rust-lang.org/doc/master/syntax/parse/classify/index.html)
- [syntax::parse::common](http://static.rust-lang.org/doc/master/syntax/parse/common/index.html)

After a little testing, I discovered that moving the documentation inside (`//!`) instead of outside (`///`) modules fixed the immediate problem. I went through the trouble of moving the documentation, and with this commit there are no more repeated descriptions within those faulty modules.

This does not fix the underlying problem though. We should look into why having the documentation outside instead of inside caused the descriptions to be repeated. I will create a separate issue with my findings on the subject if necessary.
In the meantime, this simple fix should be enough.

10 years agorustdoc: Make strip_hidden use a dedicated hidden item if any.
Kang Seonghoon [Mon, 28 Apr 2014 18:59:48 +0000 (03:59 +0900)]
rustdoc: Make strip_hidden use a dedicated hidden item if any.

fixes #13806.

10 years agoauto merge of #13797 : lifthrasiir/rust/std-mem-replace-doc, r=alexcrichton
bors [Mon, 28 Apr 2014 18:32:07 +0000 (11:32 -0700)]
auto merge of #13797 : lifthrasiir/rust/std-mem-replace-doc, r=alexcrichton

Inspired by @steveklabnik's [comment](http://www.reddit.com/r/rust/comments/240p9s/eli5_stdmemreplace/ch2gxw8), this PR adds the practical use cases to the documentation of `std::mem::replace`.

Caveat: We need a `compile-fail` equivalent for doctest. :p

10 years agoauto merge of #13821 : aochagavia/rust/pr3, r=alexcrichton
bors [Mon, 28 Apr 2014 17:01:57 +0000 (10:01 -0700)]
auto merge of #13821 : aochagavia/rust/pr3, r=alexcrichton

10 years agoFixed typo in std::vec
Adolfo Ochagavía [Mon, 28 Apr 2014 13:39:11 +0000 (15:39 +0200)]
Fixed typo in std::vec

10 years agostd: Add more docs to `std::mem::replace`.
Kang Seonghoon [Sun, 27 Apr 2014 13:37:11 +0000 (22:37 +0900)]
std: Add more docs to `std::mem::replace`.

10 years agoauto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonw
bors [Mon, 28 Apr 2014 12:21:46 +0000 (05:21 -0700)]
auto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonw

This PR is primarily motivated by (and fixes) #12926.

We currently only have a span for the individual item itself and not for the referred contents. This normally does not cause a problem since both are located in the same file; it *is* possible that the contained statement or item is located in the other file (the syntax extension can do that), but even in that case the syntax extension should be located in the same file as the item. The module item (i.e. `mod foo;`) is the only exception here, and thus warrants a special treatment.

Rustdoc would now distinguish `mod foo;` from `mod foo {...}` by checking if the span for the module item and module contents is in different files. If it's the case, we'd prefer module contents over module item. There are alternative strategies, but as noted above we will have some corner cases if we don't record the contents span explicitly.

10 years agoRefactor ty_str to use a ~(str) representation.
Nick Cameron [Sat, 26 Apr 2014 22:19:15 +0000 (10:19 +1200)]
Refactor ty_str to use a ~(str) representation.

Similar to my recent changes to ~[T]/&[T], these changes remove the vstore abstraction and represent str types as ~(str) and &(str). The Option<uint> in ty_str is the length of the string, None if the string is dynamically sized.

10 years agoauto merge of #13811 : alexcrichton/rust/closed-issues, r=sfackler
bors [Mon, 28 Apr 2014 06:06:41 +0000 (23:06 -0700)]
auto merge of #13811 : alexcrichton/rust/closed-issues, r=sfackler

Closes #5518
Closes #7320
Closes #8391
Closes #8827
Closes #8983
Closes #10683
Closes #10802
Closes #11515

10 years agotest: Add tests for closed issues
Alex Crichton [Mon, 28 Apr 2014 03:27:20 +0000 (20:27 -0700)]
test: Add tests for closed issues

Closes #5518
Closes #7320
Closes #8391
Closes #8827
Closes #8983
Closes #10683
Closes #10802
Closes #11515

10 years agoauto merge of #13795 : klutzy/rust/win-make-check, r=alexcrichton
bors [Mon, 28 Apr 2014 03:31:37 +0000 (20:31 -0700)]
auto merge of #13795 : klutzy/rust/win-make-check, r=alexcrichton

Fixes #12303.

Also contains a partial fix for `make check` failure.

10 years agotest: Fix run-make on windows
klutzy [Sun, 27 Apr 2014 07:52:36 +0000 (16:52 +0900)]
test: Fix run-make on windows

10 years agoFix repeated module documentation
Alexandre Gagnon [Mon, 28 Apr 2014 02:05:41 +0000 (22:05 -0400)]
Fix repeated module documentation

10 years agoauto merge of #13809 : prattmic/rust/tutorial_debug, r=alexcrichton
bors [Mon, 28 Apr 2014 02:06:38 +0000 (19:06 -0700)]
auto merge of #13809 : prattmic/rust/tutorial_debug, r=alexcrichton

As of cc6ec8df, the Owned closures example uses println! instead of
debug!, making a note about seeing debug seem out-of-place in this
section.

Since debug! is not used elsewhere in the tutorial, remove the note
entirely.

10 years agoauto merge of #13801 : ryantm/rust/master, r=alexcrichton
bors [Mon, 28 Apr 2014 00:26:37 +0000 (17:26 -0700)]
auto merge of #13801 : ryantm/rust/master, r=alexcrichton

The previous error message using assert_eq! was quite cryptic. This should be more clear. I also added a test for the underflow case.

10 years agoauto merge of #13799 : m-r-r/rust/patch-std-io-standard_error, r=alexcrichton
bors [Sun, 27 Apr 2014 23:01:39 +0000 (16:01 -0700)]
auto merge of #13799 : m-r-r/rust/patch-std-io-standard_error, r=alexcrichton

Hello,

With the latest version of Rust, calling to the function [`std::io::standard_error()`](http://static.rust-lang.org/doc/master/std/io/fn.standard_error.html) succeeds only if the value of the argument is `EndOfFile`, `IoUnavailable` or `InvalidInput`. If the function is called with another value as argument, it fails without message.

Here is a piece of code that reproduces the problem:

```rust
use std::io::{standard_error,EndOfFile,FileNotFound,PermissionDenied};

fn main() {
     println!("Error 1: {}", standard_error(EndOfFile)); // does not fail
     println!("Error 2: {}", standard_error(FileNotFound)); // fails
     println!("Error 3: {}", standard_error(PermissionDenied)); //fails
}
```
This was because the `IoErrorKind` passed as argument wasn't matched against all the possible values.

I added the missing branches in the `match` statement inside the function, and i removed the call to the `fail!()` macro. I rebuilt the crate with the latest `rustc` version and it seems to works.

10 years agodoc: Remove out-of-place debug! note
Michael Pratt [Sun, 27 Apr 2014 22:14:50 +0000 (18:14 -0400)]
doc: Remove out-of-place debug! note

As of cc6ec8df, the Owned closures example uses println! instead of
debug!, making a note about seeing debug seem out-of-place in this
section.

Since debug! is not used elsewhere in the tutorial, remove the note
entirely.

10 years agoauto merge of #13792 : jacob-hegna/rust/master, r=alexcrichton
bors [Sun, 27 Apr 2014 21:36:41 +0000 (14:36 -0700)]
auto merge of #13792 : jacob-hegna/rust/master, r=alexcrichton

Just modified the documentation for parse_bytes to make it more clear how the bytes were parsed (big endian) and to show an example of what it returned.  I also added documentation for the to_str_bytes which previously had no documentation (besides one stackoverflow post).

10 years agoRewrote documentation for parse_bytes and to_str_bytes in {int, uint}_macros.rs
Jacob Hegna [Sun, 27 Apr 2014 20:49:47 +0000 (15:49 -0500)]
Rewrote documentation for parse_bytes and to_str_bytes in {int, uint}_macros.rs

10 years agoauto merge of #13798 : aochagavia/rust/pr, r=alexcrichton
bors [Sun, 27 Apr 2014 20:11:43 +0000 (13:11 -0700)]
auto merge of #13798 : aochagavia/rust/pr, r=alexcrichton

10 years agoauto merge of #13796 : ema-fox/rust/patch-1, r=kballard
bors [Sun, 27 Apr 2014 18:46:46 +0000 (11:46 -0700)]
auto merge of #13796 : ema-fox/rust/patch-1, r=kballard

10 years agoadd BigUint subtraction underflow error message
Ryan Mulligan [Sun, 27 Apr 2014 15:59:07 +0000 (08:59 -0700)]
add BigUint subtraction underflow error message

10 years agoFixed typo in std::iter
Adolfo Ochagavía [Sun, 27 Apr 2014 14:50:55 +0000 (16:50 +0200)]
Fixed typo in std::iter

10 years agoAdded missing values in std::io::standard_error()
m-r-r [Sun, 27 Apr 2014 12:45:28 +0000 (14:45 +0200)]
Added missing values in std::io::standard_error()

10 years agoFix link to hashmap.rs and json.rs in sample code FAQ
Emanuel Rylke [Sun, 27 Apr 2014 12:17:06 +0000 (14:17 +0200)]
Fix link to hashmap.rs and json.rs in sample code FAQ

10 years agorustdoc: External module item links to the module contents. Fixes #12926.
Kang Seonghoon [Sat, 26 Apr 2014 20:08:36 +0000 (05:08 +0900)]
rustdoc: External module item links to the module contents. Fixes #12926.

the basic strategy is to distinguish `mod foo;` from `mod foo {...}`
by checking if the span for the module item and module contents is
in different files. if it's the case, we prefer module contents.

it is technically possible to fix #12926 without changing the AST,
probably by checking the individual items' span. this is not without
a problem though, since it is possible that some items inside
`mod foo {...}` may have originated from other file (e.g. `include!`).
therefore it is better to record both spans explicitly.

10 years agoauto merge of #13783 : wackywendell/rust/permfix, r=kballard
bors [Sun, 27 Apr 2014 06:41:31 +0000 (23:41 -0700)]
auto merge of #13783 : wackywendell/rust/permfix, r=kballard

I filed bugs #13734 and #13759 recently, and then realized I could probably fix them myself. This does exactly that, with a couple additional modifications and additions to the test-suite to pick up on that.

I've never done this before, so please feel free to tell me all the things I'm doing wrong or could be doing better.

10 years agotest: Rename a test to bypass UAC on windows
klutzy [Sun, 27 Apr 2014 06:13:37 +0000 (15:13 +0900)]
test: Rename a test to bypass UAC on windows

10 years agosyntax: `Mod` records the span for inner contents.
Kang Seonghoon [Sat, 26 Apr 2014 20:05:45 +0000 (05:05 +0900)]
syntax: `Mod` records the span for inner contents.

this is useful when the module item and module contents are defined
from different files (like rustdoc). in most cases the original span
for the module item would be used; in other cases, the span for
module contents is available separately at the `inner` field.

10 years agoFixing permutation of small lists, such that [], [x] -> [[]], [[x]], and updating...
Wendell Smith [Fri, 25 Apr 2014 20:19:53 +0000 (16:19 -0400)]
Fixing permutation of small lists, such that [], [x] -> [[]], [[x]], and updating size_hints.
Fixes #13734 and #13759.

10 years agoauto merge of #13777 : lifthrasiir/rust/no-multi-viewitemuse, r=alexcrichton
bors [Sun, 27 Apr 2014 00:01:28 +0000 (17:01 -0700)]
auto merge of #13777 : lifthrasiir/rust/no-multi-viewitemuse, r=alexcrichton

It reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). This legacy affected many portions of rustc and rustdoc as well, so this PR cleans them up altogether.

As a side effect of cleanup, we now have `SCHEMA_VERSION` in `rustdoc::clean` (instead of the crate root), so it has a better chance to be updated when `rustdoc::clean` gets updated.

10 years agoauto merge of #13769 : alexcrichton/rust/restrict-some-scopes, r=huonw
bors [Sat, 26 Apr 2014 13:46:24 +0000 (06:46 -0700)]
auto merge of #13769 : alexcrichton/rust/restrict-some-scopes, r=huonw

This addresses the ICE from #13763, but it does not allow the test to compile,
due to #13768. An alternate test was checked in in the meantime.

Closes #13763

10 years agorustdoc: Moved `SCHEMA_VERSION` to `clean`.
Kang Seonghoon [Sat, 26 Apr 2014 13:45:50 +0000 (22:45 +0900)]
rustdoc: Moved `SCHEMA_VERSION` to `clean`.

it should be changed when the module gets updated, so it helps to
have the `SCHEMA_VERSION` with the definitions themselves.

10 years agosyntax: ViewItemUse no longer contains multiple view paths.
Kang Seonghoon [Sat, 26 Apr 2014 13:33:45 +0000 (22:33 +0900)]
syntax: ViewItemUse no longer contains multiple view paths.

it reflected the obsolete syntax `use a, b, c;` and did not make
past the parser (though it was a non-fatal error so we can continue).
this legacy affected many portions of rustc and rustdoc as well,
so this commit cleans them up altogether.

10 years agoauto merge of #13766 : BurntSushi/rust/regex-dynamic-tests, r=alexcrichton
bors [Sat, 26 Apr 2014 08:16:23 +0000 (01:16 -0700)]
auto merge of #13766 : BurntSushi/rust/regex-dynamic-tests, r=alexcrichton

Before, tests for dynamic regexes ran during stage1 and tests for
native regexes ran during stage2. But the buildbots don't test stage1,
so now both dynamic and native tests are run during stage2.

Closes #13740.

10 years agoauto merge of #13758 : sodaplayer/rust/patch-1, r=alexcrichton
bors [Sat, 26 Apr 2014 06:31:25 +0000 (23:31 -0700)]
auto merge of #13758 : sodaplayer/rust/patch-1, r=alexcrichton

Rustdoc doesn't seem like it's converting the old format to a table as we can see here:
http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface)
This new format should fix that and it's also rendered by Github's markdown preview.

10 years agoauto merge of #13750 : aturon/rust/issue-12583, r=alexcrichton
bors [Sat, 26 Apr 2014 04:51:27 +0000 (21:51 -0700)]
auto merge of #13750 : aturon/rust/issue-12583, r=alexcrichton

Clarifies the interaction of `is_dir`, `is_file` and `exists` with
symbolic links.  Adds a convenience `lstat` function alongside of
`stat`.  Removes references to conditions.

Closes issue #12583.

10 years agoauto merge of #13748 : hjr3/rust/guide-container-update, r=alexcrichton
bors [Sat, 26 Apr 2014 03:06:32 +0000 (20:06 -0700)]
auto merge of #13748 : hjr3/rust/guide-container-update, r=alexcrichton

10 years agoauto merge of #13744 : adrientetar/rust/derp, r=brson
bors [Sat, 26 Apr 2014 01:26:33 +0000 (18:26 -0700)]
auto merge of #13744 : adrientetar/rust/derp, r=brson

- Serve webfonts locally
- Style changes around `blockquote` and `code`
- Minor adjustments from previous changes

Bringing back updated examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm).
And for rustdoc, [modified `enum.FileType`](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm), [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm).

10 years agoclarify docs for std:io::fs::Path::{is_dir,is_file,exists}; add lstat
Aaron Turon [Fri, 25 Apr 2014 17:18:06 +0000 (10:18 -0700)]
clarify docs for std:io::fs::Path::{is_dir,is_file,exists}; add lstat

Clarifies the interaction of `is_dir`, `is_file` and `exists` with
symbolic links.  Adds a convenience `lstat` function alongside of
`stat`.  Removes references to conditions.

Closes issue #12583.

10 years agorustc: Restrict the scope of a borrow on def_map
Alex Crichton [Fri, 25 Apr 2014 21:42:36 +0000 (14:42 -0700)]
rustc: Restrict the scope of a borrow on def_map

This addresses the ICE from #13763, but it does not allow the test to compile,
due to #13768. An alternate test was checked in in the meantime.

Closes #13763

10 years agoTests for dynamic regexes will now run during 'check-stage2'.
Andrew Gallant [Fri, 25 Apr 2014 21:28:05 +0000 (17:28 -0400)]
Tests for dynamic regexes will now run during 'check-stage2'.

Before, tests for dynamic regexes ran during stage1 and tests for
native regexes ran during stage2. But the buildbots don't test stage1,
so now both dynamic and native tests are run during stage2.

Closes #13740.

10 years agoUpdate FFI signature table to use pipe format
John Fresco [Fri, 25 Apr 2014 19:07:30 +0000 (13:07 -0600)]
Update FFI signature table to use pipe format

Rustdoc doesn't seem like it's converting the old format to a table as we can see here:
http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface)
This new format should fix that and it's also rendered by Github's markdown preview.

10 years agoauto merge of #13735 : aturon/rust/float-consts-take-2, r=brson
bors [Fri, 25 Apr 2014 19:01:27 +0000 (12:01 -0700)]
auto merge of #13735 : aturon/rust/float-consts-take-2, r=brson

Follow-up on issue #13297 and PR #13710.  Instead of following the (confusing) C/C++ approach
of using `MIN_VALUE` for the smallest *positive* number, we introduce `MIN_POS_VALUE` (and
in the Float trait, `min_pos_value`) to represent this number.

This patch also removes a few remaining redundantly-defined constants that were missed last
time around.

10 years agoauto merge of #13741 : klutzy/rust/test-reachable, r=alexcrichton
bors [Fri, 25 Apr 2014 17:51:24 +0000 (10:51 -0700)]
auto merge of #13741 : klutzy/rust/test-reachable, r=alexcrichton

It didn't work because it tried to call itself but symbols are not
exported as default in executables.

Note that `fun5` is not internal anymore since it is in library.

Second commit removes/updates some old tests.

10 years agoauto merge of #13747 : michaelfairley/rust/patch-1, r=alexcrichton
bors [Fri, 25 Apr 2014 16:21:20 +0000 (09:21 -0700)]
auto merge of #13747 : michaelfairley/rust/patch-1, r=alexcrichton

10 years agodoc: Update modules for containers
Herman J. Radtke III [Fri, 25 Apr 2014 15:13:22 +0000 (08:13 -0700)]
doc: Update modules for containers

10 years agoFix variable name in prose to match code it's describing
Michael Fairley [Fri, 25 Apr 2014 15:15:47 +0000 (10:15 -0500)]
Fix variable name in prose to match code it's describing

10 years agotest: Remove/update some old ignored tests
klutzy [Fri, 25 Apr 2014 05:29:30 +0000 (14:29 +0900)]
test: Remove/update some old ignored tests

10 years agorustdoc: bring it inline
Adrien Tétar [Fri, 25 Apr 2014 08:34:32 +0000 (17:34 +0900)]
rustdoc: bring it inline

10 years agotest: Enable extern-fn-reachable test
klutzy [Fri, 25 Apr 2014 04:57:54 +0000 (13:57 +0900)]
test: Enable extern-fn-reachable test

It didn't work because it tried to call itself but symbols are not
exported as default in executables.

Note that `fun5` is not internal anymore since it is in library.

10 years agodoc,rustdoc: store webfonts locally
Adrien Tétar [Fri, 25 Apr 2014 08:05:52 +0000 (17:05 +0900)]
doc,rustdoc: store webfonts locally

- Avoids cross-domain requests restrictions
- Better availability of content
- No HTML queries needed for an offline build

10 years agodoc: slight design refresh
Adrien Tétar [Fri, 25 Apr 2014 07:56:55 +0000 (16:56 +0900)]
doc: slight design refresh

10 years agorustdoc: fixes
Adrien Tétar [Fri, 25 Apr 2014 07:56:39 +0000 (16:56 +0900)]
rustdoc: fixes

10 years agoauto merge of #13700 : BurntSushi/rust/regexp, r=alexcrichton
bors [Fri, 25 Apr 2014 06:41:15 +0000 (23:41 -0700)]
auto merge of #13700 : BurntSushi/rust/regexp, r=alexcrichton

Implements [RFC 7](https://github.com/rust-lang/rfcs/blob/master/active/0007-regexps.md) and will hopefully resolve #3591. The crate is marked as experimental. It includes a syntax extension for compiling regexps to native Rust code.

Embeds and passes the `basic`, `nullsubexpr` and `repetition` tests from [Glenn Fowler's (slightly modified by Russ Cox for leftmost-first semantics) testregex test suite](http://www2.research.att.com/~astopen/testregex/testregex.html). I've also hand written a plethora of other tests that exercise Unicode support, the parser, public API, etc. Also includes a `regex-dna` benchmark for the shootout.

I know the addition looks huge at first, but consider these things:

1. More than half the number of lines is dedicated to Unicode character classes.
2. Of the ~4,500 lines remaining, 1,225 of them are comments.
3. Another ~800 are tests.
4. That leaves 2500 lines for the meat. The parser is ~850 of them. The public API, compiler, dynamic VM and code generator (for `regexp!`) make up the rest.

10 years agoIgnore regex tests (regular, cfail and benchmark) on Windows (for now).
Andrew Gallant [Fri, 25 Apr 2014 05:37:27 +0000 (01:37 -0400)]
Ignore regex tests (regular, cfail and benchmark) on Windows (for now).

10 years agoauto merge of #13697 : pongad/rust/consts, r=alexcrichton
bors [Fri, 25 Apr 2014 05:31:16 +0000 (22:31 -0700)]
auto merge of #13697 : pongad/rust/consts, r=alexcrichton

I decided to put architecture constants in another mod. They are not used, so a part of me is thinking of just getting rid of them altogether. The rest should be similar to what @brson wants.
Fixes #13536

10 years agoCleaned up os::consts. The module only exposes constants for the target OS and arch.
Michael Darakananda [Wed, 23 Apr 2014 05:01:31 +0000 (01:01 -0400)]
Cleaned up os::consts. The module only exposes constants for the target OS and arch.

Constants for other OS's and arch's must be defined manually.
[breaking-change]

10 years agomk: Copy fewer libraries into the host artifacts
Andrew Gallant [Fri, 25 Apr 2014 04:31:29 +0000 (00:31 -0400)]
mk: Copy fewer libraries into the host artifacts

10 years agoAdd a regex crate to the Rust distribution.
Andrew Gallant [Fri, 25 Apr 2014 04:27:24 +0000 (00:27 -0400)]
Add a regex crate to the Rust distribution.

Also adds a regex_macros crate, which provides natively compiled
regular expressions with a syntax extension.

Closes #3591.

RFC: 0007-regexps

10 years agoauto merge of #13723 : alexcrichton/rust/pipe-connect-timeout, r=brson
bors [Fri, 25 Apr 2014 02:36:14 +0000 (19:36 -0700)]
auto merge of #13723 : alexcrichton/rust/pipe-connect-timeout, r=brson

This adds support for connecting to a unix socket with a timeout (a named pipe
on windows), and accepting a connection with a timeout. The goal is to bring
unix pipes/named sockets back in line with TCP support for timeouts.

Similarly to the TCP sockets, all methods are marked #[experimental] due to
uncertainty about the type of the timeout argument.

This internally involved a good bit of refactoring to share as much code as
possible between TCP servers and pipe servers, but the core implementation did
not change drastically as part of this commit.

cc #13523

10 years agoauto merge of #13711 : alexcrichton/rust/snapshots, r=brson
bors [Fri, 25 Apr 2014 01:26:15 +0000 (18:26 -0700)]
auto merge of #13711 : alexcrichton/rust/snapshots, r=brson

These are the first successful snapshots after the LLVM upgrade, built with LLVM
that requires C++11

10 years agoauto merge of #13671 : dcrewi/rust/lint-directives-on-use-items, r=alexcrichton
bors [Fri, 25 Apr 2014 00:16:14 +0000 (17:16 -0700)]
auto merge of #13671 : dcrewi/rust/lint-directives-on-use-items, r=alexcrichton

Fixes #10534

10 years agoadd min_pos_value constant for floats
Aaron Turon [Fri, 25 Apr 2014 00:09:58 +0000 (17:09 -0700)]
add min_pos_value constant for floats

Follow-up on issue #13297 and PR #13710.  Instead of following the (confusing) C/C++ approach
of using `MIN_VALUE` for the smallest *positive* number, we introduce `MIN_POS_VALUE` (and
in the Float trait, `min_pos_value`) to represent this number.

This patch also removes a few remaining redundantly-defined constants that were missed last
time around.

10 years agostd: Add timeouts to unix connect/accept
Alex Crichton [Wed, 23 Apr 2014 01:38:59 +0000 (18:38 -0700)]
std: Add timeouts to unix connect/accept

This adds support for connecting to a unix socket with a timeout (a named pipe
on windows), and accepting a connection with a timeout. The goal is to bring
unix pipes/named sockets back in line with TCP support for timeouts.

Similarly to the TCP sockets, all methods are marked #[experimental] due to
uncertainty about the type of the timeout argument.

This internally involved a good bit of refactoring to share as much code as
possible between TCP servers and pipe servers, but the core implementation did
not change drastically as part of this commit.

cc #13523

10 years agonative: Remove unused and untested UnixDatagram
Alex Crichton [Tue, 22 Apr 2014 23:23:19 +0000 (16:23 -0700)]
native: Remove unused and untested UnixDatagram

10 years agoauto merge of #13729 : chris-morgan/rust/fix-vim-indent, r=alexcrichton
bors [Thu, 24 Apr 2014 22:01:19 +0000 (15:01 -0700)]
auto merge of #13729 : chris-morgan/rust/fix-vim-indent, r=alexcrichton

The change in #13600 was incorrect, containing a bad regular expression;
inside an indent function, errors are silently ignored (and the ``~=``
operation will return 0), so it just always failed, causing the cases
that were supposed to be caught to not be caught and making things like
the ``match`` example shown above or struct field definitions regress.

I have fixed the regular expression to what it should have been. This is
still imperfect, of course, not handling cases like where the first
argument to a function is a function call (``foo(bar(),``), but it'll do
for now.

----

I have a general request to make of reviewers about any changes made to `src/etc/vim`: **please tell me**. As a general rule I want to review them. (I’ll make an exception for changes the prelude; it needs fixing from time to time when some people don’t update the syntax file, anyway.)

cc @brandonw

10 years agoauto merge of #13720 : aturon/rust/walk_dir-perf, r=alexcrichton
bors [Thu, 24 Apr 2014 20:51:19 +0000 (13:51 -0700)]
auto merge of #13720 : aturon/rust/walk_dir-perf, r=alexcrichton

The `walk_dir` iterator was simulating a queue using a vector (in particular, using `shift`),
leading to O(n^2) performance. Since the order was not well-specified (see issue #13411),
the simplest fix is to use the vector as a stack (and thus yield a depth-first traversal).
This patch does exactly that, and adds a test checking for depth-first behavior.

Note that the underlying `readdir` function does not specify any particular order, nor
does the system call it uses.

Closes #13411.

10 years agoauto merge of #13706 : alexcrichton/rust/test-nocapture, r=brson
bors [Thu, 24 Apr 2014 18:31:22 +0000 (11:31 -0700)]
auto merge of #13706 : alexcrichton/rust/test-nocapture, r=brson

A new flag to the test runner, --nocapture, can be passed to instruct that the
output of tests should not be captured by default. The behavior can also be
triggered via a RUST_TEST_NOCAPTURE environment variable being set.

Closes #13374

10 years agofix O(n^2) perf bug for std::io::fs::walk_dir
Aaron Turon [Thu, 24 Apr 2014 00:09:58 +0000 (17:09 -0700)]
fix O(n^2) perf bug for std::io::fs::walk_dir

The `walk_dir` iterator was simulating a queue using a vector (in particular, using `shift`),
leading to O(n^2) performance. Since the order was not well-specified (see issue #13411),
the simplest fix is to use the vector as a stack (and thus yield a depth-first traversal).
This patch does exactly that.  It leaves the order as originally specified -- "some top-down
order" -- and adds a test to ensure a top-down traversal.

Note that the underlying `readdir` function does not specify any particular order, nor
does the system call it uses.

Closes #13411.

10 years agoauto merge of #13619 : alexcrichton/rust/update-libuv, r=brson
bors [Thu, 24 Apr 2014 17:21:22 +0000 (10:21 -0700)]
auto merge of #13619 : alexcrichton/rust/update-libuv, r=brson

This update brings a few months of changes, but primarily a fix for the
following situation.

When creating a handle to stdin, libuv used to set the stdin handle to
nonblocking mode. This would end up affect this stdin handle across all
processes that shared it, which mean that stdin become nonblocking for everyone
using the same stdin. On linux, this also affected *stdout* because stdin/stdout
roughly point at the same thing.

This problem became apparent when running the test suite manually on a local
computer. The stdtest suite (running with libgreen) would set stdout to
nonblocking mode (as described above), and then the next test suite would always
fail for a printing failure (because stdout was returning EAGAIN).

This has been fixed upstream, joyent/libuv@342e8c, and this update pulls in this
fix. This also brings us in line with a recently upstreamed libuv patch.

Closes #12827
Closes #13336
Closes #13355

10 years agotest: Add an option to not capture output
Alex Crichton [Wed, 23 Apr 2014 16:38:46 +0000 (09:38 -0700)]
test: Add an option to not capture output

A new flag to the test runner, --nocapture, can be passed to instruct that the
output of tests should not be captured by default. The behavior can also be
triggered via a RUST_TEST_NOCAPTURE environment variable being set.

Closes #13374

10 years agoUpdate libuv
Alex Crichton [Sat, 19 Apr 2014 02:09:31 +0000 (19:09 -0700)]
Update libuv

This update brings a few months of changes, but primarily a fix for the
following situation.

When creating a handle to stdin, libuv used to set the stdin handle to
nonblocking mode. This would end up affect this stdin handle across all
processes that shared it, which mean that stdin become nonblocking for everyone
using the same stdin. On linux, this also affected *stdout* because stdin/stdout
roughly point at the same thing.

This problem became apparent when running the test suite manually on a local
computer. The stdtest suite (running with libgreen) would set stdout to
nonblocking mode (as described above), and then the next test suite would always
fail for a printing failure (because stdout was returning EAGAIN).

This has been fixed upstream, joyent/libuv@342e8c, and this update pulls in this
fix. This also brings us in line with a recently upstreamed libuv patch.

Closes #13336
Closes #13355

10 years agoauto merge of #13715 : nick29581/rust/unsized-assign2, r=nikomatsakis
bors [Thu, 24 Apr 2014 15:16:24 +0000 (08:16 -0700)]
auto merge of #13715 : nick29581/rust/unsized-assign2, r=nikomatsakis

Closes #13376.

10 years agoauto merge of #13713 : edwardw/rust/methodcall-span, r=alexcrichton
bors [Thu, 24 Apr 2014 14:06:26 +0000 (07:06 -0700)]
auto merge of #13713 : edwardw/rust/methodcall-span, r=alexcrichton

Specifically, the method parameter cardinality mismatch or missing
method error message span now gets method itself exactly. It was the
whole expression.

Closes #9390
Closes #13684
Closes #13709

10 years agoFix Vim indent regressions from #13600.
Chris Morgan [Thu, 24 Apr 2014 13:33:28 +0000 (23:33 +1000)]
Fix Vim indent regressions from #13600.

The change in #13600 was incorrect, containing a bad regular expression;
inside an indent function, errors are silently ignored (and the ``~=``
operation will return 0), so it just always failed, causing the cases
that were supposed to be caught to not be caught and making things like
the ``match`` example shown above or struct field definitions regress.

I have fixed the regular expression to what it should have been. This is
still imperfect, of course, not handling cases like where the first
argument to a function is a function call (``foo(bar(),``), but it'll do
for now.

10 years agoauto merge of #13559 : FlaPer87/rust/remove-special-root, r=nikomatsakis
bors [Thu, 24 Apr 2014 12:51:28 +0000 (05:51 -0700)]
auto merge of #13559 : FlaPer87/rust/remove-special-root, r=nikomatsakis

This patch removes the special auto-rooting for `@` from the borrow checker. With `@` moving into a library, it doesn't make sense to keep this code around anymore. It also simplifies `trans` by removing root checking from there

@nikomatsakis

Closes: #11586
10 years agoauto merge of #13710 : aturon/rust/float-constants, r=brson
bors [Thu, 24 Apr 2014 10:21:28 +0000 (03:21 -0700)]
auto merge of #13710 : aturon/rust/float-constants, r=brson

Some of the constant values in std::f32 were incorrectly copied from
std::f64.  More broadly, both modules defined their constants redundantly
in two places, which is what led to the bug.  Moreover, the specs for
some of the constants were incorrect, even when the values were correct.

Closes #13297.  Closes #11537.

10 years agorustdoc: fix de-@rooting fallout
Niko Matsakis [Thu, 24 Apr 2014 03:29:38 +0000 (23:29 -0400)]
rustdoc: fix de-@rooting fallout

10 years agoauto merge of #13531 : alexcrichton/rust/fix-some-ices, r=brson
bors [Thu, 24 Apr 2014 08:26:29 +0000 (01:26 -0700)]
auto merge of #13531 : alexcrichton/rust/fix-some-ices, r=brson

See the commits for the affected issues.

10 years agoauto merge of #12812 : sfackler/rust/attr-arm, r=alexcrichton
bors [Thu, 24 Apr 2014 06:51:30 +0000 (23:51 -0700)]
auto merge of #12812 : sfackler/rust/attr-arm, r=alexcrichton

This is really only useful for #[cfg()]. For example:

```rust
enum Foo {
    Bar,
    Baz,
    #[cfg(blob)]
    Blob
}

fn match_foos(f: &Foo) {
    match *f {
        Bar => {}
        Baz => {}
        #[cfg(blob)]
        Blob => {}
    }
}
```

This is a kind of weird place to allow attributes, so it should probably
be discussed before merging.

10 years agoAllow attributes on match arms
Steven Fackler [Wed, 23 Apr 2014 04:54:48 +0000 (21:54 -0700)]
Allow attributes on match arms

RFC: 0008-match-arm-attributes

10 years agoauto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichton
bors [Thu, 24 Apr 2014 04:46:34 +0000 (21:46 -0700)]
auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichton

Closes #13698

10 years agoauto merge of #13675 : sfackler/rust/taskbuilder-new, r=alexcrichton
bors [Thu, 24 Apr 2014 03:31:36 +0000 (20:31 -0700)]
auto merge of #13675 : sfackler/rust/taskbuilder-new, r=alexcrichton

The constructor for `TaskBuilder` is being changed to an associated
function called `new` for consistency with the rest of the standard
library.

Closes #13666

[breaking-change]

10 years agoMove task::task() to TaskBuilder::new()
Steven Fackler [Tue, 22 Apr 2014 04:19:59 +0000 (21:19 -0700)]
Move task::task() to TaskBuilder::new()

The constructor for `TaskBuilder` is being changed to an associated
function called `new` for consistency with the rest of the standard
library.

Closes #13666

[breaking-change]

10 years agoauto merge of #13688 : alexcrichton/rust/accept-timeout, r=brson
bors [Thu, 24 Apr 2014 02:21:33 +0000 (19:21 -0700)]
auto merge of #13688 : alexcrichton/rust/accept-timeout, r=brson

This adds experimental support for timeouts when accepting sockets through
`TcpAcceptor::accept`. This does not add a separate `accept_timeout` function,
but rather it adds a `set_timeout` function instead. This second function is
intended to be used as a hard deadline after which all accepts will never block
and fail immediately.

This idea was derived from Go's SetDeadline() methods. We do not currently have
a robust time abstraction in the standard library, so I opted to have the
argument be a relative time in millseconds into the future. I believe a more
appropriate argument type is an absolute time, but this concept does not exist
yet (this is also why the function is marked #[experimental]).

The native support is built on select(), similarly to connect_timeout(), and the
green support is based on channel select and a timer.

cc #13523

10 years agostd: Add support for an accept() timeout
Alex Crichton [Tue, 22 Apr 2014 03:30:07 +0000 (20:30 -0700)]
std: Add support for an accept() timeout

This adds experimental support for timeouts when accepting sockets through
`TcpAcceptor::accept`. This does not add a separate `accept_timeout` function,
but rather it adds a `set_timeout` function instead. This second function is
intended to be used as a hard deadline after which all accepts will never block
and fail immediately.

This idea was derived from Go's SetDeadline() methods. We do not currently have
a robust time abstraction in the standard library, so I opted to have the
argument be a relative time in millseconds into the future. I believe a more
appropriate argument type is an absolute time, but this concept does not exist
yet (this is also why the function is marked #[experimental]).

The native support is built on select(), similarly to connect_timeout(), and the
green support is based on channel select and a timer.

cc #13523

10 years agoPrevent unsized types being stored in variables
Nick Cameron [Wed, 23 Apr 2014 23:57:22 +0000 (11:57 +1200)]
Prevent unsized types being stored in variables

Closes #13376.