Commit graph

101635 commits

Author SHA1 Message Date
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
Niko Matsakis
48fff6f9ad don't assume we can *always* find a return type hint in async fn
In particular, we sometimes cannot if there is an earlier error.
2019-10-11 16:59:54 -04:00
memoryruins
05db5a2698 Report lint in external macros 2019-10-11 16:36:50 -04:00
Ralf Jung
715ffab116 InterpCx: make memory field public 2019-10-11 22:33:55 +02:00
Tomasz Miąsko
5db17335a1 rustdoc: forward -Z options to rustc
Currently rustdoc does not forward `-Z` options to rustc when building
test executables. This makes impossible to use rustdoc to run test
samples when crate under test is instrumented with one of sanitizers
`-Zsanitizer=...`, since the final linking step will not include
sanitizer runtime library.

Forward `-Z` options to rustc to solve the issue.

Helps with #43031.
2019-10-11 22:29:11 +02:00
Dan Aloni
9d11bda8dd resolve: shorten wording on private constructor error 2019-10-11 22:18:07 +03:00
Jack O'Connor
93ae6924af make File::try_clone produce non-inheritable handles on Windows
File handles shouldn't be inheritable in general.
`std::process::Command` takes care of making them inheritable when child
processes are spawned, and the `CREATE_PROCESS_LOCK` protects against
races in that section on Windows. But `File::try_clone` has been
creating inheritable file descriptors outside of that lock, which could
be leaking into other child processes unintentionally.

See also https://github.com/rust-lang/rust/pull/31069#discussion_r334117665.
2019-10-11 14:23:25 -04: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
qtmlabs
e2ce082fd8 Revert "Remove reference to Ubuntu 15.10 ARM toolchain"
This reverts commit 4f97e5d411.
2019-10-11 16:05:17 +07:00
Oliver Scherer
f5669ebb45 Update ui stderr 2019-10-11 10:43:55 +02:00
Oliver Scherer
7e1a65dce1 Ensure we do not treat all unions as not having any drop glue. 2019-10-11 10:43:55 +02:00
Oliver Scherer
fb23a5cf3b Clarify a vague comment 2019-10-11 10:43:54 +02:00
Oliver Scherer
2fc257ca81 Prefer ManuallyDrop::{take,new} over ptr::{read,write} 2019-10-11 10:43:54 +02:00
Oliver Scherer
9c1ad0ff2f Preserve originally intended test semantics 2019-10-11 10:43:54 +02:00
Oliver Scherer
50ec10e605 rpass tests are now part of ui tests 2019-10-11 10:43:54 +02:00
Simon Sapin
616cf52358 Extend union-nodrop.rs test 2019-10-11 10:43:54 +02:00
Simon Sapin
fc512d2cdf More descriptive variable name 2019-10-11 10:43:54 +02:00
Simon Sapin
bf25a9c82f Update src/test/run-pass/union/union-nodrop.rs
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-10-11 10:43:54 +02:00
Simon Sapin
0301eafd32 Update src/librustc_typeck/error_codes.rs
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-10-11 10:43:54 +02:00
Simon Sapin
8c5ae86496 Update src/librustc_typeck/check/mod.rs
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-10-11 10:43:54 +02:00
Simon Sapin
05a644e825 Update src/librustc_typeck/check/mod.rs
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-10-11 10:43:54 +02:00
Simon Sapin
e247a40a1c Fixes #41073, it is no longer an ICE 2019-10-11 10:43:54 +02:00
Simon Sapin
fe13bbd064 Remove unions_with_drop_fields lint
Cases where it would trigger are now hard errors.
2019-10-11 10:43:54 +02:00
Ulrik Sverdrup
2f0c821be9 Change untagged_unions to not allow union fields with drop
Union fields may now never have a type with attached destructor.
This for example allows unions to use arbitrary field types only by
wrapping
them in ManuallyDrop.

The stable rule remains, that union fields must be Copy. We use the new
rule for the `untagged_union` feature.

See RFC 2514.

Note for ui tests:
We can't test move out through Box's deref-move since we can't
have a Box in a union anymore.
2019-10-11 10:43:54 +02:00
Simon Sapin
84ca0a1cb4 Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
Simon Sapin
0a08841bb0 Remove uses of allow(unions_with_drop_fields) in the standard library 2019-10-11 10:43:54 +02:00
Oliver Scherer
88b5e945e0 Make <*const/mut T>::offset_from const fn 2019-10-11 10:40:49 +02:00
qtmlabs
4f97e5d411 Remove reference to Ubuntu 15.10 ARM toolchain 2019-10-11 15:32:01 +07:00
qtmlabs
90d0baf2b4 Upgrade GCC to 8.3.0, glibc to 1.17.0 and crosstool-ng to 1.24.0 for dist-armv7-linux 2019-10-11 15:13:22 +07: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