Commit Graph

100517 Commits

Author SHA1 Message Date
Konrad Borowski
58089717b9
Add ?Sized bound to a supertrait listing in E0038 error documentation
This example failed to compile because of implicit `Sized` bound
for `A` parameter that wasn't required by `Trait`.
2019-10-08 12:19:00 +02:00
bors
ec557aa818 Auto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavis
Avoid `SmallVec::collect`

We can get sizeable speed-ups by avoiding `SmallVec::collect` when the number of elements is small.
2019-10-08 08:08:21 +00:00
Nicholas Nethercote
75e0078a17 Optimize TokenStreamBuilder::push.
Currently, when two tokens must be glued together, this function duplicates
large chunks of the existing streams. This can cause quadratic behaviour.

This commit changes the function so that it overwrites the last token with a
glued token, which avoids the quadratic behaviour. This removes the need for
`TokenStreamBuilder::push_all_but_{first,last}_tree`.

The commit also restructures `push` somewhat, by removing
`TokenStream::{first_tree_and_joint,last_tree_if_joint}` in favour of more
pattern matching and some comments. This makes the code shorter, and in my
opinion, more readable.
2019-10-08 16:57:29 +11:00
Nicholas Nethercote
3832a634d3 Optimize TokenStream::from_streams.
Currently, this function creates a new empty stream, and then appends
the elements from each given stream onto that stream. This can cause
quadratic behaviour.

This commit changes the function so that it modifies the first stream
(which can be long) by extending it with the elements from the
subsequent streams (which are almost always short), which avoids the
quadratic behaviour.
2019-10-08 16:57:07 +11:00
Nicholas Nethercote
1b41f958c5 Remove InferCtxt::in_snapshot().
It's the same as `InferCtxt::commit_unconditionally()` except that it
is passed a snapshot and has a worse name.

The commit also changes `commit_unconditionally()` to receive a
snapshot, for consistency with `commit_if_ok()` and `probe()`.
2019-10-08 16:05:51 +11:00
Nicholas Nethercote
3f9aea199c Clarify a comment in RegionConstraintCollector::leak_check. 2019-10-08 16:04:41 +11:00
bors
1e1f25e31b Auto merge of #65196 - Centril:rollup-q06lcxm, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #64726 (rewrite documentation for unimplemented! to clarify use)
 - #65040 (syntax: more cleanups in item and function signature parsing)
 - #65046 (Make `Cell::new` method come first in documentation)
 - #65098 (Add long error explanation for E0561)
 - #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
 - #65154 (Fix const generic arguments not displaying in types mismatch diagnostic)
 - #65181 (fix bug in folding for constants)
 - #65187 (use 'invalid argument' for vxWorks)

Failed merges:

 - #65179 (Add long error explanation for E0567)

r? @ghost
2019-10-08 04:35:03 +00:00
Mazdak Farrokhzad
bc7df81642
Rollup merge of #65187 - Wind-River:master_before_merge, r=rkruppe
use 'invalid argument' for vxWorks

vxWorks is using "invalid argument" instead of "Invalid argument" in reporting invalid options

r? @rkruppe
2019-10-08 05:02:44 +02:00
Mazdak Farrokhzad
f23c9f4565
Rollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkor
fix bug in folding for constants

These was a bug in the folding for constants that caused it to overlook bound regions. This branch includes some other little things that I did while trying to track the bug down.

r? @oli-obk
2019-10-08 05:02:43 +02:00
Mazdak Farrokhzad
ecdb5e98cb
Rollup merge of #65154 - skinny121:const-arg-diagnostic, r=varkor
Fix const generic arguments not displaying in types mismatch diagnostic

Fixes #61395
2019-10-08 05:02:41 +02:00
Mazdak Farrokhzad
5422ed7834
Rollup merge of #65150 - XiangQingW:master, r=estebank
Suggest dereferencing boolean reference when used in 'if' or 'while'

Implements #64557
2019-10-08 05:02:39 +02:00
Mazdak Farrokhzad
73685ec56f
Rollup merge of #65098 - GuillaumeGomez:long-err-explanation-E0561, r=Centril
Add long error explanation for E0561

Part of #61137
2019-10-08 05:02:38 +02:00
Mazdak Farrokhzad
a9777b3061
Rollup merge of #65046 - sinkuu:cell_reorder, r=shepmaster
Make `Cell::new` method come first in documentation

Methods to create a thing usually comes first in `std` documentation, and `Cell` has been an exception. Also, `T: Copy` specialized methods should not be on top of the page. (This had led me to miss that most of its methods are not bounded by `Copy`...)
2019-10-08 05:02:36 +02:00
Mazdak Farrokhzad
4737095416
Rollup merge of #65040 - Centril:items-cleanup, r=estebank
syntax: more cleanups in item and function signature parsing

Follow up to https://github.com/rust-lang/rust/pull/64910.

Best read commit-by-commit.

r? @estebank
2019-10-08 05:02:35 +02:00
Mazdak Farrokhzad
2f0618d8c6
Rollup merge of #64726 - andrewbanchich:unimplemented, r=rkruppe
rewrite documentation for unimplemented! to clarify use

The current docs for `unimplemented!` seem to miss the point of this macro.

> This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.

You could also return a `()` if you just want your code to type-check.

I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area.

I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.
2019-10-08 05:02:33 +02:00
bors
d304f5c1ff Auto merge of #65186 - mati865:cargoup, r=alexcrichton
Update Cargo

To pull rust-lang/cargo#7482

List of merged PRs:
- Fix wrong directories in PATH on Windows (rust-lang/cargo#7482)
- Update SPDX list to 3.6 (rust-lang/cargo#7481)
- Mark Emscripten's .wasm files auxiliary (rust-lang/cargo#7476)
- Update `curl-sys` dependency requirement (rust-lang/cargo#7464)
- add dependencies for `pkg-config` (rust-lang/cargo#7443)
- Removing hash from output files when using MSVC (rust-lang/cargo#7400)
- Disable preserving mtimes on archives (rust-lang/cargo#7465)
- Removed redundant borrow (rust-lang/cargo#7462)
- Public dependency refactor and re-allow backjumping (rust-lang/cargo#7361)
- unify the quote in Cargo.toml (rust-lang/cargo#7461)
2019-10-08 01:05:08 +00:00
Mark Rousskov
e068cec13e Warn if include macro fails to include entire file 2019-10-07 19:47:53 -04:00
Esteban Küber
5aa37a9c9b Use structured suggestion for removal of as_str() call 2019-10-07 16:18:02 -07:00
Josh Stone
d305254099 Add rustc-dev to nightly default and complete profiles 2019-10-07 15:49:51 -07:00
bors
c20654ebc3 Auto merge of #64358 - cuviper:rustc-rayon-1.2, r=nikomatsakis
Rebase rustc-rayon on rayon-1.2

See also https://github.com/rust-lang/rustc-rayon/pull/3
2019-10-07 21:24:29 +00:00
varkor
c99074490b Add a regression test for #57271 2019-10-07 22:24:04 +01:00
varkor
85b7aa2cfb Add a regression test for #57399 2019-10-07 22:10:50 +01:00
varkor
4eba21e4c7 Add regression test for #64792 2019-10-07 22:06:14 +01:00
varkor
2328a7ea40 Move stray issue tests into src/test/ui/issues 2019-10-07 22:05:56 +01:00
varkor
5e65e2bec2 Add a regression test for issue 62187 2019-10-07 22:01:58 +01:00
varkor
70c14dd9dd Move const generic regression tests to their old folder 2019-10-07 21:55:35 +01:00
Josh Stone
2dcf2f0f7b Only install rustc-dev by default on nightly 2019-10-07 13:48:16 -07:00
Josh Stone
bd4e9d5fe1 add rustc-dev to tools/build-manifest 2019-10-07 13:48:16 -07:00
Josh Stone
9175f279b5 add dist::RustcDev for unstable compiler libraries 2019-10-07 13:48:16 -07:00
Josh Stone
dc8ee51c54 Use builder.compiler_for() to find the libstd stamp 2019-10-07 13:48:16 -07:00
Josh Stone
faee5fd388 [WIP] minimize the rust-std component 2019-10-07 13:48:16 -07:00
Josh Stone
29cd7eb6c9 Update other rayon uses to 1.2 too 2019-10-07 13:44:30 -07:00
Josh Stone
98779ed097 add crossbeam-queue to the whitelist 2019-10-07 13:43:10 -07:00
Josh Stone
fa2acbe0d6 Name the threads in rayon's pool 2019-10-07 13:20:17 -07:00
Josh Stone
33c4125fbe Rebase rustc-rayon on rayon-1.2
See also https://github.com/rust-lang/rustc-rayon/pull/3
2019-10-07 13:20:17 -07:00
BaoshanPang
45f7186de3 use 'invalid argument' for vxWorks 2019-10-07 11:52:30 -07:00
Mateusz Mikuła
9c15c66880 Update Cargo 2019-10-07 20:33:13 +02:00
bors
f3c9cece7b Auto merge of #61430 - matthewjasper:drop-on-into-panic, r=oli-obk
Make `into` schedule drop for the destination

closes #47949
2019-10-07 17:47:10 +00:00
Guillaume Gomez
96efaad342 update ui tests 2019-10-07 17:12:54 +02:00
Guillaume Gomez
28b0e1db50 Add long error explanation for E0495 2019-10-07 17:12:54 +02:00
Adam Perry
cca58d1321 Fix syntax typo in error message. 2019-10-07 08:05:33 -07:00
Adam Perry
c49966bb1b Clarify variable names when checking track_caller methods. 2019-10-07 08:05:33 -07:00
Adam Perry
190212c6bf Prohibit #[track_caller] within trait impls as well as decls. 2019-10-07 08:05:33 -07:00
Adam Perry
f70ed29fbd Update expected error output. 2019-10-07 08:05:33 -07:00
Adam Perry
130be6d4b8 Expand E0738 to cover different cases. 2019-10-07 08:05:33 -07:00
Adam Perry
bdc4bd142b E073[6-8] include failing code examples. 2019-10-07 08:05:33 -07:00
Adam Perry
8992c30db4 E0735 -> E0739
Prevents number collision with another approved PR.
2019-10-07 08:05:33 -07:00
Adam Perry
53096c575d track_caller tests account for incomplete feature warning. 2019-10-07 08:05:33 -07:00
Adam Perry
9900211ea0 track_caller error numbers and text. 2019-10-07 08:05:33 -07:00
Adam Perry
d931afe470 Mark #![feature(track_caller)] as incomplete. 2019-10-07 08:05:32 -07:00