Commit Graph

31373 Commits

Author SHA1 Message Date
Luqman Aden
d7c0f7d1c0 librustc: Don't use the same alloca for match binding which we reassign to in arm body. 2014-08-09 07:32:33 -07:00
bors
1712ab2300 auto merge of #16253 : luqmana/rust/muv, r=nikomatsakis
Fixes #11958.
2014-08-09 11:36:22 +00:00
Luqman Aden
f765759af2 Add tests. 2014-08-09 03:00:41 -07:00
bors
87134c7d72 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.)
2014-08-09 09:51:23 +00:00
Felix S. Klock II
db0e71f10a pretty printer: Added some run-make tests of path-suffix lookup functionality. 2014-08-09 10:19:06 +02:00
Felix S. Klock II
575ea18d46 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.)
2014-08-09 10:18:02 +02:00
Felix S. Klock II
8a80e0fdab Helper method for pprust::State for printing instances of ast_map::Node. 2014-08-09 10:17:40 +02:00
Felix S. Klock II
a9b1a3b40f refactored pprust::State constructor methods out from pprust::print_crate.
(Groundwork for pretty-printing only selected items in an input crate.)
2014-08-09 10:17:40 +02:00
Felix S. Klock II
4c2ff0ab17 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)
2014-08-09 10:17:31 +02:00
Luqman Aden
ead3edb7b9 librustc: Update unused mut lint to properly track moved upvars. 2014-08-08 23:43:38 -07:00
Luqman Aden
6559323a51 librustc: Allow mutation of moved upvars. 2014-08-08 23:43:38 -07:00
bors
a23d6795a5 auto merge of #16323 : c-nixon/rust/master, r=alexcrichton
This allows rustc to be built with msys2's mingw64

Fixes #16347.
2014-08-09 05:51:19 +00:00
bors
413328b0f2 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.)
2014-08-09 03:06:21 +00:00
Huon Wilson
edc9191921 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.
2014-08-09 13:00:58 +10:00
Huon Wilson
c3284733e3 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.)
2014-08-09 13:00:58 +10:00
bors
39bafb09fd auto merge of #16314 : Ryman/rust/ringbuf_non_pow2, r=huonw
See test for details.
2014-08-09 01:21:23 +00:00
bors
a1429bca5a 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.
2014-08-08 21:36:11 +00:00
bors
57630eb809 auto merge of #16336 : retep998/rust/master, r=brson
Several of the tests in `make check-fast` were failing so this fixes those tests.
2014-08-08 19:51:11 +00:00
bors
98f1b0fb68 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...
2014-08-08 18:06:11 +00:00
bors
ca89cfb0e3 auto merge of #16255 : steveklabnik/rust/guide_methods, r=nikomatsakis
Shifting some things around here, as I think this is a better order.
2014-08-08 16:21:10 +00:00
Steve Klabnik
50ffe0ccab Guide: method syntax 2014-08-08 10:39:48 -04:00
bors
86decf638e 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.
2014-08-08 14:36:10 +00:00
bors
67a05bd793 auto merge of #16349 : nikomatsakis/rust/snapshot-20140808, r=nikomatsakis 2014-08-08 12:51:13 +00:00
Niko Matsakis
4fd797e757 Register new snapshot 12e0f72 2014-08-08 07:55:00 -04:00
bors
3b1f983584 auto merge of #16325 : froydnj/rust/vec-grammar-fix, r=alexcrichton
Just a small typo noticed while reading through documentation.
2014-08-08 11:06:12 +00:00
Chris Nixon
c377f9e3d4 Move system header includes above valgrind.h include
This allows rustc to be build under msys2's mingw64 gcc
2014-08-08 10:42:41 +01:00
bors
1272a83bfa 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.
2014-08-08 09:11:13 +00:00
bors
c5b8d89b27 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.
2014-08-08 07:26:15 +00:00
bors
0ba2d04224 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
2014-08-08 05:41:15 +00:00
bors
aae7901a78 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]
2014-08-08 03:51:15 +00:00
nham
cb0aa8ac71 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
2014-08-07 23:45:39 -04:00
bors
87d2bf400c auto merge of #16273 : steveklabnik/rust/guide_generics, r=brson 2014-08-08 02:01:16 +00:00
bors
8888d7c8e9 auto merge of #16206 : steveklabnik/rust/guide_lambdas, r=brson 2014-08-07 23:36:17 +00:00
Steve Klabnik
dac73ad3c1 Guide: Traits 2014-08-07 18:12:36 -04:00
bors
12e0f72f51 auto merge of #16334 : nikomatsakis/rust/mission-snapshot, r=achrichto 2014-08-07 21:51:19 +00:00
Niko Matsakis
1fcc4f9c5f Remove spawn-stack-too-big.rs, which is too flaky. 2014-08-07 16:53:58 -04:00
Peter Atashian
24ebbb4420 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>
2014-08-07 16:40:12 -04:00
Steve Klabnik
e0fa999891 Guide: strings 2014-08-07 16:37:39 -04:00
Steve Klabnik
b1435ed593 Guide: tasks 2014-08-07 15:21:57 -04:00
mdinger
0582a2d6e7 Fix typo 2014-08-07 15:14:16 -04:00
bors
50834e7de4 auto merge of #16317 : adrienbrault/rust/patch-1, r=kballard 2014-08-07 18:56:11 +00:00
Steve Klabnik
aa8602e20a Guide: closures 2014-08-07 14:11:14 -04:00
bors
4879ca7924 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.
2014-08-07 15:56:43 +00:00
Alex Crichton
1f760d5d1a 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]
2014-08-07 08:54:38 -07:00
Nathan Froyd
0d974eecd3 fix grammar in Vec.retain's doc comment 2014-08-07 11:27:06 -04:00
Gioele Barabucci
ddeb3db872 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.
2014-08-07 15:55:10 +02:00
Huon Wilson
3826026f98 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.)
2014-08-07 21:54:13 +10:00
bors
8a02304a44 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.
2014-08-07 11:31:05 +00:00
Niko Matsakis
fcab98038c 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.
2014-08-07 07:23:59 -04:00
Peter Atashian
feb219d23f windows: Fix several tests on 64-bit.
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-07 04:05:00 -04:00