Commit Graph

62383 Commits

Author SHA1 Message Date
Tim Neumann
222ca3c4a5 clang-format 2017-03-16 21:03:22 +01:00
Tim Neumann
449219ab2b isolate llvm 4.0 code path 2017-03-16 21:01:05 +01:00
David Renshaw
e9c07cfc0e fix typo in mir TerminatorKind docs 2017-03-16 11:30:06 -04:00
topecongiro
910532ed5e Add a test for issue 34571 2017-03-17 00:21:40 +09:00
Alex Crichton
ec829fe00e travis: Update sccache binary
I've built a local copy with mozilla/sccache#79 and mozilla/sccache#78. Let's
see if that helps #40240!
2017-03-16 07:55:15 -07:00
Taylor Cramer
28626ca5b1 Stabilize pub(restricted) 2017-03-15 22:39:04 -07:00
Clar Charr
a5cf55125c Implement Error for !. 2017-03-15 23:09:29 -04:00
Guillaume Gomez
9b892745ad Fix const not displayed in rustdoc 2017-03-16 02:15:10 +01:00
Matt Brubeck
befeb04370 Remove unused param from bootstrap::clean::rm_rf 2017-03-15 16:32:30 -07:00
Jeffrey Seyfried
ce616a7d6a Improve the TokenStream quoter. 2017-03-15 23:05:02 +00:00
Clar Charr
0739ecec61 Removes Default for Box<Path>. 2017-03-15 11:36:13 -04:00
Kevin Mehall
e66b3a20c8 Fix documentation for Vec::dedup_by.
The previous docstring was copied from dedup_by_key.
2017-03-15 07:56:33 -07:00
Jimmy Cuadra
2561dcddf9 Rename TryFrom's associated type and implement str::parse using TryFrom.
Per discussion on the tracking issue, naming `TryFrom`'s associated type
`Error` is generally more consistent with similar traits in the Rust
ecosystem, and what people seem to assume it should be called. It
also helps disambiguate from `Result::Err`, the most common "Err".

See
https://github.com/rust-lang/rust/issues/33417#issuecomment-269108968.

TryFrom<&str> and FromStr are equivalent, so have the latter provide the
former to ensure that. Using TryFrom in the implementation of
`str::parse` means types that implement either trait can use it.
When we're ready to stabilize `TryFrom`, we should update `FromStr` to
suggest implementing `TryFrom<&str>` instead for new code.

See
https://github.com/rust-lang/rust/issues/33417#issuecomment-277175994
and
https://github.com/rust-lang/rust/issues/33417#issuecomment-277253827.

Refs #33417.
2017-03-15 07:51:54 -07:00
Piotr Jawniak
8065486283 Change how the 0 flag works in format! for floats
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`.

               :06      :<06     :>06     :^06
    before   |-001.2| |-1.200| |-001.2| |-01.20|
    after    |-001.2| |-001.2| |-001.2| |-001.2|
2017-03-15 07:50:44 -07:00
Piotr Jawniak
ff63866edb Change how the 0 flag works in format!
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits.

           :05     :<05    :>05    :^05
before   |-0001| |-1000| |-0001| |-0100|
after    |-0001| |-0001| |-0001| |-0001|
          :#05x   :<#05x  :>#05x  :^#05x
before   |0x001| |0x100| |000x1| |0x010|
after    |0x001| |0x001| |0x001| |0x001|

Fixes #39997 [breaking-change]
2017-03-15 07:50:44 -07:00
Alex Crichton
5de04060ba rustbuild: Retry downloads of OpenSSL source
We need this to compile Cargo and we download it at build time, but as like all
other network requests it has a chance of failing. This commit moves the source
of the tarball to a mirror (S3 seems semi-more-reliable most of the time) and
also wraps the download in a retry loop.

cc #40474
2017-03-15 07:13:59 -07: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
Nick Cameron
dc63eff86c Move to using 0.1 versions of crates, rather than GH links
Also adds a fixme and does cargo update
2017-03-15 21:21:20 +13:00
Nick Cameron
2a3663f606 Handle feature=rustbuild
Taken from https://github.com/rust-lang/rust/pull/40347/files

And update rls-span to a version with the rustbuild boilerplate
2017-03-15 21:21:20 +13:00
Nick Cameron
979a9881ea Move the API json dumper to use rls-data too 2017-03-15 21:21:20 +13:00
Nick Cameron
bf07f1c6bb Add rls-span to do some conversions into rls-data.
And fix some warnings and borrow errors
2017-03-15 21:21:20 +13:00
Nick Cameron
83f84ff1bc Use out-of-tree rustc serialize
And remove a few data structures in favour of rls-data ones
2017-03-15 21:21:20 +13:00
Nick Cameron
a77e52875b Change json dumper (and a few other bits and pieces) to use rls-data rather than its own data structures 2017-03-15 21:21:20 +13:00
Nick Cameron
fee1f64434 save-analysis: depend on the rls-data crate 2017-03-15 21:21:19 +13: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
Tim Neumann
cc23d17ce9 make shift builtins panic-free with new unchecked_sh* intrinsics
Also update some 128 bit builtins to be panic-free without relying
on the const evaluator.
2017-03-15 06:59:09 +01: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
steveklabnik
8b7c7f3fa5 Link core::slice to std::slice 2017-03-14 13:42:12 -04:00
Peter Wagenet
61d93877b7 Target builds for older macOS 2017-03-14 10:08:29 -07:00
Steve Klabnik
cc08edc854 Remove incorrect feature from the 1.16 relnotes 2017-03-14 11:16:34 -04:00
Tobias Schottdorf
f06b04949f Improve the documentation for rvalue_static_promotion 2017-03-14 11:06:50 -04:00
Tobias Schottdorf
20c0f323fc Use && instead of &
It does not seem valuable to always evaluate the right-hand side here.
2017-03-14 11:06:50 -04:00
Tobias Schottdorf
b43c744318 Add feature toggle for rvalue-static-promotion RFC
See https://github.com/rust-lang/rfcs/pull/1414.

Updates #38865.
2017-03-14 11:06:50 -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
Alex Crichton
5fab9bf4f6 travis: Ensure cargo links libcurl statically
We don't want a dynamic dependency in the library that we ship, so link it
statically by configuring curl-sys's build script to not pick up the system
version via pkg-config.
2017-03-13 22:13:37 -07: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