100607 Commits

Author SHA1 Message Date
Tyler Mandry
976a57a4af
Rollup merge of #65283 - petrochenkov:softstab2, r=estebank
stability: Do not use `buffer_lint` after lowering to HIR

Fixes https://github.com/rust-lang/rust/issues/65253
2019-10-11 15:09:57 -07:00
Tyler Mandry
60482be070
Rollup merge of #65277 - csmoe:fix-move, r=estebank
Query generator kind for error reporting

Fixes https://github.com/rust-lang/rust/pull/65166#discussion_r333114545
r? @estebank
cc @cramertj
2019-10-11 15:09:56 -07:00
Tyler Mandry
9917f062a9
Rollup merge of #65276 - varkor:toolstate-no-ping, r=Mark-Simulacrum
Don't cc rust-lang/compiler for toolstate changes

Fixes https://github.com/rust-lang/rust/issues/65238.
2019-10-11 15:09:54 -07:00
Tyler Mandry
48051e4a79
Rollup merge of #65266 - rust-lang:must-use-join, r=dtolnay
Mark Path::join as must_use

I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
2019-10-11 15:09:53 -07:00
Tyler Mandry
e4eb54dae8
Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=Centril
Deduplicate is_{freeze,copy,sized}_raw

Fixes #65259

Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
2019-10-11 15:09:51 -07:00
Tyler Mandry
2403c37ede
Rollup merge of #65220 - tlively:update-llvm-for-emscripten-exceptions, r=nikic
Update LLVM for Emscripten exception handling support

Updates LLVM to pick up the cherry-picked support for correctly
handling exception handling with aggregates passed by value. This will
be necessary to continue to support Emscripten's exception handling
once we switch using Emscripten's LLVM backend. See #63649.
2019-10-11 15:09:50 -07:00
Tyler Mandry
7a2bb04eb5
Rollup merge of #65205 - GuillaumeGomez:long-err-explanation-E0568, r=estebank
Add long error explanation for E0568

Part of #61137.
2019-10-11 15:09:48 -07:00
Tyler Mandry
6687edcbef
Rollup merge of #65200 - xfix:patch-20, r=GuillaumeGomez
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-11 15:09:47 -07:00
Tyler Mandry
728adc446c
Rollup merge of #65191 - varkor:const-generics-test-cases, r=nikomatsakis
Add some regression tests

- Add a test for #62187.
- Clean up the directory structure in `src/test/ui/const-generics`
- Closes #64792.
- Closes #57399.
- Closes #57271.
2019-10-11 15:09:45 -07:00
Tyler Mandry
ec1d008f65
Rollup merge of #65048 - Kixunil:patch-1, r=KodrAus
Added doc about behavior of extend on HashMap

It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
2019-10-11 15:09:44 -07:00
Tyler Mandry
ea0d155f2d
Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor
Function pointers as const generic arguments

Makes function pointers as const generic arguments usable.

Fixes #62395

r? @varkor
2019-10-11 15:09:42 -07:00
Tyler Mandry
215b09194f
Rollup merge of #64337 - rick68:patch-17, r=Dylan-DPC
libstd: Fix typos in doc
2019-10-11 15:09:41 -07:00
Mark Rousskov
000fe63b6f Remove painful test that is not pulling its weight
Research suggests that we are not properly testing this case anyway, and
even if we were, it is unlikely that we will regress here -- or, perhaps
more accurately, if we do, I am uncertain that we care too much. It
definitely seems like an edge case, and one that is particularly
unlikely to occur as time goes on.
2019-10-11 17:41:55 -04:00
memoryruins
95a65cd1e3 Add regression test for CONST_ERR lints in extern macros 2019-10-11 17:13:38 -04:00
memoryruins
05db5a2698 Report lint in external macros 2019-10-11 16:36:50 -04:00
Dan Aloni
9d11bda8dd resolve: shorten wording on private constructor error 2019-10-11 22:18:07 +03:00
bors
6767d9b90b Auto merge of #64877 - lzutao:stabilize-repeat_generic_slice, r=SimonSapin
Stabilize `slice::repeat` (feature `repeat_generic_slice`)

Closes #48784
r? @SimonSapin
2019-10-11 18:03:20 +00:00
Trevor Spiteri
57aae75ce3 improve performance of signed saturating_mul
Reciprocal throughput is improved from 2.3 to 1.7.
https://godbolt.org/z/ROMiX6
2019-10-11 17:13:19 +02:00
Dan Aloni
7140c024c2 resolve: fix error title regarding private constructors
The constructor is private, not the type.

Idea credit to @petrochenkov, discussed at #65153
2019-10-11 18:09:23 +03:00
Adam Perry
2d5ef8f9ff Clarify comment about purpose of ReifyShim. 2019-10-11 07:45:59 -07:00
Adam Perry
d92cef7473 resolve_for_fn_ptr checks that the instance is an Item before returning shim. 2019-10-11 07:44:01 -07:00
Dan Aloni
e285175b63 test: extend derive_on_deprecated to include more derivations 2019-10-11 16:38:54 +03:00
Dan Aloni
a32aec021e deriving: avoid dummy Span on an artificial type_ident path
The dummy Span pointed to the beginning of the source file instead to
where the `#[derive]` is located. Later, it tripped the
`in_derive_expansion(span)` check at `src/librustc/middle/stability.rs`,
causing a span-less deprecation warning to be emitted.

Fixes #56195, #55417.
2019-10-11 16:38:47 +03:00
Ralf Jung
028f53e38e emcscripten: ignore another thread-using test 2019-10-11 14:58:05 +02:00
bors
d4f7f974b8 Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapin
Stabilize mem::take (mem_take)

Tracking issue: https://github.com/rust-lang/rust/issues/61129

r? @matklad
2019-10-11 12:45:20 +00:00
Ralf Jung
63d67fa273 ignore-emcscripten as it does not support threads 2019-10-11 09:57:44 +02:00
Yuki Okushi
2ae5e3421d Print lifetimes with backticks 2019-10-11 16:08:53 +09:00
Charles Gleason
d21eeb110c Override nth for VecDeque Iter and IterMut 2019-10-10 22:49:21 -04:00
Charles Gleason
10671f10c3 Add tests for VecDeque clone_from 2019-10-10 22:49:20 -04:00
Charles Gleason
91cf02cfa7 Implement Clone::clone_from for VecDeque 2019-10-10 22:49:17 -04:00
Esteban Küber
5bb0a03fa7 Move diagnostics code out of the critical path 2019-10-10 19:34:56 -07:00
varkor
c97d71538a Fix issue 65284 2019-10-11 00:51:36 +01:00
bors
000d90b11f Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum
minimize the rust-std component

This changes the `rust-std` dist component to only include the artifacts of compiling the `libstd` step, as listed in `.libstd.stamp`. This does include `test` and `proc-macro` as well. The remaining _unstable_ libraries that are built as part of `rustc` are packaged into a new `rustc-dev` component, intended for use in the development of closely related tools (clippy, miri, rls).

Here are the component sizes from the [try build](https://dev-static.rust-lang.org/dist/2019-10-07/index.html):

| Name | Size
| --- | ---
| rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz | 23.94 MiB
| rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | 17.4 MiB
| rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.gz | 182.03 MiB
| rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | 157.91 MiB

Fixes #61978
Fixes #62486
2019-10-10 23:43:55 +00:00
Yuki Okushi
e0ef7767ca Add long error explanation for E0697 2019-10-11 08:23:33 +09:00
Vadim Petrochenkov
ceb4c3fa30 stability: Do not use buffer_lint after lowering to HIR 2019-10-10 23:38:35 +03:00
bors
898f36c83c Auto merge of #65153 - da-x:issue-58017, r=petrochenkov
Improve message when attempting to instantiate tuple structs with private fields

Fixes #58017, fixes #39703.

```
error[E0603]: tuple struct `Error` is private
  --> main.rs:22:16
   |
2  |     pub struct Error(usize, pub usize, usize);
   |                      -----             ----- field is private
   |                      |
   |                      field is private
...
22 |     let x = a::Error(3, 1, 2);
   |                ^^^^^
   |
   = note: a tuple struct constructor is private if any of its fields is private
```
2019-10-10 19:40:48 +00:00
csmoe
9f6942066b query generator kind for error reporting 2019-10-10 17:27:23 +00:00
varkor
fb392c5ed6
Don't cc rust-lang/compiler for toolstate changes 2019-10-10 17:23:28 +01:00
Oliver Scherer
373c362b7e Check that we don't access nonexisting union fields 2019-10-10 18:21:34 +02:00
BaoshanPang
6afc5091b9 vxWorks: implement get_path() and get_mode() for File fmt::Debug 2019-10-10 08:41:10 -07:00
bors
58b54911fa Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisa
Add llvm.sideeffect to potential infinite loops and recursions

LLVM assumes that a thread will eventually cause side effect. This is
not true in Rust if a loop or recursion does nothing in its body,
causing undefined behavior even in common cases like `loop {}`.
Inserting llvm.sideeffect fixes the undefined behavior.

As a micro-optimization, only insert llvm.sideeffect when jumping back
in blocks or calling a function.

A patch for LLVM is expected to allow empty non-terminate code by
default and fix this issue from LLVM side.

https://github.com/rust-lang/rust/issues/28728

**UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-10-10 15:40:39 +00:00
Adam Perry
2dbc62b56a Clarify shim implementation comment. 2019-10-10 07:50:33 -07:00
Adam Perry
407d1d5fd4 Instance::resolve_for_fn_ptr unconditionally resolves first.
Per review feedback.
2019-10-10 07:31:22 -07:00
Adam Perry
1cdd5d099d Improve docs for InstanceDef::ReifyShim. 2019-10-10 07:25:54 -07:00
Guillaume Gomez
3c62bdcf6b Update ui tests 2019-10-10 15:56:59 +02:00
Guillaume Gomez
847ad6a2ee Add long error explanation for E0568 2019-10-10 15:56:59 +02:00
bors
9c588c1e23 Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakis
resolve: Remove an incorrect assert

Fixes https://github.com/rust-lang/rust/issues/64803.
2019-10-10 12:02:47 +00:00
Aleksey Kladov
19bc0a8c67
Mark Path::join as must_use
I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
2019-10-10 12:42:04 +03:00
Guillaume Gomez
3e376f5c1f Add and update rustdoc ui test 2019-10-10 11:37:13 +02:00
Guillaume Gomez
169a1cac8d Don't pass doctest feature by default 2019-10-10 11:37:13 +02:00