about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-706/+763
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20Auto merge of #21439 - alexcrichton:rollup, r=alexcrichtonbors-296/+467
Continuation of https://github.com/rust-lang/rust/pull/21428
2015-01-20Test fixes and rebase conflictsAlex Crichton-8/+6
2015-01-21Rollup merge of #20991 - mneumann:llvm-dragonfly-take2, r=alexcrichtonBarosl LEE-1/+1
It got accidentially reverted in 44440e5.
2015-01-21Rollup merge of #21179 - nodakai:reference-mod-to-self, r=huonwBarosl LEE-4/+4
This should have been done together with 56dcbd17fdad5d39b7b02e22a7490d2468718d08 for rust-lang/rust#20361
2015-01-21Rollup merge of #21427 - steveklabnik:generics_fix, r=alexcrichtonBarosl LEE-3/+3
Multiple people have asked me if this is a reference to Hacker News, and I _certainly_ don't want to give them that impression.
2015-01-21Rollup merge of #21424 - sanxiyn:coerce-mut, r=nikomatsakisBarosl LEE-5/+35
This is caught in borrowck now, but catching in typeck is faster and improves diagnostics. CC #17561. r? @nikomatsakis
2015-01-21Rollup merge of #21404 - japaric:hash, r=alexcrichtonBarosl LEE-0/+25
closes #21402 cc #15294 r? @alexcrichton or @aturon cc @ExpHP (btw, this only covers arrays with arity up to 32)
2015-01-21Rollup merge of #21388 - aochagavia:collections, r=GankroBarosl LEE-11/+71
**Breaking change**: `VecMap::into_iter` now consumes the `VecMap`. To fix it you should pass the VecMap by value instead of by reference. [breaking-change] r? @Gankro
2015-01-21Rollup merge of #21387 - retep998:hmodule, r=alexcrichtonBarosl LEE-2/+3
r? @alexcrichton
2015-01-21Rollup merge of #21386 - Diggsey:issue-21384, r=alexcrichtonBarosl LEE-4/+31
Fixes #21384
2015-01-21Rollup merge of #21380 - tshepang:patch-3, r=steveklabnikBarosl LEE-1/+1
2015-01-21Rollup merge of #21123 - visualfc:master, r=alexcrichtonBarosl LEE-1/+1
example: let m = "hello \ world";
2015-01-21Rollup merge of #21377 - iKevinY:speedy-tidy, r=huonwBarosl LEE-8/+8
`x in y` is more Pythonic than `y.find(x) != -1`. I believe it runs quite a bit faster as well (though it's probably not a bottleneck of the Travis builds): ```bash $ python -m timeit '"abc".find("a") != -1' 1000000 loops, best of 3: 0.218 usec per loop $ python -m timeit '"a" in "abc"' 10000000 loops, best of 3: 0.0343 usec per loop ```
2015-01-21Rollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichtonBarosl LEE-42/+39
After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed. (The number of such casts turned out to be relatively small).
2015-01-21Rollup merge of #21369 - iKevinY:no-travis-notes, r=sanxiynBarosl LEE-2/+2
Updated `tidy.py` to skip printing NOTEs if the [`TRAVIS`](http://docs.travis-ci.com/user/ci-environment/#Environment-variables) environment variable is set.
2015-01-21Rollup merge of #21359 - WiSaGaN:bugfix/fix_marker, r=alexcrichtonBarosl LEE-3/+3
From std::markers to std::marker.
2015-01-21Rollup merge of #21358 - glacjay:patch-2, r=alexcrichtonBarosl LEE-0/+1
2015-01-21Rollup merge of #21357 - kimroen:patch-1, r=sanxiynBarosl LEE-3/+2
Having both "Right now" and "at the moment" in the same statement is redundant.
2015-01-21Rollup merge of #21100 - tstorch:small_readability_update, r=alexcrichtonBarosl LEE-12/+9
Why not use what is there?
2015-01-21Rollup merge of #21345 - glacjay:patch-1, r=alexcrichtonBarosl LEE-1/+1
The reference should be `x`, not `FOO` itself.
2015-01-21Rollup merge of #21339 - thorncp:api-docs-search, r=alexcrichtonBarosl LEE-1/+1
Increases the delay of the search box to 500ms after key up. I tried adding a three character minimum for setting the delay, but didn't find it very useful. Should close #20095 @Jurily, your input is welcome!
2015-01-21Rollup merge of #21336 - rylev:better-nofile-error, r=brsonBarosl LEE-2/+3
Contribution from @look! Addresses https://github.com/rust-lang/rust/issues/21329
2015-01-21Rollup merge of #21331 - michaelsproul:sync-error-impls, r=alexcrichtonBarosl LEE-6/+23
Two errors in `std::sync` are currently missing implementations of the standard error trait because they contain types which aren't `Send`. This PR therefore requires #21312.
2015-01-21Rollup merge of #21048 - aroben:patch-1, r=steveklabnikBarosl LEE-1/+1
Now both the enum values and the prose describing them mention the values in the same order.
2015-01-21Rollup merge of #21326 - look:nano-syntax-highlighting, r=kmcallisterBarosl LEE-0/+35
rust.nanorc provides syntax highlighting for Rust. An attempt has been made to make the syntax highlighting look good on both dark and light terminals. Issue #21286. This PR is dedicated to @substars and nano-lovers everywhere.
2015-01-21Rollup merge of #21314 - fenhl:patch-1, r=steveklbanikBarosl LEE-1/+1
See [this document](https://gist.github.com/0xabad1dea/8870b192fd1758743f66) by @0xabad1dea for the rationale.
2015-01-21Rollup merge of #21312 - michaelsproul:remove-error-send-bound, r=aturonBarosl LEE-8/+8
As discussed with @aturon, this PR removes the `Send` bound from `std::error::Error`, allowing us to implement `Error` for error types containing non-`Send` types. Current examples include `PoisonError` and `TryLockError` from `std::sync` which contain a Guard that we don't want sent between tasks. [breaking-change]
2015-01-21Rollup merge of #21302 - gutworth:rm-find-equiv-test, r=brsonBarosl LEE-17/+0
2015-01-21Rollup merge of #21294 - alfie:typo, r=steveklabnikBarosl LEE-1/+1
Wrong verb.
2015-01-21Rollup merge of #21355 - alfie:suffix, r=steveklabnikBarosl LEE-107/+107
More [u]int => [i|u]size and [i|u] => [i|u]s changes
2015-01-21Rollup merge of #21280 - timparenti:old-guide-stub-grammar, r=alexcrichtonBarosl LEE-12/+12
This removes the extra "the" from the phrase "the the Rust Programming Language book", which isn't particularly grammatical, in stub documents introduced in #20802 to direct users from the old guides to the corresponding sections of the book.
2015-01-21Rollup merge of #20998 - estsauver:20984, r=steveklabnikBarosl LEE-38/+38
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. If someone could look at src/etc/generate-deriving-span-tests.py, I'm not sure how those tests were passing before/if they were.
2015-01-20Small fix in TRPL 3.9Steve Klabnik-3/+3
Multiple people have asked me if this is a reference to Hacker News, and I _certainly_ don't want to give them that impression.
2015-01-20Auto merge of #19353 - icorderi:docs/grammar, r=steveklabnikbors-0/+777
Original [issue](https://github.com/rust-lang/rust/issues/19278) that inspired this patch. The [reference.md] has evolved past simple grammatical constructs, and it serves a different purpose. The intent for the proposed _grammar.md_ is to hold **only** the official reference for the language grammar. This document would keep track of grammatical changes to the language over time, facilitate discussions over proposed changes to the existing grammar, and serve as basis for building parsers by third-parties (IDE's, GitHub linguist, CodeMirror, etc.). The current state of the PR contains all the grammars that were available in [reference.md] and nothing else. There are still a lot of missing pieces that weren't available. The following are just a few of the definitions missing: - [Functions](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#functions) - [Structures](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#structures) - [Traits](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#traits) - [Implementations](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#implementations) - [Operators](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#unary-operator-expressions) - [Statements](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#statements) - [Expressions](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#expressions) [reference.md]: https://github.com/rust-lang/rust/blob/master/src/doc/reference.md We need help from people familiar with those grammatical constructs to fill in the missing pieces.
2015-01-20Forbid coercing &T to &mut TSeo Sanghyeon-5/+35
2015-01-20Auto merge of #21364 - cmr:fix-ttseq-ice, r=alexcrichtonbors-10/+30
Closes #21350
2015-01-20Auto merge of #21304 - lifthrasiir:htmldocck, r=alexcrichtonbors-98/+387
The script is intended as a tool for doing every sort of verifications amenable to Rustdoc's HTML output. For example, link checkers would go to this script. It already parses HTML into a document tree form (with a slight caveat), so future tests can make use of it. As an example, relevant `rustdoc-*` run-make tests have been updated to use `htmldocck.py` and got their `verify.sh` removed. In the future they may go to a dedicated directory with htmldocck running by default. The detailed explanation of test scripts is provided as a docstring of htmldocck. cc #19723
2015-01-20Auto merge of #21287 - alexcrichton:issue-19872, r=huonwbors-5/+11
cc #19872, this may help give some insight
2015-01-20Auto merge of #21257 - alexcrichton:issue-20064, r=pnkfelixbors-13/+71
These two attributes are used to change the entry point into a Rust program, but for now they're being put behind feature gates until we have a chance to think about them a little more. The #[start] attribute specifically may have its signature changed. This is a breaking change to due the usage of these attributes generating errors by default now. If your crate is using these attributes, add this to your crate root: #![feature(start)] // if you're using the #[start] attribute #![feature(main)] // if you're using the #[main] attribute cc #20064
2015-01-19Auto merge of #21165 - alexcrichton:second-pass-type-id, r=aturonbors-108/+105
This commit aims to stabilize the `TypeId` abstraction by moving it out of the `intrinsics` module into the `any` module of the standard library. Specifically, * `TypeId` is now defined at `std::any::TypeId` * `TypeId::hash` has been removed in favor of an implementation of `Hash`. This commit also performs a final pass over the `any` module, confirming the following: * `Any::get_type_id` remains unstable as *usage* of the `Any` trait will likely never require this, and the `Any` trait does not need to be implemented for any other types. As a result, this implementation detail can remain unstable until associated statics are implemented. * `Any::downcast_ref` is now stable * `Any::downcast_mut` is now stable * `BoxAny` remains unstable. While a direct impl on `Box<Any>` is allowed today it does not allow downcasting of trait objects like `Box<Any + Send>` (those returned from `Thread::join`). This is covered by #18737. * `BoxAny::downcast` is now stable.
2015-01-19Auto merge of #19490 - oli-obk:json_non_string_key_maps, r=alexcrichtonbors-91/+201
importing object type string key maps is still supported writing them should be explicit, and can be done as follows ```rust let some_tree_map : TreeMap<String, Json> = ...; Json::Object(some_tree_map).to_writer(&mut writer); ``` related to #8335, #9028, #9142
2015-01-19impl Hash for arraysJorge Aparicio-0/+25
closes #21402 cc #15294
2015-01-19Auto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, ↵bors-26/+87
r=alexcrichton Closes #21033. The new strategy for parsing a field pattern is to look 1 token ahead and if it's a colon, parse as "fieldname: pat", otherwise parse the shorthand form "(box) (ref) (mut) fieldname)". The previous strategy was to parse "(ref) (mut) fieldname" then if we encounter a colon, throw an error if either "ref" or "mut" were encountered.
2015-01-19Auto merge of #20082 - pczarn:btree-bounded-iter, r=Gankrobors-194/+605
Part of collections reform v1, #18424 Also, iteration is simplified: ``` before test btree::map::bench::iter_1000 ... bench: 17177 ns/iter (+/- 6302) test btree::map::bench::iter_100000 ... bench: 1735731 ns/iter (+/- 23908) test btree::map::bench::iter_20 ... bench: 386 ns/iter (+/- 148) after test btree::map::bench::iter_1000 ... bench: 15777 ns/iter (+/- 346) test btree::map::bench::iter_100000 ... bench: 1602604 ns/iter (+/- 73629) test btree::map::bench::iter_20 ... bench: 339 ns/iter (+/- 91) ``` cc @gereeter @cgaebel r? @Gankro
2015-01-19Fixes #21033 with accompanying test.Tom Chittenden-26/+87
2015-01-19Implement range and range_mut for BTreePiotr Czarnecki-194/+605
Simplify BTree's iterators, too.
2015-01-19Add test for #21328Adolfo Ochagavía-1/+13
2015-01-19Auto merge of #21269 - alexcrichton:issue-6936, r=pnkfelixbors-308/+341
This commit modifies resolve to prevent conflicts with typedef names in the same method that conflits are prevented with enum names. This is a breaking change due to the differing semantics in resolve, and any errors generated on behalf of this change require that a conflicting typedef, module, or structure to be renamed so they do not conflict. [breaking-change] Closes #6936
2015-01-19Add a Drain iterator to VecMapAdolfo Ochagavía-6/+55