]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13789 : sfackler/rust/debug-assert, r=pcwalton
bors [Fri, 2 May 2014 06:41:46 +0000 (23:41 -0700)]
auto merge of #13789 : sfackler/rust/debug-assert, r=pcwalton

I switched the `assert!` calls in `RefCell` over to `debug_assert!`.
There are probably other instances that should be converted as well, but
I couldn't think of any off the top of my head.

RFC: 0015-assert

10 years agoauto merge of #13886 : japaric/rust/fix-an-typos, r=alexcrichton
bors [Fri, 2 May 2014 03:11:47 +0000 (20:11 -0700)]
auto merge of #13886 : japaric/rust/fix-an-typos, r=alexcrichton

Found the first one in the rust reference docs. I was going to submit a PR with one fix, but figured I could look for more... This is the result.

10 years agoRemove useless assert! case
Steven Fackler [Sun, 27 Apr 2014 02:55:26 +0000 (19:55 -0700)]
Remove useless assert! case

10 years agoAdd debug_assert and debug_assert_eq macros
Steven Fackler [Sun, 27 Apr 2014 01:25:20 +0000 (18:25 -0700)]
Add debug_assert and debug_assert_eq macros

I also switched some `assert!` calls over to `debug_assert!`.

Closes #12049.

RFC: 0015-assert

10 years agoFix a/an typos
Jorge Aparicio [Fri, 2 May 2014 01:02:11 +0000 (20:02 -0500)]
Fix a/an typos

10 years agoauto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichton
bors [Thu, 1 May 2014 23:06:48 +0000 (16:06 -0700)]
auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichton

10 years agofix error message for obsolete &"foo" literal
Daniel Micay [Thu, 1 May 2014 07:00:19 +0000 (03:00 -0400)]
fix error message for obsolete &"foo" literal

10 years agoremove leftover obsolete string literals
Daniel Micay [Thu, 1 May 2014 05:32:13 +0000 (01:32 -0400)]
remove leftover obsolete string literals

10 years agoauto merge of #13881 : aochagavia/rust/pr, r=alexcrichton
bors [Thu, 1 May 2014 20:31:59 +0000 (13:31 -0700)]
auto merge of #13881 : aochagavia/rust/pr, r=alexcrichton

10 years agoauto merge of #13878 : brutal-chaos/rust/tutorial_grammar, r=alexcrichton
bors [Thu, 1 May 2014 19:06:52 +0000 (12:06 -0700)]
auto merge of #13878 : brutal-chaos/rust/tutorial_grammar, r=alexcrichton

10 years agoauto merge of #13875 : hjr3/rust/serialize-strbuf, r=alexcrichton
bors [Thu, 1 May 2014 16:41:54 +0000 (09:41 -0700)]
auto merge of #13875 : hjr3/rust/serialize-strbuf, r=alexcrichton

- implement Encodable and Decodable for StrBuf
- implement to_json for StrBuf

10 years agoFixed outdated note in the tutorial
Adolfo Ochagavía [Thu, 1 May 2014 15:52:17 +0000 (17:52 +0200)]
Fixed outdated note in the tutorial

10 years agoauto merge of #13724 : nikomatsakis/rust/expr-use-visitor, r=pnkfelix
bors [Thu, 1 May 2014 11:36:50 +0000 (04:36 -0700)]
auto merge of #13724 : nikomatsakis/rust/expr-use-visitor, r=pnkfelix

Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove the
moves computation. ExprUseVisitor is a visitor that walks the AST for a
function and calls a delegate to inform it where borrows, copies, and moves
occur.

In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in
future patches, I think we could rewrite regionck, check_loans, and possibly
other passes to use it as well. This would refactor the repeated code between
those places that tries to determine where copies/moves/etc occur.

r? @alexcrichton

10 years agorustdoc tutorial: grammar change in list comments
Justin Noah [Thu, 1 May 2014 08:16:30 +0000 (01:16 -0700)]
rustdoc tutorial: grammar change in list comments

10 years agoauto merge of #13873 : alexcrichton/rust/issue-13872, r=Aatch
bors [Thu, 1 May 2014 07:56:48 +0000 (00:56 -0700)]
auto merge of #13873 : alexcrichton/rust/issue-13872, r=Aatch

This was just a typo in the decoder using the source crate's number rather than
the destination crate's number of a reexport.

Closes #13872

10 years agoAdd serialization support for StrBuf
Herman J. Radtke III [Wed, 30 Apr 2014 22:55:04 +0000 (15:55 -0700)]
Add serialization support for StrBuf

- implement Encodable and Decodable for StrBuf
- implement to_json for StrBuf

10 years agorustc: Fix def ids of xcrate-reexported items
Alex Crichton [Thu, 1 May 2014 02:24:21 +0000 (19:24 -0700)]
rustc: Fix def ids of xcrate-reexported items

This was just a typo in the decoder using the source crate's number rather than
the destination crate's number of a reexport.

Closes #13872

10 years agoAddress nits from @pnkfelix
Niko Matsakis [Thu, 1 May 2014 00:22:36 +0000 (20:22 -0400)]
Address nits from @pnkfelix

10 years agolibrustc: Remove `~"string"` and `&"string"` from the language
Patrick Walton [Wed, 30 Apr 2014 23:49:12 +0000 (16:49 -0700)]
librustc: Remove `~"string"` and `&"string"` from the language

10 years agoauto merge of #13648 : gereeter/rust/removed-rev, r=alexcrichton
bors [Wed, 30 Apr 2014 22:46:47 +0000 (15:46 -0700)]
auto merge of #13648 : gereeter/rust/removed-rev, r=alexcrichton

In the process, `Splits` got changed to be more like `CharSplits` in `str` to present the DEI interface.

Note that `treemap` still has a `rev_iter` function because it seems like it would be a significant interface change to expose a DEI - the iterator would have to gain an extra pointer, the completion checks would be more complicated, and it isn't easy to check that such an implementation is correct due to the use of unsafety to subvert the aliasing properties of `&mut`.

This fixes #9391.

10 years agoauto merge of #13864 : adrientetar/rust/fix-it-some-more, r=alexcrichton
bors [Wed, 30 Apr 2014 21:06:47 +0000 (14:06 -0700)]
auto merge of #13864 : adrientetar/rust/fix-it-some-more, r=alexcrichton

Two selector fixes for rustdoc:

- links colored in blue (#13807) was also affecting headers, which are anchored to their respective ids
- the header unstyling from #13776 was being applied to all headers also

Additionally, remove a stray title in the documentation. This makes the crate title of prelude appear as header instead of an inline paragraph of text (all others work normally and do not have that header tag).

The design is unchanged from my previous template (e.g. [here](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm)), however it is now properly applied.
The last fix remaining is to enable webfonts service from `static.rust-lang.org`, this is #13593.

r? @alexcrichton, @brson

10 years agoauto merge of #13072 : bjz/rust/bitset, r=alexcrichton
bors [Wed, 30 Apr 2014 18:11:49 +0000 (11:11 -0700)]
auto merge of #13072 : bjz/rust/bitset, r=alexcrichton

The `bitflags!` macro generates a `struct` that holds a set of C-style bitmask flags. It is useful for creating typesafe wrappers for C APIs.

For example:

~~~rust
#[feature(phase)];
#[phase(syntax)] extern crate collections;

bitflags!(Flags: u32 {
    FlagA       = 0x00000001,
    FlagB       = 0x00000010,
    FlagC       = 0x00000100,
    FlagABC     = FlagA.bits
                | FlagB.bits
                | FlagC.bits
})

fn main() {
    let e1 = FlagA | FlagC;
    let e2 = FlagB | FlagC;
    assert!((e1 | e2) == FlagABC);   // union
    assert!((e1 & e2) == FlagC);     // intersection
    assert!((e1 - e2) == FlagA);     // set difference
}
~~~

10 years agoUpdate for language changes
Brendan Zabarauskas [Wed, 30 Apr 2014 17:02:11 +0000 (10:02 -0700)]
Update for language changes

10 years agoMove bitflags module to libstd
Brendan Zabarauskas [Wed, 30 Apr 2014 03:05:51 +0000 (20:05 -0700)]
Move bitflags module to libstd

This will allow us to provide type-safe APIs in libstd that are C-compatible.

10 years agoauto merge of #13863 : huonw/rust/re-tweaks, r=pcwalton
bors [Wed, 30 Apr 2014 16:41:51 +0000 (09:41 -0700)]
auto merge of #13863 : huonw/rust/re-tweaks, r=pcwalton

Mostly code style e.g. avoiding `~` and using `for` + iterators.

10 years agorustdoc: fix overly broad selectors
Adrien Tétar [Wed, 30 Apr 2014 15:35:54 +0000 (17:35 +0200)]
rustdoc: fix overly broad selectors

10 years agoauto merge of #12740 : nical/rust/json-streaming, r=erickt
bors [Wed, 30 Apr 2014 09:01:43 +0000 (02:01 -0700)]
auto merge of #12740 : nical/rust/json-streaming, r=erickt

Hi rust enthusiasts,

With this patch I propose to add a "streaming" API to the existing json parser in libserialize.

By "streaming" I mean a parser that let you act on JsonEvents that are generated as while parsing happens, as opposed to parsing the entire source, generating a big data structure and working with this data structure. I think both approaches have their pros and cons so this pull request adds the streaming API, preserving the existing one.

The streaming API is simple: It consist into an Iterator<JsonEvent> that consumes an Iterator<char>. JsonEvent is an enum with values such as NumberValue(f64), BeginList, EndList, BeginObject, etc.

The user would ideally use the API as follows:

```
for evt in StreamingParser::new(src) {
  match evt {
    BeginList => {
       // ...
    }
    // ...
  }
}
```

The iterator provides a stack() method returning a slice of StackNodes which represent "where we currently are" in the logical structure of the json stream (for instance at "foo.bar[3].x" you get [ Key("foo"), Key("bar"), Index(3), Key("x") ].)

I wrote "ideally" above because the current way rust expands for loops, you can't call the stack() method because the iterator is already borrowed. So for know you need to manually advance the iterator in the loop. I hope this is something we can cope with, until for loops are better integrated with the compiler.

Streaming parsers are useful when you want to read from a json stream, generate a custom data structure and you know how the json is going to be structured. For example, imagine you have to parse a 3D mesh file represented in the json format. In this case you probably expect to have large arrays of vertices and using the generic parser will be very inefficient because it will create a big list of all these vertices, which you will copy into a contiguous array afterwards (so you end up doing a lot of small allocations, parsing the json once and parsing the data structure afterwards). With a streaming parser, you can add the vertices to a contiguous array as they come in without paying the cost of creating the intermediate Json data structure. You have much fewer allocations since you write directly in the final data structure and you can be smart in how you will pre-allocate it.

I added added this directly into serialize::json rather than in its own library because it turns out I can reuse most of the existing code whereas maintaining a separate library (which I did originally) forces me to duplicate this code.

I wrote this trying to minimize the size of the patch so there may be places where the code could be nicer at the expenses of more changes (let me know what you prefer).

This is my first (potential) contribution to rust, so please let me know if I am doing something wrong (maybe I should have first introduced this proposition in the mailing list, or opened a github issue, etc.?). I work a few meters away from @pknfelix so I am not too hard to find :)

10 years agoauto merge of #13857 : alexcrichton/rust/add-dylib-paths, r=brson
bors [Wed, 30 Apr 2014 02:46:44 +0000 (19:46 -0700)]
auto merge of #13857 : alexcrichton/rust/add-dylib-paths, r=brson

When a syntax extension is loaded by the compiler, the dylib that is opened may
have other dylibs that it depends on. The dynamic linker must be able to find
these libraries on the system or else the library will fail to load.

Currently, unix gets by with the use of rpaths. This relies on the dylib not
moving around too drastically relative to its dependencies. For windows,
however, this is no rpath available, and in theory unix should work without
rpaths as well.

This modifies the compiler to add all -L search directories to the dynamic
linker's set of load paths. This is currently managed through environment
variables for each platform.

Closes #13848

10 years agorustc: Add search paths to dylib load paths
Alex Crichton [Tue, 29 Apr 2014 18:38:51 +0000 (11:38 -0700)]
rustc: Add search paths to dylib load paths

When a syntax extension is loaded by the compiler, the dylib that is opened may
have other dylibs that it depends on. The dynamic linker must be able to find
these libraries on the system or else the library will fail to load.

Currently, unix gets by with the use of rpaths. This relies on the dylib not
moving around too drastically relative to its dependencies. For windows,
however, this is no rpath available, and in theory unix should work without
rpaths as well.

This modifies the compiler to add all -L search directories to the dynamic
linker's set of load paths. This is currently managed through environment
variables for each platform.

Closes #13848

10 years agoDocument derived traits for bitset! macro
Brendan Zabarauskas [Sun, 23 Mar 2014 01:31:20 +0000 (12:31 +1100)]
Document derived traits for bitset! macro

10 years agoDocument how generated bitflags can be extended with type and trait implementations
Brendan Zabarauskas [Sun, 23 Mar 2014 00:34:07 +0000 (11:34 +1100)]
Document how generated bitflags can be extended with type and trait implementations

10 years agoAdd a bitflags! macro
Brendan Zabarauskas [Sat, 22 Mar 2014 08:38:15 +0000 (19:38 +1100)]
Add a bitflags! macro

The `bitflags!` macro generates a `struct` that holds a set of C-style bitmask flags. It is useful for creating typesafe wrappers for C APIs.

For example:

~~~rust
#[feature(phase)];
#[phase(syntax)] extern crate collections;

bitflags!(Flags: u32 {
    FlagA       = 0x00000001,
    FlagB       = 0x00000010,
    FlagC       = 0x00000100,
    FlagABC     = FlagA.bits
                | FlagB.bits
                | FlagC.bits
})

fn main() {
    let e1 = FlagA | FlagC;
    let e2 = FlagB | FlagC;
    assert!((e1 | e2) == FlagABC);   // union
    assert!((e1 & e2) == FlagC);     // intersection
    assert!((e1 - e2) == FlagA);     // set difference
}
~~~

10 years agoauto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brson
bors [Wed, 30 Apr 2014 01:26:44 +0000 (18:26 -0700)]
auto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brson

- Closes #13591. Relevant example: http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm
(Had to use `!important` to override CSS selector precedence, namely matching over parent class.)
- Implement changes from #13780 feedback, namely:
  * Changed font-size from 18px to 15px
  * Reintroduced gray background for code samples
  * Tightened up the margins
- Fix point 1 and point 4 of #13804.

Samples:

- [enum.FileType](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm)
- [struct.CChars](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm)
- [std](http://adrientetar.legtux.org/cached/rust-docs/std.htm)
- [std::io](http://adrientetar.legtux.org/cached/rust-docs/io.htm).

r? @brson

10 years agoregex: General style tweaks.
Huon Wilson [Tue, 29 Apr 2014 14:55:28 +0000 (00:55 +1000)]
regex: General style tweaks.

For loops are nicer than manual whiles, etc.

10 years agoauto merge of #13833 : alexcrichton/rust/ffunction-sections, r=thestinger
bors [Tue, 29 Apr 2014 23:16:46 +0000 (16:16 -0700)]
auto merge of #13833 : alexcrichton/rust/ffunction-sections, r=thestinger

The compiler has previously been producing binaries on the order of 1.8MB for
hello world programs "fn main() {}". This is largely a result of the compilation
model used by compiling entire libraries into a single object file and because
static linking is favored by default.

When linking, linkers will pull in the entire contents of an object file if any
symbol from the object file is used. This means that if any symbol from a rust
library is used, the entire library is pulled in unconditionally, regardless of
whether the library is used or not.

Traditional C/C++ projects do not normally encounter these large executable
problems because their archives (rust's rlibs) are composed of many objects.
Because of this, linkers can eliminate entire objects from being in the final
executable. With rustc, however, the linker does not have the opportunity to
leave out entire object files.

In order to get similar benefits from dead code stripping at link time, this
commit enables the -ffunction-sections and -fdata-sections flags in LLVM, as
well as passing --gc-sections to the linker *by default*. This means that each
function and each global will be placed into its own section, allowing the
linker to GC all unused functions and data symbols.

By enabling these flags, rust is able to generate much smaller binaries default.
On linux, a hello world binary went from 1.8MB to 597K (a 67% reduction in
size). The output size of dynamic libraries remained constant, but the output
size of rlibs increased, as seen below:

    libarena       -  2.27% bigger
    libcollections -  0.64% bigger
    libflate       -  0.85% bigger
    libfourcc      - 14.67% bigger
    libgetopts     -  4.52% bigger
    libglob        -  2.74% bigger
    libgreen       -  9.68% bigger
    libhexfloat    - 13.68% bigger
    liblibc        - 10.79% bigger
    liblog         - 10.95% bigger
    libnative      -  8.34% bigger
    libnum         -  2.31% bigger
    librand        -  1.71% bigger
    libregex       -  6.43% bigger
    librustc       -  4.21% bigger
    librustdoc     -  8.98% bigger
    librustuv      -  4.11% bigger
    libsemver      -  2.68% bigger
    libserialize   -  1.92% bigger
    libstd         -  3.59% bigger
    libsync        -  3.96% bigger
    libsyntax      -  4.96% bigger
    libterm        - 13.96% bigger
    libtest        -  6.03% bigger
    libtime        -  2.86% bigger
    liburl         -  6.59% bigger
    libuuid        -  4.70% bigger
    libworkcache   -  8.44% bigger

This increase in size is a result of encoding many more section names into each
object file (rlib). These increases are moderate enough that this change seems
worthwhile to me, due to the drastic improvements seen in the final artifacts.
The overall increase of the stage2 target folder (not the size of an install)
went from 337MB to 348MB (3% increase).

Additionally, linking is generally slower when executed with all these new
sections plus the --gc-sections flag. The stage0 compiler takes 1.4s to link the
`rustc` binary, where the stage1 compiler takes 1.9s to link the binary. Three
megabytes are shaved off the binary. I found this increase in link time to be
acceptable relative to the benefits of code size gained.

This commit only enables --gc-sections for *executables*, not dynamic libraries.
LLVM does all the heavy lifting when producing an object file for a dynamic
library, so there is little else for the linker to do (remember that we only
have one object file).

I conducted similar experiments by putting a *module's* functions and data
symbols into its own section (granularity moved to a module level instead of a
function/static level). The size benefits of a hello world were seen to be on
the order of 400K rather than 1.2MB. It seemed that enough benefit was gained
using ffunction-sections that this route was less desirable, despite the lesser
increases in binary rlib size.

10 years agoauto merge of #13772 : brson/rust/cratedocs, r=alexcrichton
bors [Tue, 29 Apr 2014 21:26:49 +0000 (14:26 -0700)]
auto merge of #13772 : brson/rust/cratedocs, r=alexcrichton

Also move prelude explanation to the prelude module.

This tries to provide a guide to what's in the standard library, organized bottom up from primitives to I/O.

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 agorustc: Enable -f{function,data}-sections
Alex Crichton [Tue, 29 Apr 2014 00:17:18 +0000 (17:17 -0700)]
rustc: Enable -f{function,data}-sections

The compiler has previously been producing binaries on the order of 1.8MB for
hello world programs "fn main() {}". This is largely a result of the compilation
model used by compiling entire libraries into a single object file and because
static linking is favored by default.

When linking, linkers will pull in the entire contents of an object file if any
symbol from the object file is used. This means that if any symbol from a rust
library is used, the entire library is pulled in unconditionally, regardless of
whether the library is used or not.

Traditional C/C++ projects do not normally encounter these large executable
problems because their archives (rust's rlibs) are composed of many objects.
Because of this, linkers can eliminate entire objects from being in the final
executable. With rustc, however, the linker does not have the opportunity to
leave out entire object files.

In order to get similar benefits from dead code stripping at link time, this
commit enables the -ffunction-sections and -fdata-sections flags in LLVM, as
well as passing --gc-sections to the linker *by default*. This means that each
function and each global will be placed into its own section, allowing the
linker to GC all unused functions and data symbols.

By enabling these flags, rust is able to generate much smaller binaries default.
On linux, a hello world binary went from 1.8MB to 597K (a 67% reduction in
size). The output size of dynamic libraries remained constant, but the output
size of rlibs increased, as seen below:

    libarena         -  2.27% bigger (   292872 =>    299508)
    libcollections   -  0.64% bigger (  6765884 =>   6809076)
    libflate         -  0.83% bigger (   186516 =>    188060)
    libfourcc        - 14.71% bigger (   307290 =>    352498)
    libgetopts       -  4.42% bigger (   761468 =>    795102)
    libglob          -  2.73% bigger (   899932 =>    924542)
    libgreen         -  9.63% bigger (  1281718 =>   1405124)
    libhexfloat      - 13.88% bigger (   333738 =>    380060)
    liblibc          - 10.79% bigger (   551280 =>    610736)
    liblog           - 10.93% bigger (   218208 =>    242060)
    libnative        -  8.26% bigger (  1362096 =>   1474658)
    libnum           -  2.34% bigger (  2583400 =>   2643916)
    librand          -  1.72% bigger (  1608684 =>   1636394)
    libregex         -  6.50% bigger (  1747768 =>   1861398)
    librustc         -  4.21% bigger (151820192 => 158218924)
    librustdoc       -  8.96% bigger ( 13142604 =>  14320544)
    librustuv        -  4.13% bigger (  4366896 =>   4547304)
    libsemver        -  2.66% bigger (   396166 =>    406686)
    libserialize     -  1.91% bigger (  6878396 =>   7009822)
    libstd           -  3.59% bigger ( 39485286 =>  40902218)
    libsync          -  3.95% bigger (  1386390 =>   1441204)
    libsyntax        -  4.96% bigger ( 35757202 =>  37530798)
    libterm          - 13.99% bigger (   924580 =>   1053902)
    libtest          -  6.04% bigger (  2455720 =>   2604092)
    libtime          -  2.84% bigger (  1075708 =>   1106242)
    liburl           -  6.53% bigger (   590458 =>    629004)
    libuuid          -  4.63% bigger (   326350 =>    341466)
    libworkcache     -  8.45% bigger (  1230702 =>   1334750)

This increase in size is a result of encoding many more section names into each
object file (rlib). These increases are moderate enough that this change seems
worthwhile to me, due to the drastic improvements seen in the final artifacts.
The overall increase of the stage2 target folder (not the size of an install)
went from 337MB to 348MB (3% increase).

Additionally, linking is generally slower when executed with all these new
sections plus the --gc-sections flag. The stage0 compiler takes 1.4s to link the
`rustc` binary, where the stage1 compiler takes 1.9s to link the binary. Three
megabytes are shaved off the binary. I found this increase in link time to be
acceptable relative to the benefits of code size gained.

This commit only enables --gc-sections for *executables*, not dynamic libraries.
LLVM does all the heavy lifting when producing an object file for a dynamic
library, so there is little else for the linker to do (remember that we only
have one object file).

I conducted similar experiments by putting a *module's* functions and data
symbols into its own section (granularity moved to a module level instead of a
function/static level). The size benefits of a hello world were seen to be on
the order of 400K rather than 1.2MB. It seemed that enough benefit was gained
using ffunction-sections that this route was less desirable, despite the lesser
increases in binary rlib size.

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 agoregex: remove the use of ~[] & some unnecessary ~'s.
Huon Wilson [Tue, 29 Apr 2014 14:05:59 +0000 (00:05 +1000)]
regex: remove the use of ~[] & some unnecessary ~'s.

The AST doesn't need ~s everywhere, so we can save allocations this way
& the enum isn't particularly large (~4 words) nor are regexes
long (normally), so the space saved in the `Cat` vector is unlikely to
be very much.

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 agoDeprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided...
Jonathan S [Mon, 21 Apr 2014 04:59:12 +0000 (23:59 -0500)]
Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap)

This commit deprecates rev_iter, mut_rev_iter, move_rev_iter everywhere (except treemap) and also
deprecates related functions like rsplit, rev_components, and rev_str_components. In every case,
these functions can be replaced with the non-reversed form followed by a call to .rev(). To make this
more concrete, a translation table for all functional changes necessary follows:

* container.rev_iter() -> container.iter().rev()
* container.mut_rev_iter() -> container.mut_iter().rev()
* container.move_rev_iter() -> container.move_iter().rev()
* sliceorstr.rsplit(sep) -> sliceorstr.split(sep).rev()
* path.rev_components() -> path.components().rev()
* path.rev_str_components() -> path.str_components().rev()

In terms of the type system, this change also deprecates any specialized reversed iterator types (except
in treemap), opting instead to use Rev directly if any type annotations are needed. However, since
methods directly returning reversed iterators are now discouraged, the need for such annotations should
be small. However, in those cases, the general pattern for conversion is to take whatever follows Rev in
the original reversed name and surround it with Rev<>:

* RevComponents<'a> -> Rev<Components<'a>>
* RevStrComponents<'a> -> Rev<StrComponents<'a>>
* RevItems<'a, T> -> Rev<Items<'a, T>>
* etc.

The reasoning behind this change is that it makes the standard API much simpler without reducing readability,
performance, or power. The presence of functions such as rev_iter adds more boilerplate code to libraries
(all of which simply call .iter().rev()), clutters up the documentation, and only helps code by saving two
characters. Additionally, the numerous type synonyms that were used to make the type signatures look nice
like RevItems add even more boilerplate and clutter up the docs even more. With this change, all that cruft
goes away.

[breaking-change]

10 years agoProvide an implementation of DoubleEndedIterator for the results of &[T]::split and...
Jonathan S [Mon, 21 Apr 2014 02:28:38 +0000 (21:28 -0500)]
Provide an implementation of DoubleEndedIterator for the results of &[T]::split and &[T]::rsplit

This makes the splitting functions in std::slice return DoubleEndedIterators. Unfortunately,
splitn and rsplitn cannot provide such an interface and so must return different types. As a
result, the following changes were made:

* RevSplits was removed in favor of explicitly using Rev
* Splits can no longer bound the number of splits done
* Splits now implements DoubleEndedIterator
* SplitsN was added, taking the role of what both Splits and RevSplits used to be
* rsplit returns Rev<Splits<'a, T>> instead of RevSplits<'a, T>
* splitn returns SplitsN<'a, T> instead of Splits<'a, T>
* rsplitn returns SplitsN<'a, T> instead of RevSplits<'a, T>

All functions that were previously implemented on each return value still are, so outside of changing
of type annotations, existing code should work out of the box. In the rare case that code relied
on the return types of split and splitn or of rsplit and rsplitn being the same, the previous
behavior can be emulated by calling splitn or rsplitn with a bount of uint::MAX.

The value of this change comes in multiple parts:

* Consistency. The splitting code in std::str is structured similarly to the new slice splitting code,
  having separate CharSplits and CharSplitsN types.
* Smaller API. Although this commit doesn't implement it, using a DoubleEndedIterator for splitting
  means that rsplit, path::RevComponents, path::RevStrComponents, Path::rev_components, and
  Path::rev_str_components are no longer needed - they can be emulated simply with .rev().
* Power. DoubleEndedIterators are able to traverse the list from both sides at once instead of only
  forwards or backwards.
* Efficiency. For the common case of using split instead of splitn, the iterator is slightly smaller
  and slightly faster.

[breaking-change]

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 agorustdoc: fix a few inconsistencies
Adrien Tétar [Mon, 28 Apr 2014 16:21:44 +0000 (18:21 +0200)]
rustdoc: fix a few inconsistencies

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 agoRemove default method implementations
Niko Matsakis [Mon, 28 Apr 2014 12:50:50 +0000 (08:50 -0400)]
Remove default method implementations

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 agostd: Rewrite crate docs
Brian Anderson [Fri, 25 Apr 2014 07:39:58 +0000 (00:39 -0700)]
std: Rewrite crate docs

Also move prelude explanation to the prelude module.

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 agoFix test issue-4016.rs with the json API change
Nicolas Silva [Sun, 27 Apr 2014 20:57:10 +0000 (22:57 +0200)]
Fix test issue-4016.rs with the json API change

10 years agoUpdate libworkcache with libserialize's json changes
Nicolas Silva [Wed, 9 Apr 2014 08:25:23 +0000 (10:25 +0200)]
Update libworkcache with libserialize's json changes

10 years agoFix a code formatting issue in json.rs
Nicolas Silva [Mon, 7 Apr 2014 15:40:45 +0000 (17:40 +0200)]
Fix a code formatting issue in json.rs

10 years agoAdd a streaming parser to serialize::json.
Nicolas Silva [Sun, 30 Mar 2014 12:58:02 +0000 (14:58 +0200)]
Add a streaming parser to serialize::json.

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 agorustdoc: style tweaks
Adrien Tétar [Sun, 27 Apr 2014 06:07:12 +0000 (09:07 +0300)]
rustdoc: style tweaks

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 agodoc: perform some 80-chars wrappings
Adrien Tétar [Sun, 27 Apr 2014 02:56:29 +0000 (11:56 +0900)]
doc: perform some 80-chars wrappings

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 agorustdoc: refactor and unstyle inline section headers
Adrien Tétar [Sat, 26 Apr 2014 12:09:19 +0000 (21:09 +0900)]
rustdoc: refactor and unstyle inline section headers

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