Commit Graph

67120 Commits

Author SHA1 Message Date
Jimmy Cuadra
27d95d3645 Fix more TryFrom impls for integers. 2017-09-29 14:10:26 -07:00
Jimmy Cuadra
966cf339cb Simplify implementation of From<Infallible> for TryFromIntError. 2017-09-29 14:04:28 -07:00
Jimmy Cuadra
1a29e82227 Remove conflicting TryFrom impls on 32-bit targets. 2017-09-28 23:46:19 -07:00
Jimmy Cuadra
ba74a8665d Add back mistakenly removed numeric conversions. 2017-09-23 17:29:48 -07:00
Jimmy Cuadra
4d2a8c5278 Simplify implementation of Display and Error for convert::Infallible. 2017-09-23 17:27:02 -07:00
Jimmy Cuadra
79f2439aa6 Impl fmt::Display for convert::Infallible. 2017-09-21 21:09:03 -07:00
Jimmy Cuadra
9562981b0b impl std::error::Error for convert::Infallible. 2017-09-21 20:21:54 -07:00
Jimmy Cuadra
5f6de3d402 Derive additional traits for Infallible. 2017-09-18 22:19:00 -07:00
Jimmy Cuadra
93a56cdacd impl From<Infallible> for TryFromIntError. 2017-09-01 01:57:05 -07:00
Jimmy Cuadra
36c0ff8690 Reword docs for Infallible to make them easier to understand. 2017-09-01 00:26:37 -07:00
Jimmy Cuadra
414ee9a254 Remove test case that assumes FromStr provides TryFrom<&'a str>.
See https://travis-ci.org/rust-lang/rust/jobs/269861252
2017-08-30 04:43:09 -07:00
Jimmy Cuadra
b0edfce950 Implement TryFrom explicitly for infallible numeric conversions.
See https://github.com/rust-lang/rust/pull/44174#discussion_r135982787
2017-08-30 04:42:25 -07:00
Jimmy Cuadra
80e3f8941d Add blanket TryFrom impl when From is implemented.
Adds `impl<T, U> TryFrom<T> for U where U: From<T>`.

Removes `impl<'a, T> TryFrom<&'a str> for T where T: FromStr` due to
overlapping impls caused by the new blanket impl. This removal is to
be discussed further on the tracking issue for TryFrom.

Refs #33417.
2017-08-29 22:13:21 -07:00
bors
c11f689d24 Auto merge of #44169 - arielb1:rollup, r=arielb1
Rollup of 12 pull requests

- Successful merges: #43705, #43778, #43918, #44076, #44117, #44121, #44126, #44134, #44135, #44141, #44144, #44158
- Failed merges:
2017-08-29 21:42:34 +00:00
Ariel Ben-Yehuda
be0ac0124c Rollup merge of #44158 - dtolnay:zero48, r=sfackler
Use a byte literal ASCII 0 instead of its decimal value

@SimonSapin noticed this in https://github.com/dtolnay/itoa/pull/8.
2017-08-29 21:41:04 +00:00
Ariel Ben-Yehuda
a88757e0cd Rollup merge of #44144 - alexcrichton:faster-hash-and-sign, r=Mark-Simulacrum
rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes #44140
2017-08-29 21:41:03 +00:00
Ariel Ben-Yehuda
294ce22f76 Rollup merge of #44141 - nrc:rls-preview-beta, r=alexcrichton
Rename the rls component to rls-preview on beta/stable

Background is that we will have automatic renaming with the next rustup release. We'll then rename rls to rls-preview. In the meantime, this ensures beta/stable users will always have rls-preview.

r? @alexcrichton
2017-08-29 21:41:02 +00:00
Ariel Ben-Yehuda
588f83324d Rollup merge of #44135 - GuillaumeGomez:fix-css-links, r=QuietMisdreavus
Fix invalid linker position

Fixes #44120.

Result isn't "optimal" though because there are spaces at the end of some lines.
2017-08-29 21:41:01 +00:00
Ariel Ben-Yehuda
d59aa7d846 Rollup merge of #44134 - vorner:x-py-unknown-cmd, r=nikomatsakis
Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

```
./x.py nonsense
```

This helps in case of chaining multiple runs, eg.:

```
./x.py biuld && ./x.py test
```
2017-08-29 21:41:00 +00:00
Ariel Ben-Yehuda
29f360b179 Rollup merge of #44126 - laumann:config-doc-comments, r=nikomatsakis
compiletest: Change Config comments to doc comments

I plan to make the same change in compiletest-rs, to have some documentation in [the docs](https://docs.rs/compiletest_rs/0.2.9/compiletest_rs/common/struct.Config.html).
2017-08-29 21:40:59 +00:00
Ariel Ben-Yehuda
ec83edabb3 Rollup merge of #44121 - ishitatsuyuki:bootstrap-deps-purge, r=Mark-Simulacrum
bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.
2017-08-29 21:40:58 +00:00
Ariel Ben-Yehuda
30907e1a27 Rollup merge of #44117 - frewsxcv:frewsxcv-to-socket-addrs-examples, r=QuietMisdreavus
Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating https://github.com/rust-lang/rust/issues/22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
2017-08-29 21:40:57 +00:00
Ariel Ben-Yehuda
ba304b96c4 Rollup merge of #44076 - RalfJung:src, r=alexcrichton
include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.
2017-08-29 21:40:56 +00:00
Ariel Ben-Yehuda
b1fff23f60 Rollup merge of #43918 - mystor:rustdoc-pound, r=QuietMisdreavus
Don't highlight # which does not start an attribute in rustdoc

Currently when we highlight some macros for rustdoc (e.g. `quote!` from https://github.com/dtolnay/quote), we get really bad syntax highlighting, because we assume that every token between a `#` character and the next `]` in the source must be an attribute.

This patch improves that highlighting behavior to instead only highlight after finding the `[` token after the `#` token.

(NOTE: I've only run this patch against https://github.com/nrc/rustdoc-highlight so if it doesn't build on travis that's why - I don't have a recent rustc build on this laptop)

I'm guessing r? @steveklabnik
2017-08-29 21:40:55 +00:00
Ariel Ben-Yehuda
64a21f875f Rollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1
Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc https://github.com/rust-lang-nursery/rustfmt/issues/1742).
r? @nrc
2017-08-29 21:40:54 +00:00
Ariel Ben-Yehuda
11e75fd115 Rollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon
libcore: Implement cloned() for Option<&mut T>

None
2017-08-29 21:40:53 +00:00
bors
630e02f25b Auto merge of #43648 - RalfJung:jemalloc-debug, r=alexcrichton
Fix alloc_jemalloc debug feature

At least, I think that's how it should be.  'debug' is how the feature is called in liballoc_jemalloc/Cargo.toml and libstd/Cargo.toml. I verified this by making the build script panic rather than adding `--enable-debug`, and without this PR, the panic does not occur even when I set `debug-jemalloc = true` in config.toml. With the PR, the panic occurs as expected.

However, I actually have no idea what I am doing here.
2017-08-29 17:32:13 +00:00
David Tolnay
4312ed765a
Use a byte literal ASCII 0 instead of its decimal value 2017-08-29 10:01:12 -07:00
Ralf Jung
16fc74c6a2 give up on trying to fix the assertion failure 2017-08-29 16:10:13 +02:00
Ralf Jung
7d9e26f788 Fix alloc_jemalloc debug feature
At least, I think that's how it should be.  'debug' is how the feature is called in Cargo.toml.
2017-08-29 16:10:13 +02:00
bors
faf477a8c2 Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis
feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport

There were several feature-gated attributes for which the feature-not-available
error spans would point to the item annotated with the gated attribute, when it
would make more sense for the span to point to the attribute itself: if the
attribute is removed, the function/struct/_&c._ likely still makes sense and the
program will compile. (Note that we decline to make the analogous change for
the `main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which there is
little hope of using without the gated attribute.)

![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)
2017-08-29 10:22:14 +00:00
bors
6f82dea299 Auto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis
Suggest `Ok(())` when encountering `Result::<(), E>::Ok()`
2017-08-29 06:18:23 +00:00
Alex Crichton
ecd127d23f rustbuild: Fix dependencies of build-manifest
No need to depend on librustc! All we need is libstd

Closes #44140
2017-08-28 18:42:08 -07:00
Nick Cameron
d66f0c2072 Rename the rls component to rls-preview on beta/stable 2017-08-29 13:27:57 +12:00
bors
d2d50691aa Auto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi
std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808
2017-08-29 00:58:17 +00:00
bors
bef07b859d Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakis
clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.

r? @nikomatsakis
2017-08-28 20:42:27 +00:00
Guillaume Gomez
f50bf8636e Fix invalid linker position 2017-08-28 22:40:09 +02:00
bors
9a59d69323 Auto merge of #43076 - Zoxc:gen, r=arielb1
Generator support

This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved.

This is not yet ready to be merged. Things to do:
- [x] Make closure arguments on generators an error
- [x] Spot FIXMEs
- [x] Pass make tidy
- [x] Write tests
- [x] Document the current syntax and semantics for generators somewhere
- [x] Use proper error message numbers
- [x] ~~Make the implicit argument type default to `()`~~
2017-08-28 16:36:03 +00:00
Alex Crichton
b6f554b6dc std: Mark allocation functions as nounwind
This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808
2017-08-28 08:06:52 -07:00
Michael Layzell
2f19383742 Update test issue-41783.rs for new attribute highlighting behaviour 2017-08-28 10:52:49 -04:00
Alex Crichton
a996d5eec7 Tweak rls submodule again 2017-08-28 07:32:25 -07:00
Corey Farwell
10bd39e7af Rewrite std::net::ToSocketAddrs doc examples.
in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios
2017-08-28 09:23:06 -04:00
Oliver Schneider
0b72497307
Suggest Ok(()) when encountering Ok() 2017-08-28 14:13:14 +02:00
Thomas Jespersen
2bffa310a8 compiletest: Change Config comments to doc comments 2017-08-28 13:35:53 +02:00
bors
5caca6fa02 Auto merge of #44114 - daboross:patch-1, r=dtolnay
Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.
2017-08-28 10:42:11 +00:00
Zack M. Davis
8bb29465d0 feature error span on attr. for fn_must_use, SIMD/align, macro reëxport
There were several feature-gated attributes for which the
feature-not-available error spans would point to the item annotated with
the gated attribute, when it would make more sense for the span to point
to the attribute itself: if the attribute is removed, the
function/struct/&c. likely still makes sense and the program will
compile. (Note that we decline to make the analogous change for the
`main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which
there is little hope of using without the gated attribute.)
2017-08-28 00:58:41 -07:00
Alex Crichton
876278f395 Ignore a threaded test on emscripten 2017-08-27 23:37:50 -07:00
bors
a0c3bd2d23 Auto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum
rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
Closes #43295
Closes #42255
Closes #38058
Closes #32176
2017-08-28 06:04:10 +00:00
Alex Crichton
9eff522c6d Update the rls submodule again 2017-08-27 21:01:16 -07:00
Tatsuyuki Ishi
45d31ac2f2 bootstrap: remove unneeded extern crate
The crate itself is internally referenced by serde_derive.
2017-08-28 12:52:02 +09:00