]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #20115: gereeter/split-module-building
Alex Crichton [Wed, 31 Dec 2014 00:25:48 +0000 (16:25 -0800)]
rollup merge of #20115: gereeter/split-module-building

This also gets rid of a bunch of unnecessary `.clone`s.

cc @eddyb

9 years agorollup merge of #20065: aturon/stab-2-cmp
Alex Crichton [Wed, 31 Dec 2014 00:25:47 +0000 (16:25 -0800)]
rollup merge of #20065: aturon/stab-2-cmp

This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439).

In the future, many of the impls should be generalized; see #20063.
However, there is no problem stabilizing the less general impls, since
generalizing later is not a breaking change.

r? @alexcrichton

9 years agorollup merge of #20045: alexcrichton/issue-20012
Alex Crichton [Wed, 31 Dec 2014 00:25:45 +0000 (16:25 -0800)]
rollup merge of #20045: alexcrichton/issue-20012

The new semantics of this function are that the callbacks are run when the *main
thread* exits, not when all threads have exited. This implies that other threads
may still be running when the `at_exit` callbacks are invoked and users need to
be prepared for this situation.

Users in the standard library have been audited in accordance to these new rules
as well.

Closes #20012

9 years agorollup merge of #19954: michaelwoerister/rust-gdb
Alex Crichton [Wed, 31 Dec 2014 00:25:44 +0000 (16:25 -0800)]
rollup merge of #19954: michaelwoerister/rust-gdb

This pull request adds the `rust-gdb` shell script which starts GDB with Rust pretty printers enabled. The PR also makes `rustc` add a special `.debug_gdb_scripts` ELF section on Linux which tells GDB that the produced binary should use the Rust pretty printers.

Note that at the moment this script will only work and be installed on Linux. On Mac OS X there's `rust-lldb` which works much better there. On Windows I had too many problems making this stable. I'll give it another try soonish.

You can use this script just like you would use GDB from the command line. It will use the pretty printers from the Rust "installation" found first in PATH. E.g. if you have `~/rust/x86_64-linux-gnu/stage1/bin` in your path, it will use the pretty printer scripts in `~/rust/x86_64-linux-gnu/stage1/lib/rustlib/etc`.

9 years agoStabilize cmp
Aaron Turon [Tue, 30 Dec 2014 22:44:26 +0000 (14:44 -0800)]
Stabilize cmp

This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as
`#[stable]`, as well as the majorify of manual implementaitons of these
traits. The traits match the [reform
RFC](https://github.com/rust-lang/rfcs/pull/439).

Along the way, two changes are made:

* The recently-added type parameters for `Ord` and `Eq` are
  removed. These were mistakenly added while adding them to `PartialOrd`
  and `PartialEq`, but they don't make sense given the laws that are
  required for (and use cases for) `Ord` and `Eq`.

* More explicit laws are added for `PartialEq` and `PartialOrd`,
  connecting them to their associated mathematical concepts.

In the future, many of the impls should be generalized; see
since generalizing later is not a breaking change.

[breaking-change]

9 years agostd: Re-enable at_exit()
Alex Crichton [Fri, 19 Dec 2014 19:29:39 +0000 (11:29 -0800)]
std: Re-enable at_exit()

The new semantics of this function are that the callbacks are run when the *main
thread* exits, not when all threads have exited. This implies that other threads
may still be running when the `at_exit` callbacks are invoked and users need to
be prepared for this situation.

Users in the standard library have been audited in accordance to these new rules
as well.

Closes #20012

9 years agoRemoved a bunch of unnecessary .clone()s from build_reduced_graph
Jonathan S [Tue, 30 Dec 2014 18:52:51 +0000 (12:52 -0600)]
Removed a bunch of unnecessary .clone()s from build_reduced_graph

9 years agoPurged ReducedGraphParent
Jonathan S [Tue, 30 Dec 2014 18:30:42 +0000 (12:30 -0600)]
Purged ReducedGraphParent

9 years agoCleanup unused imports resulting from move of reduced graph building
Jonathan S [Tue, 30 Dec 2014 18:19:24 +0000 (12:19 -0600)]
Cleanup unused imports resulting from move of reduced graph building

9 years agoMoved ReducedGraphParent building to a new module
Jonathan S [Tue, 30 Dec 2014 18:16:42 +0000 (12:16 -0600)]
Moved ReducedGraphParent building to a new module

9 years agoauto merge of #20307 : nikomatsakis/rust/assoc-types-normalization-extend-bound,...
bors [Tue, 30 Dec 2014 17:51:21 +0000 (17:51 +0000)]
auto merge of #20307 : nikomatsakis/rust/assoc-types-normalization-extend-bound, r=nrc

Rewrite associated types to use projection rather than dummy type parameters. This closes almost every (major) open issue, but I'm holding off on that until the code has landed and baked a bit. Probably it should have more tests, as well, but I wanted to get this landed as fast as possible so that we can collaborate on improving it.

The commit history is a little messy, particularly the merge commit at the end. If I get some time, I might just "reset" to the beginning and try to carve up the final state into logical pieces. Let me know if it seems hard to follow. By far the most crucial commit is "Implement associated type projection and normalization."

r? @nick29581

9 years agoFix rebase conflicts
Niko Matsakis [Tue, 30 Dec 2014 17:09:21 +0000 (12:09 -0500)]
Fix rebase conflicts

9 years agodebuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers...
Michael Woerister [Wed, 3 Dec 2014 22:48:18 +0000 (14:48 -0800)]
debuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers enabled.

9 years agoAddress nits.
Niko Matsakis [Tue, 30 Dec 2014 13:59:33 +0000 (08:59 -0500)]
Address nits.

9 years agoNormalize associated types in bounds too. Also, make the workaround
Niko Matsakis [Tue, 30 Dec 2014 11:29:59 +0000 (06:29 -0500)]
Normalize associated types in bounds too. Also, make the workaround
for lack of impl-trait-for-trait just a bit more targeted (don't
substitute err, just drop the troublesome bound for now) -- otherwise
substituting false types leads us into trouble when we normalize etc.

9 years agoAdd a test case using associated types cross crate. Fixes #18048.
Niko Matsakis [Mon, 29 Dec 2014 20:12:11 +0000 (15:12 -0500)]
Add a test case using associated types cross crate. Fixes #18048.

9 years agoEncode the TypeScheme for associated types
Niko Matsakis [Mon, 29 Dec 2014 21:32:24 +0000 (16:32 -0500)]
Encode the TypeScheme for associated types

9 years agoRemove the AssocSpace
Niko Matsakis [Mon, 29 Dec 2014 21:32:12 +0000 (16:32 -0500)]
Remove the AssocSpace

9 years agoPatch more metadata decoding problems.
Niko Matsakis [Thu, 4 Dec 2014 15:29:41 +0000 (10:29 -0500)]
Patch more metadata decoding problems.

9 years agoEncode the name for associated items on a trait. Fixes #18048.
Niko Matsakis [Thu, 4 Dec 2014 14:00:16 +0000 (09:00 -0500)]
Encode the name for associated items on a trait. Fixes #18048.

9 years agoCorrect licenses.
Niko Matsakis [Mon, 29 Dec 2014 19:38:16 +0000 (14:38 -0500)]
Correct licenses.

9 years agoResolve merge conflicts. This changes should really be integrated back to their respe...
Niko Matsakis [Mon, 29 Dec 2014 18:41:25 +0000 (13:41 -0500)]
Resolve merge conflicts. This changes should really be integrated back to their respective
commits but oh dear what a pain.

9 years agoAdjust tests for inferenceGet more conservative about inference for now. Seems better...
Niko Matsakis [Mon, 29 Dec 2014 16:22:16 +0000 (11:22 -0500)]
Adjust tests for inferenceGet more conservative about inference for now. Seems better to err on the side of being more correct rather than less. Fix a bug in typing index expressions that was exposed as a result, and add one type annotation that is not required. Delete some random tests that were relying on old behavior and don't seem to add anything anymore.

9 years agoAdd a FIXME relating to these type-testing traits
Niko Matsakis [Mon, 29 Dec 2014 16:06:15 +0000 (11:06 -0500)]
Add a FIXME relating to these type-testing traits

9 years agoPatch long line.
Niko Matsakis [Mon, 29 Dec 2014 16:05:35 +0000 (11:05 -0500)]
Patch long line.

9 years agoAdd FIXMEs relating to caching of projection results
Niko Matsakis [Mon, 29 Dec 2014 16:03:04 +0000 (11:03 -0500)]
Add FIXMEs relating to caching of projection results

9 years agoAdd a FIXME relating to regions and projection types
Niko Matsakis [Mon, 29 Dec 2014 16:02:37 +0000 (11:02 -0500)]
Add a FIXME relating to regions and projection types

9 years agoAdd a FIXME to patch up rustdoc
Niko Matsakis [Mon, 29 Dec 2014 16:02:24 +0000 (11:02 -0500)]
Add a FIXME to patch up rustdoc

9 years agoFile a FIXME relating to using where clauses, not bounds
Niko Matsakis [Mon, 29 Dec 2014 16:02:07 +0000 (11:02 -0500)]
File a FIXME relating to using where clauses, not bounds

9 years agoAdd a FIXME relating to Copy<T> not being checked
Niko Matsakis [Mon, 29 Dec 2014 16:01:11 +0000 (11:01 -0500)]
Add a FIXME relating to Copy<T> not being checked

9 years agoAdd a FIXME relating to using `ast::Name`
Niko Matsakis [Mon, 29 Dec 2014 16:00:56 +0000 (11:00 -0500)]
Add a FIXME relating to using `ast::Name`

9 years agoPatch tests and create new tests related to projection from a HRTB.
Niko Matsakis [Fri, 26 Dec 2014 20:37:56 +0000 (15:37 -0500)]
Patch tests and create new tests related to projection from a HRTB.

9 years agoDon't normalize associated types when in region binders, wait until we instantiate
Niko Matsakis [Sun, 28 Dec 2014 15:07:21 +0000 (10:07 -0500)]
Don't normalize associated types when in region binders, wait until we instantiate
them. Also fix some assertions and handling of builtin bounds.

9 years agoRemove the def-id from type parameters. Having this def-id was bad for several reasons:
Niko Matsakis [Sun, 28 Dec 2014 00:42:27 +0000 (19:42 -0500)]
Remove the def-id from type parameters. Having this def-id was bad for several reasons:

1. Produced more unique types than is necessary. This increases memory consumption.
2. Linking the type parameter to its definition *seems* like a good idea, but it
   encourages reliance on the bounds listing.
3. It made pretty-printing harder and in particular was causing bad error messages
   when errors occurred before the `TypeParameterDef` entries were fully stored.

9 years agoUpdate error messages in various compile-fail tests
Niko Matsakis [Sat, 27 Dec 2014 21:42:01 +0000 (16:42 -0500)]
Update error messages in various compile-fail tests

9 years agoMake projected types select out of the trait bounds.
Niko Matsakis [Sat, 27 Dec 2014 09:22:29 +0000 (04:22 -0500)]
Make projected types select out of the trait bounds.

9 years agoTeach `project` to project associated types out of object types.
Niko Matsakis [Fri, 26 Dec 2014 12:07:55 +0000 (07:07 -0500)]
Teach `project` to project associated types out of object types.

9 years agoAllow object safe traits to access associated types.
Niko Matsakis [Fri, 26 Dec 2014 11:40:25 +0000 (06:40 -0500)]
Allow object safe traits to access associated types.

9 years agoIntegrate projection bounds to `ExistentialBounds` but do not use them for anything.
Niko Matsakis [Fri, 26 Dec 2014 09:36:04 +0000 (04:36 -0500)]
Integrate projection bounds to `ExistentialBounds` but do not use them for anything.

9 years agoConvert to use `Rc<TraitRef>` in object types (finally!).
Niko Matsakis [Fri, 26 Dec 2014 08:31:58 +0000 (03:31 -0500)]
Convert to use `Rc<TraitRef>` in object types (finally!).

9 years agoImplement associated type projection and normalization.
Niko Matsakis [Wed, 17 Dec 2014 19:16:28 +0000 (14:16 -0500)]
Implement associated type projection and normalization.

9 years agoMove the scalar types out of static data so that we can put `Rc` into sty.
Niko Matsakis [Thu, 25 Dec 2014 12:20:48 +0000 (07:20 -0500)]
Move the scalar types out of static data so that we can put `Rc` into sty.

9 years agoRename `Polytype` to `TypeScheme` to differentiate type schemes (early bound) from...
Niko Matsakis [Tue, 23 Dec 2014 10:52:47 +0000 (05:52 -0500)]
Rename `Polytype` to `TypeScheme` to differentiate type schemes (early bound) from higher-ranked things (late-bound), which also use the `Poly` prefix.

9 years agoRename `trait_ref` field to `predicate`, since `trait_ref` is really
Niko Matsakis [Wed, 17 Dec 2014 21:00:34 +0000 (16:00 -0500)]
Rename `trait_ref` field to `predicate`, since `trait_ref` is really
overly general, and the value is always *some* sort of predicate.

9 years agoRewrite the intrinsicck to take the parameter environment into account. Also fixes...
Niko Matsakis [Tue, 23 Dec 2014 01:57:14 +0000 (20:57 -0500)]
Rewrite the intrinsicck to take the parameter environment into account. Also fixes #20116.

9 years agoMove the TypeContents-based "Sized" queries into trans, where the full
Niko Matsakis [Thu, 18 Dec 2014 14:26:10 +0000 (09:26 -0500)]
Move the TypeContents-based "Sized" queries into trans, where the full
types are always known and hence the ParameterEnvironment is not
necessary. For other `Sized` queries, use the trait infrastructure
just like `Copy`.

9 years agoMake ExprUseVisitor<..> use inherited parameter environments.
Niko Matsakis [Tue, 16 Dec 2014 20:18:23 +0000 (15:18 -0500)]
Make ExprUseVisitor<..> use inherited parameter environments.

9 years agoRefactor various queries out of `ty` and into `trans/common`
Niko Matsakis [Tue, 16 Dec 2014 20:00:05 +0000 (15:00 -0500)]
Refactor various queries out of `ty` and into `trans/common`

9 years agoauto merge of #19941 : alexcrichton/rust/issue-19767, r=brson
bors [Tue, 30 Dec 2014 11:11:07 +0000 (11:11 +0000)]
auto merge of #19941 : alexcrichton/rust/issue-19767, r=brson

This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue #19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag `-L` with the same trailing
syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`,
`:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup
path the compiler should add the argument to. The `dependency` lookup path is
used when looking up crate dependencies, the `crate` lookup path is used when
looking for immediate dependencies (`extern crate` statements), and the `native`
lookup path is used for probing for native libraries to insert into rlibs. Paths
with `all` are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the `RUST_PATH` lookup path is added to all of
these paths.

Closes #19767

9 years agoauto merge of #20320 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 30 Dec 2014 08:02:39 +0000 (08:02 +0000)]
auto merge of #20320 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts
Alex Crichton [Tue, 30 Dec 2014 00:38:07 +0000 (16:38 -0800)]
Test fixes and rebase conflicts

9 years agorollup merge of #20317: brson/rust-installer-v2
Alex Crichton [Tue, 30 Dec 2014 03:47:58 +0000 (19:47 -0800)]
rollup merge of #20317: brson/rust-installer-v2

9 years agoSimplify some logic in dist.mk
Brian Anderson [Tue, 30 Dec 2014 03:08:35 +0000 (19:08 -0800)]
Simplify some logic in dist.mk

9 years agomk: Package mingw components in unix installer on windows
Brian Anderson [Tue, 30 Dec 2014 00:47:21 +0000 (16:47 -0800)]
mk: Package mingw components in unix installer on windows

This puts stdc++ and the unwinding dll into the main package
and creates a separate rust-mingw package for everything else.

9 years agomk: Make distcheck build binary tarballs on windows
Brian Anderson [Tue, 30 Dec 2014 00:24:44 +0000 (16:24 -0800)]
mk: Make distcheck build binary tarballs on windows

These work, but aren't being built and uploaded because the bots run
'distcheck' not 'dist'.

9 years agoInstall copyright information and package docs
Brian Anderson [Mon, 29 Dec 2014 19:15:40 +0000 (11:15 -0800)]
Install copyright information and package docs

This distributes docs in a separate package called rust-docs. The rust-packaging
project will combine it with Rust and Cargo into a single installer in a variety of formats.

9 years agoUpgrade rust-installer to v2
Brian Anderson [Fri, 12 Dec 2014 02:05:05 +0000 (18:05 -0800)]
Upgrade rust-installer to v2

9 years agoauto merge of #20160 : nick29581/rust/ranges2, r=nikomatsakis
bors [Tue, 30 Dec 2014 00:42:13 +0000 (00:42 +0000)]
auto merge of #20160 : nick29581/rust/ranges2, r=nikomatsakis

The first six commits are from an earlier PR (#19858) and have already been reviewed. This PR makes an awful hack in the compiler to accommodate slices both natively and in the index a range form. After a snapshot we can hopefully add the new Index impls and then we can remove these awful hacks.

r? @nikomatsakis (or anyone who knows the compiler, really)

9 years agorollup merge of #20310: fhahn/issue-15877-model-lexer-range
Alex Crichton [Tue, 30 Dec 2014 00:36:55 +0000 (16:36 -0800)]
rollup merge of #20310: fhahn/issue-15877-model-lexer-range

This patch for #15877 uses Antlr's input lookahead (`_input.LA(1) != '.'`) to solve the conflict between the LIT_FLOAT and the range syntax.

Note that in order to execute the grammar tests, #20245 should land first.

9 years agorollup merge of #20309: sfackler/refcell-send
Alex Crichton [Tue, 30 Dec 2014 00:36:54 +0000 (16:36 -0800)]
rollup merge of #20309: sfackler/refcell-send

Also get rid of NoSync markers since UnsafeCell is now not Sync

r? @alexcrichton

9 years agorollup merge of #20306: alexcrichton/second-pass-string
Alex Crichton [Tue, 30 Dec 2014 00:36:52 +0000 (16:36 -0800)]
rollup merge of #20306: alexcrichton/second-pass-string

This commit performs a second pass over the `std::string` module, performing the
following actions:

* The name `std::string` is now stable.
* The `String::from_utf8` function is now stable after having been altered to
  return a new `FromUtf8Error` structure. The `FromUtf8Error` structure is now
  stable as well as its `into_bytes` and `utf8_error` methods.
* The `String::from_utf8_lossy` function is now stable.
* The `String::from_chars` method is now deprecated in favor of `.collect()`
* The `String::from_raw_parts` method is now stable
* The `String::from_str` function remains experimental
* The `String::from_raw_buf` function remains experimental
* The `String::from_raw_buf_len` function remains experimental
* The `String::from_utf8_unchecked` function is now stable
* The `String::from_char` function is now deprecated in favor of
  `repeat(c).take(n).collect()`
* The `String::grow` function is now deprecated in favor of
  `.extend(repeat(c).take(n)`
* The `String::capacity` method is now stable
* The `String::reserve` method is now stable
* The `String::reserve_exact` method is now stable
* The `String::shrink_to_fit` method is now stable
* The `String::pop` method is now stable
* The `String::as_mut_vec` method is now stable
* The `String::is_empty` method is now stable
* The `IntoString` trait is now deprecated (there are no implementors)
* The `String::truncate` method is now stable
* The `String::insert` method is now stable
* The `String::remove` method is now stable
* The `String::push` method is now stable
* The `String::push_str` method is now stable
* The `String::from_utf16` function is now stable after its error type has now
  become an opaque structure to carry more semantic information in the future.

A number of these changes are breaking changes, but the migrations should be
fairly straightforward on a case-by-case basis (outlined above where possible).

[breaking-change]

9 years agorollup merge of #20289: nick29581/shadowing
Alex Crichton [Tue, 30 Dec 2014 00:36:49 +0000 (16:36 -0800)]
rollup merge of #20289: nick29581/shadowing

r? eddyb

9 years agorollup merge of #20282: WebDrake/makefile-in
Alex Crichton [Tue, 30 Dec 2014 00:36:45 +0000 (16:36 -0800)]
rollup merge of #20282: WebDrake/makefile-in

This is a very trivial fix for a broken link that I noticed while building the compiler for the first time.  I've changed it to its presumed successor.

9 years agorollup merge of #20281: dgiagio/libregex_deprecated_fix1
Alex Crichton [Tue, 30 Dec 2014 00:36:44 +0000 (16:36 -0800)]
rollup merge of #20281: dgiagio/libregex_deprecated_fix1

Fixes #20280

9 years agorollup merge of #20279: dgiagio/libserialize_deprecated_fix1
Alex Crichton [Tue, 30 Dec 2014 00:36:42 +0000 (16:36 -0800)]
rollup merge of #20279: dgiagio/libserialize_deprecated_fix1

Fixes #20278

9 years agorollup merge of #20276: alexcrichton/deprecate-term
Alex Crichton [Tue, 30 Dec 2014 00:36:41 +0000 (16:36 -0800)]
rollup merge of #20276: alexcrichton/deprecate-term

This library is now published on crates.io as the `term` crate, so the in-tree
version is now deprecated. Once stability warnings are enabled, this library
will automatically be gated.

9 years agorollup merge of #20275: inthecloud247/patch-1
Alex Crichton [Tue, 30 Dec 2014 00:36:40 +0000 (16:36 -0800)]
rollup merge of #20275: inthecloud247/patch-1

Updating curl flag and instructions to follow better security practices
used by other projects: https://github.com/saltstack/salt-bootstrap

Other references:
http://www.reddit.com/r/linux/comments/1s58my/please_stop_piping_curl1_to_sh1/
http://www.seancassidy.me/dont-pipe-to-your-shell.html
https://news.ycombinator.com/item?id=8550511
http://output.chrissnell.com/post/69023793377/stop-piping-curl-1-to-sh-1
http://www.reddit.com/comments/1pqtcb

9 years agorollup merge of #20271: vhbit/datalayout-fix
Alex Crichton [Tue, 30 Dec 2014 00:36:38 +0000 (16:36 -0800)]
rollup merge of #20271: vhbit/datalayout-fix

According to http://llvm.org/docs/LangRef.html#data-layout correct syntax
for data layout is `a:<abi>:<pref>` so it looks like  `a0:<abi>:<pref>` is
either a typo or outdated syntax (as it goes back pretty deep in time)

9 years agorollup merge of #20270: bombless/patch-2
Alex Crichton [Tue, 30 Dec 2014 00:36:37 +0000 (16:36 -0800)]
rollup merge of #20270: bombless/patch-2

9 years agorollup merge of #20269: dirk/indent-where
Alex Crichton [Tue, 30 Dec 2014 00:36:35 +0000 (16:36 -0800)]
rollup merge of #20269: dirk/indent-where

* Add <span class=‘where’> around clause
* CSS rule to format the span

(for issue #20176)

9 years agorollup merge of #20268: mdinger/pretty
Alex Crichton [Tue, 30 Dec 2014 00:36:34 +0000 (16:36 -0800)]
rollup merge of #20268: mdinger/pretty

For consistency with the documentation, *options* should be before *filenames*.

9 years agorollup merge of #20266: nick29581/dxr-use
Alex Crichton [Tue, 30 Dec 2014 00:36:32 +0000 (16:36 -0800)]
rollup merge of #20266: nick29581/dxr-use

r? @huonw

9 years agorollup merge of #20265: nicholasbishop/bishop_add_missing_bitflags_methods
Alex Crichton [Tue, 30 Dec 2014 00:36:30 +0000 (16:36 -0800)]
rollup merge of #20265: nicholasbishop/bishop_add_missing_bitflags_methods

The methods `from_bits` and `from_bits_truncate` were missing from the
list of generated methods. Didn't see a useful way to abbreviate, so
added with the same docstrings used in the macro definition.

9 years agorollup merge of #20264: nagisa/threadrng
Alex Crichton [Tue, 30 Dec 2014 00:36:29 +0000 (16:36 -0800)]
rollup merge of #20264: nagisa/threadrng

Since runtime is removed, rust has no tasks anymore and everything is moving
from being task-* to thread-*. Let’s rename TaskRng as well!

This is a breaking change. If a breaking change for consistency is not desired, feel free to close.

9 years agorollup merge of #20263: crhino/lifetime-elision-help
Alex Crichton [Tue, 30 Dec 2014 00:36:27 +0000 (16:36 -0800)]
rollup merge of #20263: crhino/lifetime-elision-help

Fixes #19707.

In terms of output, it currently uses the form `argument #1`, `argument #2`, etc. If anyone has any better suggestions I would be glad to consider them.

9 years agorollup merge of #20262: arturoc/fix-scoped_thread_local
Alex Crichton [Tue, 30 Dec 2014 00:36:25 +0000 (16:36 -0800)]
rollup merge of #20262: arturoc/fix-scoped_thread_local

was missing a couple of semicolons and applications using it failed to compile

9 years agorollup merge of #20252: huonw/doc-no-ignore
Alex Crichton [Tue, 30 Dec 2014 00:36:24 +0000 (16:36 -0800)]
rollup merge of #20252: huonw/doc-no-ignore

9 years agorollup merge of #20250: ipetkov/deriving
Alex Crichton [Tue, 30 Dec 2014 00:36:22 +0000 (16:36 -0800)]
rollup merge of #20250: ipetkov/deriving

* Both enums already derived `Copy`, but storing them in any
  struct/container would prevent implementing `Clone` for said
  struct/container even though they should be clonable.
* Also add PartialEq and Eq for good measure.

9 years agorollup merge of #20248: steveklabnik/gh20038
Alex Crichton [Tue, 30 Dec 2014 00:36:20 +0000 (16:36 -0800)]
rollup merge of #20248: steveklabnik/gh20038

A part of #20038

This is just the beginning of what needs to be done, but it's some of it.

/cc @aturon

9 years agorollup merge of #20245: fhahn/make-lexer-tests-runable-again
Alex Crichton [Tue, 30 Dec 2014 00:36:18 +0000 (16:36 -0800)]
rollup merge of #20245: fhahn/make-lexer-tests-runable-again

I would like to look into some issues related to the model lexer  #15883.

I stumbled upon 2 minor problems when I tried running the lexer tests:

* antlr did not put the generated files in the correct directory
* grammer/verify.rs did not work with the most recent version of rust

With these changes (and setting CLASSPATH=/usr/share/java/antlr-4.4-complete.jar:$CLASSPATH) I was able to execute the tests.

Note that I just fixed the syntax errors and added `None` as 2. argument of `Literal`. I am not sure if this is correct however. I still have to take a closer look at what verify.rs actually does. Are there any helpful pointers?

9 years agorollup merge of #20243: bombless/patch-1
Alex Crichton [Tue, 30 Dec 2014 00:36:17 +0000 (16:36 -0800)]
rollup merge of #20243: bombless/patch-1

9 years agorollup merge of #20242: sanxiyn/break-from-fn
Alex Crichton [Tue, 30 Dec 2014 00:36:15 +0000 (16:36 -0800)]
rollup merge of #20242: sanxiyn/break-from-fn

Fix #19331.

9 years agorollup merge of #20239: YawarRaza7349/patch-1
Alex Crichton [Tue, 30 Dec 2014 00:36:14 +0000 (16:36 -0800)]
rollup merge of #20239: YawarRaza7349/patch-1

9 years agorollup merge of #20231: fhahn/issue-20226-eexist
Alex Crichton [Tue, 30 Dec 2014 00:36:12 +0000 (16:36 -0800)]
rollup merge of #20231: fhahn/issue-20226-eexist

I've created a patch for #20226, which maps `EEXIST` to the `PathAlreadyExists` error on Unix. To test this, I use `mkdir`, which raises `EEXIST` if the directory already exists.

On Windows, I map `ERROR_ALREADY_EXISTS` to `PathAlreadyExist`, but I am note sure if `mkdir` on Windows raises `ERROR_ALREADY_EXISTS` and do not have a Windows installation handy for testing.

And I noticed another thing. No error seems to map to `IoErrorKind::PathDoesntExist` and I am wondering what the difference to `FileNotFound` is?

9 years agorollup merge of #20230: bheesham/noshard
Alex Crichton [Tue, 30 Dec 2014 00:36:11 +0000 (16:36 -0800)]
rollup merge of #20230: bheesham/noshard

I forgot to do this in my previous PR. This should close #19145 .

9 years agorollup merge of #20223: aochagavia/typo
Alex Crichton [Tue, 30 Dec 2014 00:36:09 +0000 (16:36 -0800)]
rollup merge of #20223: aochagavia/typo

9 years agorollup merge of #20216: sfackler/fix-mangling
Alex Crichton [Tue, 30 Dec 2014 00:36:07 +0000 (16:36 -0800)]
rollup merge of #20216: sfackler/fix-mangling

Closes #20209

r? @alexcrichton

9 years agorollup merge of #20215: csouth3/hashmap-rename
Alex Crichton [Tue, 30 Dec 2014 00:36:06 +0000 (16:36 -0800)]
rollup merge of #20215: csouth3/hashmap-rename

Rename struct `Entries` to `Iter` in hash/table.rs and hash/map.rs, to match the naming convention of rust-lang/rfcs#344.

This is a [breaking-change].

9 years agorollup merge of #20214: bluss/fix-hashmap-example
Alex Crichton [Tue, 30 Dec 2014 00:36:05 +0000 (16:36 -0800)]
rollup merge of #20214: bluss/fix-hashmap-example

The example derived Hash + Eq on a type that was used as *values* for
a hashmap.. for the example to make sense, we have to use a custom *key*
type.

Write a slightly more involved example, still using Vikings, but this
time as key.

I preferred using String over &str here, since that's the typical usage
and we might want to lead users down that path.

9 years agorollup merge of #20210: tshepang/patch-5
Alex Crichton [Tue, 30 Dec 2014 00:36:04 +0000 (16:36 -0800)]
rollup merge of #20210: tshepang/patch-5

9 years agorollup merge of #20207: jroesch/issue-18906-testcase
Alex Crichton [Tue, 30 Dec 2014 00:36:03 +0000 (16:36 -0800)]
rollup merge of #20207: jroesch/issue-18906-testcase

Closes issue #18906. This is what we talked about last night/early this morning. r? @nikomatsakis.

9 years agorollup merge of #20205: tshepang/patch-4
Alex Crichton [Tue, 30 Dec 2014 00:36:01 +0000 (16:36 -0800)]
rollup merge of #20205: tshepang/patch-4

The paragraph following this removed one has the same info, only better.

9 years agorollup merge of #20195: nagisa/unused-typo
Alex Crichton [Tue, 30 Dec 2014 00:36:00 +0000 (16:36 -0800)]
rollup merge of #20195: nagisa/unused-typo

9 years agorollup merge of #20194: nick29581/dst-syntax
Alex Crichton [Tue, 30 Dec 2014 00:35:59 +0000 (16:35 -0800)]
rollup merge of #20194: nick29581/dst-syntax

Part of #19607.

r? @nikomatsakis

9 years agorollup merge of #20191: lifthrasiir/double-debug_assert
Alex Crichton [Tue, 30 Dec 2014 00:35:57 +0000 (16:35 -0800)]
rollup merge of #20191: lifthrasiir/double-debug_assert

Yes, really. That definition wouldn't work anyway.

This also fixes repeated entries for `debug_assert!` from libcore docs. Maybe we should warn such macro definitions in the first place?

9 years agorollup merge of #20182: brianloveswords/patch-2
Alex Crichton [Tue, 30 Dec 2014 00:35:56 +0000 (16:35 -0800)]
rollup merge of #20182: brianloveswords/patch-2

Treemap should be BTreeMap

9 years agorollup merge of #20165: tamird/needstest-tests
Alex Crichton [Tue, 30 Dec 2014 00:35:54 +0000 (16:35 -0800)]
rollup merge of #20165: tamird/needstest-tests

@alexcrichton @jakub-

9 years agorollup merge of #20160: nick29581/ranges2
Alex Crichton [Tue, 30 Dec 2014 00:35:53 +0000 (16:35 -0800)]
rollup merge of #20160: nick29581/ranges2

The first six commits are from an earlier PR (#19858) and have already been reviewed. This PR makes an awful hack in the compiler to accommodate slices both natively and in the index a range form. After a snapshot we can hopefully add the new Index impls and then we can remove these awful hacks.

r? @nikomatsakis (or anyone who knows the compiler, really)

9 years agorollup merge of #20042: alexcrichton/second-pass-ptr
Alex Crichton [Tue, 30 Dec 2014 00:35:51 +0000 (16:35 -0800)]
rollup merge of #20042: alexcrichton/second-pass-ptr

This commit performs a second pass for stabilization over the `std::ptr` module.
The specific actions taken were:

* The `RawPtr` trait was renamed to `PtrExt`
* The `RawMutPtr` trait was renamed to `PtrMutExt`
* The module name `ptr` is now stable.
* These functions were all marked `#[stable]` with no modification:
  * `null`
  * `null_mut`
  * `swap`
  * `replace`
  * `read`
  * `write`
  * `PtrExt::is_null`
  * `PtrExt::is_not_null`
  * `PtrExt::offset`
* These functions remain unstable:
  * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive
                         as null isn't the only bad value, and it's unclear
                         whether we want to commit to these functions at this
                         time. The reference/lifetime semantics as written are
                         also problematic in how they encourage arbitrary
                         lifetimes.
  * `zero_memory` - This function is currently not used at all in the
                    distribution, and in general it plays a broader role in the
                    "working with unsafe pointers" story. This story is not yet
                    fully developed, so at this time the function remains
                    unstable for now.
  * `read_and_zero` - This function remains unstable for largely the same
                      reasons as `zero_memory`.
* These functions are now all deprecated:
  * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead.
  * `PtrExt::to_uint` - use an `as` expression instead.

9 years agorollup merge of #19661: alexcrichton/mutex-result
Alex Crichton [Tue, 30 Dec 2014 00:35:50 +0000 (16:35 -0800)]
rollup merge of #19661: alexcrichton/mutex-result

All of the current std::sync primitives have poisoning enable which means that
when a task fails inside of a write-access lock then all future attempts to
acquire the lock will fail. This strategy ensures that stale data whose
invariants are possibly not upheld are never viewed by other tasks to help
propagate unexpected panics (bugs in a program) among tasks.

Currently there is no way to test whether a mutex or rwlock is poisoned. One
method would be to duplicate all the methods with a sister foo_catch function,
for example. This pattern is, however, against our [error guidelines][errors].
As a result, this commit exposes the fact that a task has failed internally
through the return value of a `Result`.

[errors]: https://github.com/rust-lang/rfcs/blob/master/text/0236-error-conventions.md#do-not-provide-both-result-and-fail-variants

All methods now return a `LockResult<T>` or a `TryLockResult<T>` which
communicates whether the lock was poisoned or not. In a `LockResult`, both the
`Ok` and `Err` variants contains the `MutexGuard<T>` that is being returned in
order to allow access to the data if poisoning is not desired. This also means
that the lock is *always* held upon returning from `.lock()`.

A new type, `PoisonError`, was added with one method `into_guard` which can
consume the assertion that a lock is poisoned to gain access to the underlying
data.

This is a breaking change because the signatures of these methods have changed,
often incompatible ways. One major difference is that the `wait` methods on a
condition variable now consume the guard and return it in as a `LockResult` to
indicate whether the lock was poisoned while waiting. Most code can be updated
by calling `.unwrap()` on the return value of `.lock()`.

[breaking-change]