Commit Graph

100248 Commits

Author SHA1 Message Date
Esteban Küber
acd6540a74 Tweak wording 2019-10-09 10:17:29 -07:00
Esteban Küber
6d6d978baa Note when a mutable trait object is needed 2019-10-09 10:17:29 -07: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
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
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
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
Niko Matsakis
08c0e841a7 add debug! to evaluate_obligation 2019-10-07 11:00:09 -04:00
Niko Matsakis
1dba4b0117 fix ICE from debug output by using kind_ty in dumping closure
Also, make `-Zverbose` dump all info about constants.
2019-10-07 10:59:46 -04:00
Niko Matsakis
bec0902535 avoid ICE when extracting closure-kind-ty from a canonicalized value
In such a case, the `Infer` is converted to a `Bound`
2019-10-07 10:59:13 -04:00
Niko Matsakis
0b58d9d124 correct bug in the "has escaping regions" visitor
Existing code could overlook types/substitutions that are
embedded in (e.g.) an unevaluated constant.
2019-10-07 10:58:37 -04:00
Niko Matsakis
25d04f83e3 make type-flags exhaustive
Didn't find any bugs here, but you really don't want these to fall out
of sync.
2019-10-07 10:57:44 -04:00
bors
59a31c8c67 Auto merge of #64780 - choller:master, r=michaelwoerister
Only add sanitizer runtimes when linking an executable (#64629).

This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled `mozilla-central` with ASan using this patch.
2019-10-07 13:23:00 +00:00
bors
e3cb9ea15a Auto merge of #65178 - Centril:rollup-ep1zztj, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #63948 (Add feature gate for raw_dylib.)
 - #65137 (remove event that causes panics in measureme tools)
 - #65164 (Add long error explanation for E0566)
 - #65173 (Update reference)

Failed merges:

r? @ghost
2019-10-07 09:21:30 +00:00
Guillaume Gomez
8dd00088c1 Update ui tests 2019-10-07 11:20:10 +02:00
Guillaume Gomez
4bf7eea897 Add long error explanation for E0561 2019-10-07 11:20:10 +02:00
Mazdak Farrokhzad
68a4cfc242
Rollup merge of #65173 - tmandry:reffy-ref, r=tmandry
Update reference

- Add macros in extern blocks and new proc-macro support.
- Update for "modern" `meta` matcher.
- Update await desugaring after rust-lang/rust#64292
2019-10-07 10:36:49 +02:00
Mazdak Farrokhzad
4db77a4c58
Rollup merge of #65164 - GuillaumeGomez:long-err-explanation-E0566, r=estebank
Add long error explanation for E0566

Part of #61137.
2019-10-07 10:36:48 +02:00
Mazdak Farrokhzad
3a1f8dfeb8
Rollup merge of #65137 - andjo403:selfProfiling_fix, r=michaelwoerister
remove event that causes panics in measureme tools

the measureme tools summarize and crox do not alow a event to go out of scope of the parent event

codegen_and_optimize_crate ends after the codegen_crate event

r? @wesleywiser
cc @michaelwoerister @Mark-Simulacrum
2019-10-07 10:36:46 +02:00
Mazdak Farrokhzad
0c96a12909
Rollup merge of #63948 - crlf0710:path_to_raw_dylib, r=Centril
Add feature gate for raw_dylib.

This PR adds the feature gate for RFC 2627 (https://github.com/rust-lang/rust/issues/58713). It doesn't contain the actual functionality.
Add I'm not sure whether i did it correctly, since this is the first time i did this.

r? @Centril
2019-10-07 10:36:45 +02:00
ben
74eac929c2 Test diagnostic output of type mismatches for types that have const
generics arguments.
2019-10-07 20:39:08 +13:00
Charles Lew
2dab187024 Fix compilation error after rebase. 2019-10-07 14:33:49 +08:00
bors
f92f3c4bc6 Auto merge of #64739 - guanqun:remove-as-str, r=estebank
Remove as_str if the type is already &str

Fix https://github.com/rust-lang/rust/issues/62642

r? @estebank

do you think the suggestion tip is good enough?
2019-10-07 05:35:17 +00:00
Mazdak Farrokhzad
6b23c22cca syntax: refactor with new fn parse_use_tree_glob_or_nested. 2019-10-07 06:47:24 +02:00
Mazdak Farrokhzad
9c6582a2c0 syntax: use parse_extern_abi more. 2019-10-07 06:18:47 +02:00
Charles Lew
dda10f2a2a Add more tests, fix span issue, improve diagnostics. 2019-10-07 12:01:57 +08:00
Charles Lew
eb492455f2 Address review comments. 2019-10-07 12:01:56 +08:00
Charles Lew
3462b58f21 Add support for parsing #[link_ordinal] attribute. 2019-10-07 12:01:55 +08:00
Charles Lew
e70ffed9cd Add feature gate for raw_dylib. 2019-10-07 12:01:54 +08:00
Mazdak Farrokhzad
a7ba754b6c syntax: unify and simplify fn signature parsing. 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
7f9638d5d4 syntax: unify trait parsing a bit. 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
090f3fd0c9 syntax: further item parsing cleanup 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
3bdbfbe8b9 syntax: de-dups in item parsing. 2019-10-07 05:59:56 +02:00
Mazdak Farrokhzad
e0fe4be465 syntax: cleanup associated const parsing. 2019-10-07 05:59:56 +02:00
bors
4ac4809ccf Auto merge of #64906 - Aaron1011:feature/extern-const-fn, r=Centril
Add support for `const unsafe? extern fn`

This works just as you might expect - an `const extern fn` is a `const fn` that is callable from foreign code.

Currently, panicking is not allowed in `const`s. When https://github.com/rust-lang/rfcs/pull/2345 (https://github.com/rust-lang/rust/issues/51999) is stabilized, then panicking in an `const extern fn` will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime.

Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary.

This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.

Tracking issue: https://github.com/rust-lang/rust/issues/64926.
2019-10-07 00:12:12 +00:00
Tyler Mandry
8baf7bf33d Update reference
- 771c5d10cf944bf7d221f5d6cb7abd2a06c400e4 Add macros in extern blocks and new proc-macro support.
- 8caabd62ef5fbe99e6be6aa9e76f55bbb8433d95 Update for "modern" `meta` matcher.
- 1b44947d36ccf7eba2b3bd245769eff68abf6d4d Update await desugaring after rust-lang/rust#64292
2019-10-06 14:45:02 -07:00