Commit Graph

35880 Commits

Author SHA1 Message Date
Alex Crichton
de0749fc5a 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.
2014-12-29 16:36:41 -08:00
Alex Crichton
c9531b4f64 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
2014-12-29 16:36:40 -08:00
Alex Crichton
f8fc141c5e 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)
2014-12-29 16:36:38 -08:00
Alex Crichton
7b5b0b1caf rollup merge of #20270: bombless/patch-2 2014-12-29 16:36:37 -08:00
Alex Crichton
1e9c7c51cb rollup merge of #20269: dirk/indent-where
* Add <span class=‘where’> around clause
* CSS rule to format the span

(for issue #20176)
2014-12-29 16:36:35 -08:00
Alex Crichton
1d373ae6d1 rollup merge of #20268: mdinger/pretty
For consistency with the documentation, *options* should be before *filenames*.
2014-12-29 16:36:34 -08:00
Alex Crichton
066be2a72d rollup merge of #20266: nick29581/dxr-use
r? @huonw
2014-12-29 16:36:32 -08:00
Alex Crichton
b1dec37561 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.
2014-12-29 16:36:30 -08:00
Alex Crichton
9cbbfee8a4 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.
2014-12-29 16:36:29 -08:00
Alex Crichton
3385ff7757 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.
2014-12-29 16:36:27 -08:00
Alex Crichton
6b473b2e05 rollup merge of #20262: arturoc/fix-scoped_thread_local
was missing a couple of semicolons and applications using it failed to compile
2014-12-29 16:36:25 -08:00
Alex Crichton
2fea594444 rollup merge of #20252: huonw/doc-no-ignore 2014-12-29 16:36:24 -08:00
Alex Crichton
1c61e74518 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.
2014-12-29 16:36:22 -08:00
Alex Crichton
4717f07989 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
2014-12-29 16:36:20 -08:00
Alex Crichton
6fabf421f0 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?
2014-12-29 16:36:18 -08:00
Alex Crichton
b31926d115 rollup merge of #20243: bombless/patch-1 2014-12-29 16:36:17 -08:00
Alex Crichton
4dacf2780f rollup merge of #20242: sanxiyn/break-from-fn
Fix #19331.
2014-12-29 16:36:15 -08:00
Alex Crichton
21f661a6ef rollup merge of #20239: YawarRaza7349/patch-1 2014-12-29 16:36:14 -08:00
Alex Crichton
3801c2678f 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?
2014-12-29 16:36:12 -08:00
Alex Crichton
bcd3b1685a rollup merge of #20230: bheesham/noshard
I forgot to do this in my previous PR. This should close #19145 .
2014-12-29 16:36:11 -08:00
Alex Crichton
0d95b41148 rollup merge of #20223: aochagavia/typo 2014-12-29 16:36:09 -08:00
Alex Crichton
0fbd1e2496 rollup merge of #20216: sfackler/fix-mangling
Closes #20209

r? @alexcrichton
2014-12-29 16:36:07 -08:00
Alex Crichton
748440c5b3 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].
2014-12-29 16:36:06 -08:00
Alex Crichton
9f6eb29a9d 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.
2014-12-29 16:36:05 -08:00
Alex Crichton
9ac9d7af3b rollup merge of #20210: tshepang/patch-5 2014-12-29 16:36:04 -08:00
Alex Crichton
88ea54a39d rollup merge of #20207: jroesch/issue-18906-testcase
Closes issue #18906. This is what we talked about last night/early this morning. r? @nikomatsakis.
2014-12-29 16:36:03 -08:00
Alex Crichton
12ac91e1a6 rollup merge of #20205: tshepang/patch-4
The paragraph following this removed one has the same info, only better.
2014-12-29 16:36:01 -08:00
Alex Crichton
06256582e9 rollup merge of #20195: nagisa/unused-typo 2014-12-29 16:36:00 -08:00
Alex Crichton
2a8547783f rollup merge of #20194: nick29581/dst-syntax
Part of #19607.

r? @nikomatsakis
2014-12-29 16:35:59 -08:00
Alex Crichton
28f424fd1b 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?
2014-12-29 16:35:57 -08:00
Alex Crichton
7b3be9b854 rollup merge of #20182: brianloveswords/patch-2
Treemap should be BTreeMap
2014-12-29 16:35:56 -08:00
Alex Crichton
62c9a48953 rollup merge of #20165: tamird/needstest-tests
@alexcrichton @jakub-
2014-12-29 16:35:54 -08:00
Alex Crichton
dbc8440821 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)
2014-12-29 16:35:53 -08:00
Alex Crichton
52315a97c6 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.
2014-12-29 16:35:51 -08:00
Alex Crichton
cc20d6009e 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]
2014-12-29 16:35:50 -08:00
Alex Crichton
94d82c1f55 rollup merge of #19457: reem/remove-is-lang-item
Removes a FIXME on closed issue #15064. This flag is no
longer needed or used since reflection is gone.
2014-12-29 16:35:49 -08:00
Nick Cameron
113f8aa86b Rebasing and reviewer changes 2014-12-30 13:06:25 +13:00
Nick Cameron
3bf405682d Fallout from mut slices 2014-12-30 13:06:25 +13:00
Nick Cameron
4e2afb0052 Remove ExprSlice by hacking the compiler
[breaking-change]

The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-30 13:06:25 +13:00
Nick Cameron
ed8f503911 Add hypothetical support for ranges with only an upper bound
Note that this doesn't add the surface syntax.
2014-12-30 13:06:24 +13:00
Alex Crichton
54452cdd68 std: Second pass stabilization for 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 `MutPtrExt`
* 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::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.
  * `PtrExt::is_not_null` - use `!p.is_null()` instead.
2014-12-29 15:57:28 -08:00
Alex Crichton
35e63e3827 std: Stabilization pass for mutex/rwlock/condvar
This commit performs a stabilization pass over the sync::{mutex, rwlock,
condvar} modules, marking the following items as stable:

* Mutex
* Mutex::new
* Mutex::lock
* Mutex::try_lock
* MutexGuard
* RWLock
* RWLock::new
* RWLock::read
* RWLock::try_read
* RWLock::write
* RWLock::try_write
* RWLockReadGuard
* RWLockWriteGuard
* Condvar
* Condvar::new
* Condvar::wait
* Condvar::notify_one
* Condvar::notify_all
* PoisonError
* TryLockError
* TryLockError::Poisoned
* TryLockError::WouldBlock
* LockResult
* TryLockResult

The following items remain unstable to explore future possibilities of unifying
the static/non-static variants of the types:

* StaticMutex
* StaticMutex::new
* StaticMutex::lock
* StaticMutex::try_lock
* StaticMutex::desroy
* StaticRWLock
* StaticRWLock::new
* StaticRWLock::read
* StaticRWLock::try_read
* StaticRWLock::write
* StaticRWLock::try_write
* StaticRWLock::destroy

The following items were removed in favor of `Guard<'static, ()>` instead.

* StaticMutexGuard
* StaticRWLockReadGuard
* StaticRWLockWriteGuard
2014-12-29 14:41:30 -08:00
bors
71123902e1 auto merge of #20101 : alexcrichton/rust/issue-20096, r=aturon
These crates are all deprecated for their rust-lang/$crate equivalents and by
generating docs we're generating broken links. The documentation for these
crates are generated out-of-tree and are managed separately, so we're not losing
the documentation altogether, just the links from the main distribution's docs.

Closes #20096
2014-12-29 20:19:53 +00:00
Florian Hahn
adda8997b1 Update grammer/verify.rs to work with recent master 2014-12-29 19:40:40 +01:00
Florian Hahn
288195370c Fix output directory for generated antlr code 2014-12-29 19:40:40 +01:00
bors
19f73b4ef6 auto merge of #20058 : Kimundi/rust/str_pattern_pre, r=alexcrichton
This stabilizes most methods on `&str` working with patterns in a way that is forwards-compatible with a generic string pattern matching API:
- Methods that are using the primary name for their operation are marked as `#[stable]`, as they can be upgraded to a full `Pattern` API later without existing code breaking. Example: `contains(&str)`
- Methods that are using a more specific name in order to not clash with the primary one are marked as `#[unstable]`, as they will likely be removed once their functionality is merged into the primary one. Example: `contains_char<C: CharEq>(C)`
- The method docs got changed to consistently refer to the pattern types as a pattern.
- Methods whose names do not match in the context of the more generic API got renamed. Example: `trim_chars -> trim_matches` 

Additionally, all methods returning iterators got changed to return unique new types with changed names in accordance with the new naming guidelines.

See also https://github.com/rust-lang/rfcs/pull/528

Due to some deprecations and type changes, this is a 

[breaking-change]
2014-12-29 18:02:30 +00:00
Alex Crichton
76e5ed655c std: Return Result from RWLock/Mutex methods
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]
2014-12-29 09:18:09 -08:00
bors
3dcc409fac auto merge of #19549 : huonw/rust/middle-ty-2, r=nikomatsakis
This takes building `librustc/lib.rs` from using 696 MB to 588 (`rustc --no-trans`), and 1.99 GB to 1.87 (`rustc -O`). It also reduces `sty` down to 32 bytes on platforms with 64-bit pointers, at the expense of some more side-tables in `ctxt`. I'm sure there's more gains to be had from reducing the size of the side tables (e.g. by making the actual things they're storing smaller).

r? @nikomatsakis
2014-12-29 13:32:19 +00:00
Huon Wilson
91db254c81 More rebase fixes. 2014-12-30 00:11:30 +11:00
Huon Wilson
7c21a0ff69 Update rustc_driver tests. 2014-12-29 23:55:25 +11:00