Commit graph

62213 commits

Author SHA1 Message Date
Corey Farwell 6831180ca2 Rollup merge of #40517 - rust-lang:release-notes-tweak, r=alexcrichton
Remove incorrect feature from the 1.16 relnotes

According to @golddranks https://internals.rust-lang.org/t/rust-1-16-0-prerelease-testing/4953/3

r? @brson
2017-03-17 08:49:06 -04:00
Corey Farwell f90fab5b26 Rollup merge of #40514 - stjepang:inline-then-ordering, r=alexcrichton
Inline functions Ordering::{then, then_with}

@jongiddy noticed bad performance due to the lack of inlining on `then`
and `then_with`. I confirmed that inlining really is the culprit by
creating a custom `then` function and repeating his benchmark on my
machine with and without the `#[inline]` attribute.

The numbers were exactly the same on my machine without the attribute.
With `#[inline]` I got the same performance as I did with manually
inlined implementation.

The problem was reported in #37053.
2017-03-17 08:49:05 -04:00
Corey Farwell 1909b62e79 Rollup merge of #40512 - nodakai:patch-1, r=alexcrichton
.gitmodules: use official URLs w/o redirect
2017-03-17 08:49:04 -04:00
Corey Farwell f47a377c6e Rollup merge of #40505 - frewsxcv:hash-docs, r=alexcrichton
A few improvements to the `core::hash` top-level docs.

Primarily opened to address the concerns brought up in
https://github.com/rust-lang/rust/issues/40498.

* run rustfmt on code blocks
* use `DefaultHasher` instead of deprecated `SipHasher`
* rename `hash` to `calculate_hash` to prevent confusion with the `hash`
  method
2017-03-17 08:49:03 -04:00
Corey Farwell d7a09d4e65 Rollup merge of #40503 - swgillespie:thread-hack-removal, r=sfackler
std: remove a workaround for privacy limitations

`std:🧵:Thread` implements a non-exported `NewThread` trait to allow for internal-only use of `Thread::new`. Nowadays we have `pub(crate)`, which accomplishes the same thing but much more idiomatically.

Rustdoc handles this correctly (I checked and I didn't see `Thread::new` on the rustdoc entry for `Thread` with this change), and the stage1 `rustc` emits the correct error still (I'm assuming that the stage1 compiler uses my `libstd`?):

```
$ ./build/x86_64-apple-darwin/stage1/bin/rustc test.rs
error: method `new` is private
 --> test.rs:4:18
  |
4 |     let thread = thread::Thread::new(None);
  |                  ^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
```
2017-03-17 08:49:02 -04:00
Corey Farwell 5aab3b97af Rollup merge of #40500 - estebank:turbofish-help, r=pnkfelix
Point out correct turbofish usage on `Foo<Bar<Baz>>`

Whenever we parse a chain of binary operations, as long as the first
operation is `<` and the subsequent operations are either `>` or `<`,
present the following diagnostic help:

    use `::<...>` instead of `<...>` if you meant to specify type arguments

This will lead to spurious recommendations on situations like
`2 < 3 < 4` but should be clear from context that the help doesn't apply
in that case.

Fixes #40396.
2017-03-17 08:49:01 -04:00
Corey Farwell e389f6a67e Rollup merge of #40499 - ericfindlay:master, r=steveklabnik
Corrected very minor documentation detail about Unicode and Japanese

Japanese half-width and full-width romaji characters do have upper and lowercase according Unicode (but other Japanese characters do not). For example,
` assert_eq!('\u{FF21}'.to_lowercase().collect::<String>(),"\u{FF41}");`

r? @steveklabnik
2017-03-17 08:49:00 -04:00
Corey Farwell 3ebce67ca3 Rollup merge of #40497 - wesleywiser:fix_sidebar, r=GuillaumeGomez
Fix sidebar not extending to the bottom of the page

Fixes #40459
2017-03-17 08:48:59 -04:00
Corey Farwell f9236bdfcc Rollup merge of #40496 - projektir:docs_number_headings, r=frewsxcv
Using X headings #39850

Fix for issue #39850, the headings should now be 1, 2, and 3.
2017-03-17 08:48:58 -04:00
Corey Farwell 4fbd8849d9 Rollup merge of #40495 - llogiq:format-docs, r=steveklabnik
fix format grammar

This is just a trivial change to get the escaped squigglies into the grammar.

r? @steveklabnik
2017-03-17 08:48:57 -04:00
Corey Farwell dcf5f071a3 Rollup merge of #40467 - projektir:readme_docs, r=steveklabnik
Updating README.md to point to the correct doc location
2017-03-17 08:48:56 -04:00
Corey Farwell 127c3ad362 Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=steveklabnik
Remove doc about highlighting code in other languages #40301

This doesn't appear to be true any longer, so removing it to avoid confusion. See #40301

Thoughts:
- may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point;
- does `text` still work?

r? @steveklabnik
2017-03-17 08:48:55 -04:00
Corey Farwell cfca6fccb9 Rollup merge of #40463 - tshepang:nit, r=nikomatsakis
some style fixes
2017-03-17 08:48:54 -04:00
Corey Farwell 695d7ecd05 Rollup merge of #40458 - frewsxcv:frewsxcv-osstr, r=GuillaumeGomez
Add doc examples for `OsStr`, `OsString`.

None
2017-03-17 08:48:53 -04:00
Corey Farwell dee6989b43 Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnik
Update usages of 'OSX' (and other old names) to 'macOS'.

As of last year with version 'Sierra', the Mac operating system is now
called 'macOS'.
2017-03-17 08:48:52 -04:00
Corey Farwell 69717170a4 Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, r=GuillaumeGomez
Remove function invokation parens from documentation links.

This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-17 08:48:51 -04:00
Corey Farwell 739d89aef5 Rollup merge of #40452 - frewsxcv:frewsxcv-unstable-docs, r=GuillaumeGomez
Add basic documentation/examples for six unstable features.
2017-03-17 08:48:50 -04:00
Corey Farwell 01ad185071 Rollup merge of #40433 - mattico:test-issue-29595, r=estebank
Add test for issue #29595

Closes #29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
2017-03-17 08:48:49 -04:00
Corey Farwell 70e7327b4e Rollup merge of #40387 - tbu-:pr_doc_ptr_write2, r=steveklabnik
Reword the non-dropping of `src` for `ptr::write{,_unaligned}`

@niconii Is it OK if I put your wording into the documentation?
CC @nagisa
2017-03-17 08:48:48 -04:00
bors b3234cd427 Auto merge of #40526 - brson:docs-req, r=alexcrichton
Make docs required again

Completely untested. Fixes https://github.com/rust-lang-nursery/rustup.rs/issues/903

r? @alexcrichton cc @steveklabnik
2017-03-17 09:22:09 +00:00
Corey Farwell bc6eecd0c2 Merge branch 'master' into frewsxcv-osstr 2017-03-16 21:56:52 -04:00
bors 0aeb9c1297 Auto merge of #40383 - ishitatsuyuki:easy-dist-analysis, r=alexcrichton
rustbuild: Make save-analysis an option

This makes save-analysis an option independent from the release channel.

The CI build scripts have been modified to enable the flag.

*Merge with caution.* I haven't tested this, and this can cause nightly breakage.
2017-03-15 13:50:13 +00:00
bors 11a33760ec Auto merge of #40212 - SimonSapin:utf8error-resume-from, r=aturon
Add Utf8Error::error_len, to help incremental and/or lossy decoding.

Without this, code outside of the standard library needs to reimplement most of the logic `from_utf8` to interpret the bytes after `valid_up_to()`.
2017-03-15 07:04:20 +00:00
bors 71d7b29475 Auto merge of #40009 - clarcharr:box_to_buf, r=alexcrichton
Leftovers from #39594; From<Box> impls

These are a few more impls that follow the same reasoning as those from #39594.

What's included:
* `From<Box<str>> for String`
* `From<Box<[T]>> for Vec<T>`
* `From<Box<CStr>> for CString`
* `From<Box<OsStr>> for OsString`
* `From<Box<Path>> for PathBuf`
* `Into<Box<str>> for String`
* `Into<Box<[T]>> for Vec<T>`
* `Into<Box<CStr>> for CString`
* `Into<Box<OsStr>> for OsString`
* `Into<Box<Path>> for PathBuf`
* `<Box<CStr>>::into_c_string`
* `<Box<OsStr>>::into_os_string`
* `<Box<Path>>::into_path_buf`
* Tracking issue for latter three methods + three from previous PR.

Currently, the opposite direction isn't doable with `From` (only `Into`) because of the separation between `liballoc` and `libcollections`. I'm holding off on those for a later PR.
2017-03-15 04:24:10 +00:00
Eric Findlay 18a8494485 Ammended minor documentation detail abour Unicode cases. 2017-03-15 10:05:55 +09:00
Brian Anderson 3554ff32db Make docs required again 2017-03-14 19:31:20 +00:00
Esteban Küber e3b8550a60 Point out correct turbofish usage on Foo<Bar<Baz>>
Whenever we parse a chain of binary operations, as long as the first
operation is `<` and the subsequent operations are either `>` or `<`,
present the following diagnostic help:

    use `::<...>` instead of `<...>` if you meant to specify type arguments

This will lead to spurious recommendations on situations like
`2 < 3 < 4` but should be clear from context that the help doesn't apply
in that case.
2017-03-14 12:09:21 -07:00
Steve Klabnik cc08edc854 Remove incorrect feature from the 1.16 relnotes 2017-03-14 11:16:34 -04:00
Corey Farwell 6adbbfc6ba Add doc example for OsString::into_boxed_os_str. 2017-03-14 09:30:18 -04:00
Corey Farwell bda57dbc05 Add doc example for OsString::shrink_to_fit. 2017-03-14 09:30:00 -04:00
Corey Farwell 5537955b17 Add doc example for OsString::reserve_exact. 2017-03-14 09:29:38 -04:00
Corey Farwell 4d57d92f07 Add doc example for OsString::reserve. 2017-03-14 09:29:09 -04:00
Corey Farwell 9a7b789c37 Add doc example for OsStr::to_os_string. 2017-03-14 09:28:30 -04:00
Stjepan Glavina 8af30132f1 Inline functions Ordering::{then, then_with}
@jongiddy noticed bad performance due to the lack of inlining on `then`
and `then_with`. I confirmed that inlining really is the culprit by
creating a custom `then` function and repeating his benchmark on my
machine with and without the `#[inline]` attribute.

The numbers were exactly the same on my machine without the attribute.
With `#[inline]` I got the same performance as I did with manually
inlined implementation.
2017-03-14 14:01:01 +01:00
NODA, Kai 0671cc10f0 .gitmodules: use official URLs w/o redirect 2017-03-14 20:52:01 +08:00
bors 6f10e2f63d Auto merge of #39921 - cramertj:add-catch-to-ast, r=nikomatsakis
Add catch {} to AST

Part of #39849. Builds on #39864.
2017-03-14 10:40:09 +00:00
Simon Sapin 73370c543e Add tracking issue number for Utf8Error::error_len 2017-03-14 10:03:08 +01:00
Simon Sapin b5f16a10e9 Replace Utf8Error::resume_from with Utf8Error::error_len
Their relationship is:

* `resume_from = error_len.map(|l| l + valid_up_to)`
* error_len is always one of None, Some(1), Some(2), or Some(3).

When I started using resume_from I almost always ended up subtracting
valid_up_to to obtain error_len.
Therefore the latter is what should be provided in the first place.
2017-03-14 10:02:55 +01:00
Simon Sapin 182044248c Add Utf8Error::resume_from, to help incremental and/or lossy decoding.
Without this, code outside of the standard library needs to reimplement
most of the logic `from_utf8` to interpret the bytes after `valid_up_to()`.
2017-03-14 10:02:45 +01:00
bors fa53235cc4 Auto merge of #40488 - alexcrichton:appveyor-debug, r=brson
appveyor: Turn down sccache logging

Let's not have it be quite so verbose
2017-03-14 07:18:39 +00:00
Corey Farwell 5cc056a744 A few improvements to the core::hash top-level docs.
Primarily opened to address the concerns brought up in
https://github.com/rust-lang/rust/issues/40498.

* run rustfmt on code blocks
* use `DefaultHasher` instead of deprecated `SipHasher`
* rename `hash` to `calculate_hash` to prevent confusion with the `hash`
  method
2017-03-14 00:42:44 -04:00
Corey Farwell e7b0f2badf Remove function invokation parens from documentation links.
This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13 21:43:18 -04:00
Sean Gillespie 1545f4e2a3 std: remove a workaround for privacy limitations that isn't necessary anymore 2017-03-13 18:42:23 -07:00
Corey Farwell d3ae2eb58e Rust unstable book: basic desc and example for concat_idents. 2017-03-13 21:39:19 -04:00
Corey Farwell e58e3d0bc0 Rust unstable book: basic desc and example for non_ascii_idents. 2017-03-13 21:38:46 -04:00
Corey Farwell 137c1e8121 Rust unstable book: basic desc and example for i128_type. 2017-03-13 21:38:44 -04:00
Corey Farwell 0dd03ffaf7 Rust unstable book: basic desc and example for const_indexing. 2017-03-13 21:38:24 -04:00
Corey Farwell 327e8e9196 Rust unstable book: basic desc and example for conservative_impl_trait. 2017-03-13 21:38:07 -04:00
Corey Farwell e06c51553d Rust unstable book: basic desc and example for const_fn. 2017-03-13 21:35:52 -04:00
Eric Findlay 5b7f330588 Corrected very minor documentation detail about Unicode and Japanese 2017-03-14 10:21:26 +09:00