]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #16342 : alexcrichton/rust/issue-16341, r=huonw
bors [Sat, 9 Aug 2014 16:16:23 +0000 (16:16 +0000)]
auto merge of #16342 : alexcrichton/rust/issue-16341, r=huonw

Now that rustdoc is spawning a child task, the program won't exit with a default
error code if the main task fails (because it never fails). This commit forces
the main task to wait for a child task in order to correctly propagate failure.

Closes #16341

9 years agoauto merge of #16340 : thestinger/rust/pie, r=brson
bors [Sat, 9 Aug 2014 13:21:20 +0000 (13:21 +0000)]
auto merge of #16340 : thestinger/rust/pie, r=brson

Rust already builds all code as position independent by default, so the
linker can be told to build a position independent executable if it's
not disabled with `-C relocation-model=dynamic-no-pic`. Position
independent code does have a significant cost on i686 (not on x86_64 or
ARM) but there's no significant cost to linking code that's already
position independent as a position independent executable.

Address space layout randomization makes exploiting vulnerabilities much
more difficult by providing a statistical defence against an attempt to
find or modify existing code / data. Without ASLR, it's trivial to use a
vulnerability to take over control of the process via return-oriented
programming.

Rust code can be used for return-oriented programming whether it is safe
or unsafe, so even a fully safe application needs to be built as a
position independent executable to defend against vulnerabilities in
unsafe blocks or C libraries.

Sample program:

    extern crate libc;

    use std::mem;

    static mut global: u32 = 5;
    static constant: u32 = 5;
    fn foo() {}

    fn main() {
        let local = 5;
        println!("stack: {}, global: {}, constant: {}, fn: {}, lib fn: {}",
                 &local as *const u32,
                 unsafe { &global as *const u32 },
                 &constant as *const u32,
                 unsafe { mem::transmute::<_, *const ()>(foo) },
                 unsafe { mem::transmute::<_, *const ()>(libc::mprotect) });
    }

Before:

    stack: 0x3ff15eb9f94, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x32749547530
    stack: 0x3b5d47d80e4, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x394469a7530
    stack: 0x3fe2c4e5564, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x399734a2530
    stack: 0x3e525e0fb24, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x2f62a810530
    stack: 0x3b50fb3eae4, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x2e590e86530

After:

    stack: 0x38cf12c90a4, global: 0x3e2d46b488, constant: 0x3e2d23cf80, fn: 0x3e2d1c2510, lib fn: 0x2617d3b4530
    stack: 0x3d733faf474, global: 0x7eb1839488, constant: 0x7eb160af80, fn: 0x7eb1590510, lib fn: 0x32d30c1f530
    stack: 0x3bb42212ec4, global: 0x5bbb365488, constant: 0x5bbb136f80, fn: 0x5bbb0bc510, lib fn: 0x3595e6c1530
    stack: 0x39f678c1ab4, global: 0x22c4e3c488, constant: 0x22c4c0df80, fn: 0x22c4b93510, lib fn: 0x3835b727530
    stack: 0x3afb25bd394, global: 0x493eab2488, constant: 0x493e883f80, fn: 0x493e809510, lib fn: 0x3478d6a7530

This may also be necessary on other platforms, but I can only test on
Linux right now. Note that GDB gained support for debugging position
independent executables in version 7.1 (March 2010).

9 years agoauto merge of #16253 : luqmana/rust/muv, r=nikomatsakis
bors [Sat, 9 Aug 2014 11:36:22 +0000 (11:36 +0000)]
auto merge of #16253 : luqmana/rust/muv, r=nikomatsakis

Fixes #11958.

9 years agoAdd tests.
Luqman Aden [Mon, 4 Aug 2014 20:30:38 +0000 (13:30 -0700)]
Add tests.

9 years agoauto merge of #16326 : pnkfelix/rust/fsk-add-path-suffix-lookup, r=huonw
bors [Sat, 9 Aug 2014 09:51:23 +0000 (09:51 +0000)]
auto merge of #16326 : pnkfelix/rust/fsk-add-path-suffix-lookup, r=huonw

Extended `ast_map::Map` with an iterator over all node id's that match a path suffix.

Extended pretty printer to let users choose particular items to pretty print, either by indicating an integer node-id, or by providing a path suffix.

 * Example 1: the suffix `typeck::check::check_struct` matches the item with the path `rustc::middle::typeck::check::check_struct` when compiling the `rustc` crate.

 * Example 2: the suffix `and` matches `core::option::Option::and` and `core::result::Result::and` when compiling the `core` crate.

Refactored `pprust` slightly to support the pretty printer changes.

(See individual commits for more description.)

9 years agopretty printer: Added some `run-make` tests of path-suffix lookup functionality.
Felix S. Klock II [Sat, 9 Aug 2014 07:59:47 +0000 (09:59 +0200)]
pretty printer: Added some `run-make` tests of path-suffix lookup functionality.

9 years agopretty-printer: let users choose particular items to pretty print.
Felix S. Klock II [Thu, 7 Aug 2014 16:22:24 +0000 (18:22 +0200)]
pretty-printer: let users choose particular items to pretty print.

With this change:

  * `--pretty variant=<node-id>` will print the item associated with
    `<node-id>` (where `<node-id>` is an integer for some node-id in
    the AST, and `variant` means one of {`normal`,`expanded`,...}).

  * `--pretty variant=<path-suffix>` will print all of the items that
    match the `<path-suffix>` (where `<path-suffix>` is a suffix of a
    path, and `variant` again means one of {`normal`,`expanded`,...}).

    Example 1: the suffix `typeck::check::check_struct` matches the
    item with the path `rustc::middle::typeck::check::check_struct`
    when compiling the `rustc` crate.

    Example 2: the suffix `and` matches `core::option::Option::and`
    and `core::result::Result::and` when compiling the `core` crate.

Both of the `--pretty variant=...` modes will include the full path to
the item in a comment that follows the item.

Note that when multiple paths match, then either:

  1. all matching items are printed, in series; this is what happens in
     the usual pretty-print variants, or

  2. the compiler signals an error; this is what happens in flowgraph
     printing.

----

Some drive-by improvements:

Heavily refactored the pretty-printing glue in driver.rs, introducing
a couple local traits to avoid cut-and-pasting very code segments that
differed only in how they accessed the `Session` or the
`ast_map::Map`. (Note the previous code had three similar calls to
`print_crate` which have all been unified in this revision; the
addition of printing individual node-ids exacerbated the situation
beyond tolerance.) We may want to consider promoting some of these
traits, e.g. `SessionCarrier`, for use more generally elsewhere in the
compiler; right now I have to double check how to access the `Session`
depending on what context I am hacking in.

Refactored `PpMode` to make the data directly reflect the fundamental
difference in the categories (in terms of printing source-code with
various annotations, versus printing a control-flow graph).

(also, addressed review feedback.)

9 years agoHelper method for `pprust::State` for printing instances of `ast_map::Node`.
Felix S. Klock II [Thu, 7 Aug 2014 12:21:15 +0000 (14:21 +0200)]
Helper method for `pprust::State` for printing instances of `ast_map::Node`.

9 years agorefactored pprust::State constructor methods out from `pprust::print_crate`.
Felix S. Klock II [Thu, 7 Aug 2014 09:25:31 +0000 (11:25 +0200)]
refactored pprust::State constructor methods out from `pprust::print_crate`.

(Groundwork for pretty-printing only selected items in an input crate.)

9 years agoast_map: Added iterator over all node id's that match a path suffix.
Felix S. Klock II [Thu, 7 Aug 2014 09:22:42 +0000 (11:22 +0200)]
ast_map: Added iterator over all node id's that match a path suffix.

This is useful e.g. for tools need a node-id, such as the flowgraph
pretty printer, since it can avoids the need to first pretty-print the
whole expanded,identified input in order to find out what the node-id
actually is.

It currently only supports path suffixes thst are made up of module
names (e.g. you cannot use the type instantiation form `a::<int>::b`
or `option::Option::unwrap_or` as a path suffix for this tool, though
the tool will produce paths that have non-modulues in the portion of
the path that is not included in the suffix).

(addressed review feedback too)

9 years agolibrustc: Update unused mut lint to properly track moved upvars.
Luqman Aden [Mon, 4 Aug 2014 20:26:25 +0000 (13:26 -0700)]
librustc: Update unused mut lint to properly track moved upvars.

9 years agolibrustc: Allow mutation of moved upvars.
Luqman Aden [Mon, 4 Aug 2014 20:10:08 +0000 (13:10 -0700)]
librustc: Allow mutation of moved upvars.

9 years agoauto merge of #16323 : c-nixon/rust/master, r=alexcrichton
bors [Sat, 9 Aug 2014 05:51:19 +0000 (05:51 +0000)]
auto merge of #16323 : c-nixon/rust/master, r=alexcrichton

This allows rustc to be built with msys2's mingw64

Fixes #16347.

9 years agoauto merge of #15964 : huonw/rust/gensym-test, r=alexcrichton
bors [Sat, 9 Aug 2014 03:06:21 +0000 (03:06 +0000)]
auto merge of #15964 : huonw/rust/gensym-test, r=alexcrichton

This requires avoiding `quote_...!` for constructing the parts of the
__test module, since that stringifies and reinterns the idents, losing
the special gensym'd nature of them. (#15962.)

9 years agotestsuite: implement #[reexport_test_harness_name] to get access to the
Huon Wilson [Fri, 8 Aug 2014 14:01:05 +0000 (00:01 +1000)]
testsuite: implement #[reexport_test_harness_name] to get access to the
default entrypoint of the --test binary.

This allows one to, e.g., run tests under libgreen by starting it
manually, passing in the test entrypoint.

9 years agomove a test into a run make, to check external affect rather than
Huon Wilson [Thu, 7 Aug 2014 12:06:29 +0000 (22:06 +1000)]
move a test into a run make, to check external affect rather than
implementation details.

(Mainly to avoid accessing the secret internal test module symbol name.)

9 years agoauto merge of #16314 : Ryman/rust/ringbuf_non_pow2, r=huonw
bors [Sat, 9 Aug 2014 01:21:23 +0000 (01:21 +0000)]
auto merge of #16314 : Ryman/rust/ringbuf_non_pow2, r=huonw

See test for details.

9 years agoauto merge of #16277 : Gankro/rust/responsive-docs, r=cmr
bors [Fri, 8 Aug 2014 21:36:11 +0000 (21:36 +0000)]
auto merge of #16277 : Gankro/rust/responsive-docs, r=cmr

* move some sidebar contents to a title bar when small
* inline description toggle when small
* make out-of-band and in-band content share space, rather than float and clash
* compress wording of out-of-band content to avoid line-wrap as much as possible

## [Live Version Here](http://cg.scs.carleton.ca/~abeinges/doc/index.html)

Pages Of Interest:
* [Vec](http://cg.scs.carleton.ca/~abeinges/doc/std/vec/struct.Vec.html) (small path)
* [TreeSet](http://cg.scs.carleton.ca/~abeinges/doc/collections/treemap/struct.TreeSet.html) (long path)
* [std](http://cg.scs.carleton.ca/~abeinges/doc/std/index.html) (for stability dash)

TBD in a future PR is to convert links in the sidebar into a series of nest ul/li's, so that they can easily be moved to a drop-down in the new title bar. I think this is out of scope for this PR, but am willing to implement it now if desired.

9 years agoauto merge of #16336 : retep998/rust/master, r=brson
bors [Fri, 8 Aug 2014 19:51:11 +0000 (19:51 +0000)]
auto merge of #16336 : retep998/rust/master, r=brson

Several of the tests in `make check-fast` were failing so this fixes those tests.

9 years agoauto merge of #16333 : steveklabnik/rust/guide_strings, r=brson
bors [Fri, 8 Aug 2014 18:06:11 +0000 (18:06 +0000)]
auto merge of #16333 : steveklabnik/rust/guide_strings, r=brson

I _think_ this is the right place to introduce strings. It's a bit hard to talk about without understanding pointers and ownership, but you need to have some idea of what's going on...

9 years agoauto merge of #16255 : steveklabnik/rust/guide_methods, r=nikomatsakis
bors [Fri, 8 Aug 2014 16:21:10 +0000 (16:21 +0000)]
auto merge of #16255 : steveklabnik/rust/guide_methods, r=nikomatsakis

Shifting some things around here, as I think this is a better order.

9 years agoGuide: method syntax
Steve Klabnik [Mon, 4 Aug 2014 21:43:48 +0000 (17:43 -0400)]
Guide: method syntax

9 years agoauto merge of #16327 : mdinger/rust/typo, r=steveklabnik
bors [Fri, 8 Aug 2014 14:36:10 +0000 (14:36 +0000)]
auto merge of #16327 : mdinger/rust/typo, r=steveklabnik

Fix typo. It's possible it's `These modules` but I think it's supposed to be singular because it's not refering to nested modules.

9 years agoauto merge of #16349 : nikomatsakis/rust/snapshot-20140808, r=nikomatsakis
bors [Fri, 8 Aug 2014 12:51:13 +0000 (12:51 +0000)]
auto merge of #16349 : nikomatsakis/rust/snapshot-20140808, r=nikomatsakis

9 years agoRegister new snapshot 12e0f72
Niko Matsakis [Fri, 8 Aug 2014 10:20:01 +0000 (06:20 -0400)]
Register new snapshot 12e0f72

9 years agoauto merge of #16325 : froydnj/rust/vec-grammar-fix, r=alexcrichton
bors [Fri, 8 Aug 2014 11:06:12 +0000 (11:06 +0000)]
auto merge of #16325 : froydnj/rust/vec-grammar-fix, r=alexcrichton

Just a small typo noticed while reading through documentation.

10 years agoMove system header includes above valgrind.h include
Chris Nixon [Fri, 8 Aug 2014 09:37:17 +0000 (10:37 +0100)]
Move system header includes above valgrind.h include

This allows rustc to be build under msys2's mingw64 gcc

10 years agoauto merge of #16321 : gioele/rust/use-local-rust, r=brson
bors [Fri, 8 Aug 2014 09:11:13 +0000 (09:11 +0000)]
auto merge of #16321 : gioele/rust/use-local-rust, r=brson

This commit makes the configuration system autodetect a `rustc` that
is already installed and use that instead of downloading a snapshot.

10 years agoauto merge of #16309 : steveklabnik/rust/guide_tasks, r=brson
bors [Fri, 8 Aug 2014 07:26:15 +0000 (07:26 +0000)]
auto merge of #16309 : steveklabnik/rust/guide_tasks, r=brson

I wasn't 100% sure of what level of detail I wanted to go into things here. For example, 1:1 vs M:N tasks seems like a better distinction to leave to the Guide.

10 years agoauto merge of #16279 : nham/rust/fix_slice_docs, r=alexcrichton
bors [Fri, 8 Aug 2014 05:41:15 +0000 (05:41 +0000)]
auto merge of #16279 : nham/rust/fix_slice_docs, r=alexcrichton

This does a few things:

 - remove references to ~[] and the OwnedVector trait, which are both
   obsolete
 - correct the docs to say that this is the slice module, not the vec
   module
 - add a sentence pointing out that vectors are distinct from Vec
 - remove documentation on Vec.

closes #15459

10 years agoauto merge of #16285 : alexcrichton/rust/rename-share, r=huonw
bors [Fri, 8 Aug 2014 03:51:15 +0000 (03:51 +0000)]
auto merge of #16285 : alexcrichton/rust/rename-share, r=huonw

This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use`
statement, but the `NoShare` struct is no longer part of `std::kinds::marker`
due to #12660 (the build cannot bootstrap otherwise).

All code referencing the `Share` trait should now reference the `Sync` trait,
and all code referencing the `NoShare` type should now reference the `NoSync`
type. The functionality and meaning of this trait have not changed, only the
naming.

Closes #16281
[breaking-change]

10 years agoCleanup collections::slice documentation.
nham [Tue, 5 Aug 2014 20:12:15 +0000 (16:12 -0400)]
Cleanup collections::slice documentation.

This does a few things:

 - remove references to ~[] and the OwnedVector trait, which are both
   obsolete
 - correct the docs to say that this is the slice module, not the vec
   module
 - add a sentence pointing out that vectors are distinct from Vec
 - remove documentation on Vec.

closes #15459

10 years agorustdoc: Set a nonzero exit status on failure
Alex Crichton [Fri, 8 Aug 2014 02:38:18 +0000 (19:38 -0700)]
rustdoc: Set a nonzero exit status on failure

Now that rustdoc is spawning a child task, the program won't exit with a default
error code if the main task fails (because it never fails). This commit forces
the main task to wait for a child task in order to correctly propagate failure.

Closes #16341

10 years agoenable PIE by default on Linux for full ASLR
Daniel Micay [Fri, 8 Aug 2014 00:50:03 +0000 (20:50 -0400)]
enable PIE by default on Linux for full ASLR

Rust already builds all code as position independent by default, so the
linker can be told to build a position independent executable if it's
not disabled with `-C relocation-model=dynamic-no-pic`. Position
independent code does have a significant cost on i686 (not on x86_64 or
ARM) but there's no significant cost to linking code that's already
position independent as a position independent executable.

Address space layout randomization makes exploiting vulnerabilities much
more difficult by providing a statistical defence against an attempt to
find or modify existing code / data. Without ASLR, it's trivial to use a
vulnerability to take over control of the process via return-oriented
programming.

Rust code can be used for return-oriented programming whether it is safe
or unsafe, so even a fully safe application needs to be built as a
position independent executable to defend against vulnerabilities in
unsafe blocks or C libraries.

Sample program:

    extern crate libc;

    use std::mem;

    static mut global: u32 = 5;
    static constant: u32 = 5;
    fn foo() {}

    fn main() {
        let local = 5;
        println!("stack: {}, global: {}, constant: {}, fn: {}, lib fn: {}",
                 &local as *const u32,
                 unsafe { &global as *const u32 },
                 &constant as *const u32,
                 unsafe { mem::transmute::<_, *const ()>(foo) },
                 unsafe { mem::transmute::<_, *const ()>(libc::mprotect) });
    }

Before:

    stack: 0x3ff15eb9f94, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x32749547530
    stack: 0x3b5d47d80e4, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x394469a7530
    stack: 0x3fe2c4e5564, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x399734a2530
    stack: 0x3e525e0fb24, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x2f62a810530
    stack: 0x3b50fb3eae4, global: 0x6ab488, constant: 0x47db40, fn: 0x4030e0, lib fn: 0x2e590e86530

After:

    stack: 0x38cf12c90a4, global: 0x3e2d46b488, constant: 0x3e2d23cf80, fn: 0x3e2d1c2510, lib fn: 0x2617d3b4530
    stack: 0x3d733faf474, global: 0x7eb1839488, constant: 0x7eb160af80, fn: 0x7eb1590510, lib fn: 0x32d30c1f530
    stack: 0x3bb42212ec4, global: 0x5bbb365488, constant: 0x5bbb136f80, fn: 0x5bbb0bc510, lib fn: 0x3595e6c1530
    stack: 0x39f678c1ab4, global: 0x22c4e3c488, constant: 0x22c4c0df80, fn: 0x22c4b93510, lib fn: 0x3835b727530
    stack: 0x3afb25bd394, global: 0x493eab2488, constant: 0x493e883f80, fn: 0x493e809510, lib fn: 0x3478d6a7530

This may also be necessary on other platforms, but I can only test on
Linux right now. Note that GDB gained support for debugging position
independent executables in version 7.1 (March 2010).

10 years agoauto merge of #16273 : steveklabnik/rust/guide_generics, r=brson
bors [Fri, 8 Aug 2014 02:01:16 +0000 (02:01 +0000)]
auto merge of #16273 : steveklabnik/rust/guide_generics, r=brson

10 years agoauto merge of #16206 : steveklabnik/rust/guide_lambdas, r=brson
bors [Thu, 7 Aug 2014 23:36:17 +0000 (23:36 +0000)]
auto merge of #16206 : steveklabnik/rust/guide_lambdas, r=brson

10 years agoGuide: Traits
Steve Klabnik [Wed, 6 Aug 2014 15:12:03 +0000 (11:12 -0400)]
Guide: Traits

10 years agoauto merge of #16334 : nikomatsakis/rust/mission-snapshot, r=achrichto
bors [Thu, 7 Aug 2014 21:51:19 +0000 (21:51 +0000)]
auto merge of #16334 : nikomatsakis/rust/mission-snapshot, r=achrichto

10 years agoRemove spawn-stack-too-big.rs, which is too flaky.
Niko Matsakis [Thu, 7 Aug 2014 20:53:58 +0000 (16:53 -0400)]
Remove spawn-stack-too-big.rs, which is too flaky.

10 years agowindows: Fix INVALID_HANDLE_VALUE
Peter Atashian [Thu, 7 Aug 2014 20:40:12 +0000 (16:40 -0400)]
windows: Fix INVALID_HANDLE_VALUE
Made INVALID_HANDLE_VALUE actually a HANDLE.
Removed all useless casts during INVALID_HANDLE_VALUE comparisons.

Signed-off-by: Peter Atashian <retep998@gmail.com>
10 years agoGuide: strings
Steve Klabnik [Thu, 7 Aug 2014 20:37:39 +0000 (16:37 -0400)]
Guide: strings

10 years agoGuide: tasks
Steve Klabnik [Wed, 6 Aug 2014 19:38:15 +0000 (15:38 -0400)]
Guide: tasks

10 years agoFix typo
mdinger [Thu, 7 Aug 2014 19:14:16 +0000 (15:14 -0400)]
Fix typo

10 years agoauto merge of #16317 : adrienbrault/rust/patch-1, r=kballard
bors [Thu, 7 Aug 2014 18:56:11 +0000 (18:56 +0000)]
auto merge of #16317 : adrienbrault/rust/patch-1, r=kballard

10 years agoGuide: closures
Steve Klabnik [Sun, 3 Aug 2014 00:03:36 +0000 (20:03 -0400)]
Guide: closures

10 years agoauto merge of #15831 : rpjohnst/rust/generic-foreign-fns, r=alexcrichton
bors [Thu, 7 Aug 2014 15:56:43 +0000 (15:56 +0000)]
auto merge of #15831 : rpjohnst/rust/generic-foreign-fns, r=alexcrichton

This allows for things like this:

    extern "C" fn callback<T>(t: T) { /* ... */ }
    extern "C" {
        fn take_callback(c: extern fn(i32));
    }

and later:

    take_callback(callback::<i32>);

Closes #12502.

10 years agoRename `Share` to `Sync`
Alex Crichton [Tue, 5 Aug 2014 23:40:04 +0000 (16:40 -0700)]
Rename `Share` to `Sync`

This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use`
statement, but the `NoShare` struct is no longer part of `std::kinds::marker`
due to #12660 (the build cannot bootstrap otherwise).

All code referencing the `Share` trait should now reference the `Sync` trait,
and all code referencing the `NoShare` type should now reference the `NoSync`
type. The functionality and meaning of this trait have not changed, only the
naming.

Closes #16281
[breaking-change]

10 years agofix grammar in Vec.retain's doc comment
Nathan Froyd [Thu, 7 Aug 2014 15:27:06 +0000 (11:27 -0400)]
fix grammar in Vec.retain's doc comment

10 years agoUse system rustc if configured with --enable-local-rust
Gioele Barabucci [Thu, 7 Aug 2014 12:00:35 +0000 (14:00 +0200)]
Use system rustc if configured with --enable-local-rust

This commit makes the configuration system autodetect a rustc that
is already installed and use that instead of downloading a snapshot.

10 years agorustc: gensym the module names for --test to avoid introducing user-accessible names.
Huon Wilson [Fri, 25 Jul 2014 00:01:42 +0000 (10:01 +1000)]
rustc: gensym the module names for --test to avoid introducing user-accessible names.

This requires avoiding `quote_...!` for constructing the parts of the
__test module, since that stringifies and reinterns the idents, losing
the special gensym'd nature of them. (#15962.)

10 years agoauto merge of #16318 : nikomatsakis/rust/issue-5723-bootstrap-2, r=pnkfelix
bors [Thu, 7 Aug 2014 11:31:05 +0000 (11:31 +0000)]
auto merge of #16318 : nikomatsakis/rust/issue-5723-bootstrap-2, r=pnkfelix

Introduce syntax for lifetime bounds like `'b:'a`, meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is required.

10 years agoTemporary bootstrapping hack: introduce syntax for r egion bounds like `'b:'a`,
Niko Matsakis [Wed, 6 Aug 2014 02:59:24 +0000 (22:59 -0400)]
Temporary bootstrapping hack: introduce syntax for r egion bounds like `'b:'a`,
meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full
fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is
required.

10 years agowindows: Fix several tests on 64-bit.
Peter Atashian [Thu, 7 Aug 2014 08:05:00 +0000 (04:05 -0400)]
windows: Fix several tests on 64-bit.

Signed-off-by: Peter Atashian <retep998@gmail.com>
10 years agoauto merge of #16220 : tshepang/rust/temp, r=steveklabnik
bors [Thu, 7 Aug 2014 07:16:04 +0000 (07:16 +0000)]
auto merge of #16220 : tshepang/rust/temp, r=steveklabnik

10 years agoFix typo in the tutorial
Adrien Brault [Thu, 7 Aug 2014 06:09:08 +0000 (23:09 -0700)]
Fix typo in the tutorial

10 years agoauto merge of #16316 : forticulous/rust/char-Fix, r=alexcrichton
bors [Thu, 7 Aug 2014 04:21:04 +0000 (04:21 +0000)]
auto merge of #16316 : forticulous/rust/char-Fix, r=alexcrichton

Signature for `from_digit` in `Char` wasn't using `Self` so there was no way to use this method

10 years agoauto merge of #16306 : pnkfelix/rust/fsk-ast-refactor-PatWild, r=alexcrichton
bors [Thu, 7 Aug 2014 02:26:07 +0000 (02:26 +0000)]
auto merge of #16306 : pnkfelix/rust/fsk-ast-refactor-PatWild, r=alexcrichton

AST refactoring: merge PatWild and PatWildMulti into one variant with a flag

10 years agoChar::from_digit signature fix
fort [Thu, 7 Aug 2014 01:46:54 +0000 (18:46 -0700)]
Char::from_digit signature fix

10 years agolibcollections: Fix RingBuf growth for non-power-of-two capacities
Kevin Butler [Thu, 7 Aug 2014 01:11:13 +0000 (02:11 +0100)]
libcollections: Fix RingBuf growth for non-power-of-two capacities

10 years agoauto merge of #16291 : nham/rust/byte_literals, r=alexcrichton
bors [Wed, 6 Aug 2014 23:41:05 +0000 (23:41 +0000)]
auto merge of #16291 : nham/rust/byte_literals, r=alexcrichton

This replaces many instances chars being casted to u8 with byte literals.

10 years agoauto merge of #16225 : pczarn/rust/iter-refactoring, r=kballard
bors [Wed, 6 Aug 2014 21:56:07 +0000 (21:56 +0000)]
auto merge of #16225 : pczarn/rust/iter-refactoring, r=kballard

Simplifying the code of methods: `nth`, `fold`, `rposition`, and iterators: `Filter`, `FilterMap`, `SkipWhile`.

```
before
test iter::bench_multiple_take      ... bench:        15 ns/iter (+/- 0)
test iter::bench_rposition          ... bench:       349 ns/iter (+/- 94)
test iter::bench_skip_while         ... bench:       158 ns/iter (+/- 6)

after
test iter::bench_multiple_take      ... bench:        15 ns/iter (+/- 0)
test iter::bench_rposition          ... bench:       314 ns/iter (+/- 2)
test iter::bench_skip_while         ... bench:       107 ns/iter (+/- 0)
```
@koalazen has the code for `Skip`.

Once #16011 is fixed, `min_max` could use a for loop.

10 years agoauto merge of #16308 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 6 Aug 2014 19:26:19 +0000 (19:26 +0000)]
auto merge of #16308 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoMerge commit '3b41f3256228ffb01225eab671ef301aa18337d7' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:47 +0000 (11:25 -0700)]
Merge commit '3b41f3256228ffb01225eab671ef301aa18337d7' into rollup

10 years agoMerge commit 'd92eaf0273af8c09112f951b2f483505b2f3e8c9' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:45 +0000 (11:25 -0700)]
Merge commit 'd92eaf0273af8c09112f951b2f483505b2f3e8c9' into rollup

10 years agoMerge commit 'c6c3f47f7c72ddf45ba1bf6bae6bec3699d7212e' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:42 +0000 (11:25 -0700)]
Merge commit 'c6c3f47f7c72ddf45ba1bf6bae6bec3699d7212e' into rollup

10 years agoMerge commit 'cb8bd83888cddc37c912be648ce5a814b08ceb25' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:36 +0000 (11:25 -0700)]
Merge commit 'cb8bd83888cddc37c912be648ce5a814b08ceb25' into rollup

10 years agoMerge commit '74ae05ad90d1e809663702f374bba6e62671692c' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:22 +0000 (11:25 -0700)]
Merge commit '74ae05ad90d1e809663702f374bba6e62671692c' into rollup

10 years agoMerge commit '881bfb1a180a1b545daa9da1539ec4c8ebda7ed1' into rollup
Alex Crichton [Wed, 6 Aug 2014 18:25:14 +0000 (11:25 -0700)]
Merge commit '881bfb1a180a1b545daa9da1539ec4c8ebda7ed1' into rollup

10 years agomake rustdoc more responsive
Alexis Beingessner [Sun, 3 Aug 2014 00:58:41 +0000 (20:58 -0400)]
make rustdoc more responsive

* move some sidebar contents to a title bar when small
* inline description toggle when small
* make out-of-band and in-band content share space, rather than float and clash
* compress wording of out-of-band content to avoid line-wrap as much as possible

10 years agoauto merge of #15985 : jfager/rust/r6334, r=pnkfelix
bors [Wed, 6 Aug 2014 17:31:19 +0000 (17:31 +0000)]
auto merge of #15985 : jfager/rust/r6334, r=pnkfelix

 Closes #6334

10 years agoUse byte literals in libgetopts
nham [Wed, 6 Aug 2014 17:06:37 +0000 (13:06 -0400)]
Use byte literals in libgetopts

10 years agoRemove cast to char in libserialize::hex
nham [Wed, 6 Aug 2014 16:23:21 +0000 (12:23 -0400)]
Remove cast to char in libserialize::hex

10 years agoauto merge of #15865 : jamesrhurst/rust/ctags-regex, r=alexcrichton
bors [Wed, 6 Aug 2014 15:51:19 +0000 (15:51 +0000)]
auto merge of #15865 : jamesrhurst/rust/ctags-regex, r=alexcrichton

Previously the implementation detection regex would detect
`impl fmt::Show for MyStruct` as `fmt`. Now it will be detected as
`fmt::Show for MyStruct`. Implementations such as `impl MyStruct` will
still be detected as `MyStruct`.

10 years agoAST refactoring: merge PatWild and PatWildMulti into one variant with a flag.
Felix S. Klock II [Wed, 6 Aug 2014 15:04:44 +0000 (17:04 +0200)]
AST refactoring: merge PatWild and PatWildMulti into one variant with a flag.

10 years agoauto merge of #16276 : nham/rust/fix_marker_docs, r=steveklabnik
bors [Wed, 6 Aug 2014 13:21:27 +0000 (13:21 +0000)]
auto merge of #16276 : nham/rust/fix_marker_docs, r=steveklabnik

10 years agoauto merge of #16263 : brson/rust/morestack, r=alexcrichton
bors [Wed, 6 Aug 2014 10:26:30 +0000 (10:26 +0000)]
auto merge of #16263 : brson/rust/morestack, r=alexcrichton

10 years agocore: Refactor iterators
Piotr Czarnecki [Wed, 6 Aug 2014 10:20:37 +0000 (11:20 +0100)]
core: Refactor iterators

Simplifying the code of methods: nth, fold, rposition
and iterators: Filter, FilterMap, SkipWhile
Adding basic benchmarks

10 years agoRustdoc: Add padding on <code>
Simon Sapin [Wed, 6 Aug 2014 10:07:35 +0000 (11:07 +0100)]
Rustdoc: Add padding on <code>

… to separate text from the edge of the newly added background.

10 years agoRustdoc: Highlight <code> elements (from Markdown `backticks`)
Simon Sapin [Wed, 6 Aug 2014 10:03:18 +0000 (11:03 +0100)]
Rustdoc: Highlight <code> elements (from Markdown `backticks`)

10 years agoGtksourceview language spec: add the \0 escape sequence.
Simon Sapin [Wed, 6 Aug 2014 09:18:22 +0000 (10:18 +0100)]
Gtksourceview language spec: add the \0 escape sequence.

10 years agoauto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichton
bors [Wed, 6 Aug 2014 08:31:28 +0000 (08:31 +0000)]
auto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichton

This commit stabilizes the `std::sync::atomics` module, renaming it to
`std::sync::atomic` to match library precedent elsewhere, and tightening
up behavior around incorrect memory ordering annotations.

The vast majority of the module is now `stable`. However, the
`AtomicOption` type has been deprecated, since it is essentially unused
and is not truly a primitive atomic type. It will eventually be replaced
by a higher-level abstraction like MVars.

Due to deprecations, this is a:

[breaking-change]

10 years agoGuide: Fix imports (times_four instead of add_four)
Daniel Hofstetter [Wed, 6 Aug 2014 07:51:02 +0000 (09:51 +0200)]
Guide: Fix imports (times_four instead of add_four)

10 years agoUse byte literals in libcore
nham [Wed, 6 Aug 2014 06:30:17 +0000 (02:30 -0400)]
Use byte literals in libcore

10 years agoUse byte literals in libstd
nham [Wed, 6 Aug 2014 06:02:50 +0000 (02:02 -0400)]
Use byte literals in libstd

10 years agoUse byte literals in libsyntax
nham [Wed, 6 Aug 2014 05:31:48 +0000 (01:31 -0400)]
Use byte literals in libsyntax

10 years agoUse byte literal in libnum
nham [Wed, 6 Aug 2014 05:29:26 +0000 (01:29 -0400)]
Use byte literal in libnum

10 years agoAdd new tests for extern and foreign fns and name mangling.
Russell [Sat, 2 Aug 2014 04:22:02 +0000 (22:22 -0600)]
Add new tests for extern and foreign fns and name mangling.

10 years agoAllow generic foreign functions.
Russell [Sat, 2 Aug 2014 04:25:41 +0000 (22:25 -0600)]
Allow generic foreign functions.

Generic extern functions written in Rust have their names mangled, as well as their internal clownshoe __rust_abi functions. This allows e.g. specific monomorphizations of these functions to be used as callbacks.

Closes #12502.

10 years agoUse byte literals in libterm
nham [Wed, 6 Aug 2014 05:25:48 +0000 (01:25 -0400)]
Use byte literals in libterm

10 years agoUse a byte literal in libregex
nham [Wed, 6 Aug 2014 05:18:19 +0000 (01:18 -0400)]
Use a byte literal in libregex

10 years agoUse byte literals in libdebug
nham [Wed, 6 Aug 2014 05:14:31 +0000 (01:14 -0400)]
Use byte literals in libdebug

10 years agoUse byte literals in libserialize
nham [Wed, 6 Aug 2014 05:07:10 +0000 (01:07 -0400)]
Use byte literals in libserialize

10 years agoUse byte literals in libcollections tests
nham [Wed, 6 Aug 2014 04:57:49 +0000 (00:57 -0400)]
Use byte literals in libcollections tests

10 years agoauto merge of #16254 : brson/rust/rustdocmeta, r=aturon
bors [Wed, 6 Aug 2014 04:56:25 +0000 (04:56 +0000)]
auto merge of #16254 : brson/rust/rustdocmeta, r=aturon

This teach rustdoc to add `<meta name="description">` and `<meta name="keywords">` tags to crate docs. Description is important for search engines because they display it as the page description. Keywords are less useful but still generally recommended.

This also changes the "stability dashboard" link to just say "stability", because the current link takes up a lot of space.

cc https://github.com/rust-lang/rust/issues/12466

10 years agoRenamed `record_stack_bounds` for clarity.
Vadim Chugunov [Wed, 6 Aug 2014 03:53:42 +0000 (20:53 -0700)]
Renamed `record_stack_bounds` for clarity.
For a good measure, implemented target_record_stack_bounds for 32-bit Windows as well.

10 years agorustdoc: Run all work in a separate task
Alex Crichton [Wed, 6 Aug 2014 02:51:02 +0000 (19:51 -0700)]
rustdoc: Run all work in a separate task

There's a good long comment explaining why. The tl;dr; is that I have no idea
why this is necessary, but it gets --test to work on windows which is something,
right?

cc #13259
cc #16275
cc rust-lang/cargo#302

10 years agoauto merge of #16252 : conradkleinespel/rust/master, r=alexcrichton
bors [Wed, 6 Aug 2014 03:11:29 +0000 (03:11 +0000)]
auto merge of #16252 : conradkleinespel/rust/master, r=alexcrichton

I found the current docs to be a little confusing. I believe this makes them straight to the point and less confusing.

10 years agoAdded clarification regarding rust_try_inner.
Vadim Chugunov [Wed, 6 Aug 2014 02:07:38 +0000 (19:07 -0700)]
Added clarification regarding rust_try_inner.

10 years agosyntax: Handle \r\n in byte string literals
Alex Crichton [Tue, 5 Aug 2014 22:13:57 +0000 (15:13 -0700)]
syntax: Handle \r\n in byte string literals

This ended up passing through the lexer but dying later on in parsing when it
wasn't handled. The strategy taken was to copy the `str_lit` funciton, but adapt
it for bytes.

Closes #16278

10 years agoRemove references to `~[]` in core::kinds::marker docs.
nham [Tue, 5 Aug 2014 19:23:06 +0000 (15:23 -0400)]
Remove references to `~[]` in core::kinds::marker docs.