Commit Graph

100479 Commits

Author SHA1 Message Date
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
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
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
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
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
ben
8569dd1db9 Preserve output of raw pointers in mir dump. 2019-10-10 22:01:55 +13:00
bors
8c7b921feb Auto merge of #65129 - andjo403:cargo_args, r=alexcrichton
make it possible to add args to cargo in x.py

eg. make it easier to test -Ztimings for rustc

cc https://github.com/rust-lang/rust/issues/65088
2019-10-10 08:10:49 +00:00
Matt Stavola
ee081145ac
Qualify LangItem 2019-10-09 23:10:35 -07:00
Matt Stavola
af3f8dec59
Delegate is_{freeze,copy,sized}_raw to is_item_raw 2019-10-09 22:56:13 -07:00
Adam Perry
ea3ecf22ae miri calls resolve_for_fn_ptr when reifying. 2019-10-09 21:13:08 -07:00
bors
8ee24f6ee0 Auto merge of #65077 - estebank:mut-trait-expected, r=nikomatsakis
Note when a mutable trait object is needed

Fix https://github.com/rust-lang/rust/issues/63619, fix https://github.com/rust-lang/rust/issues/37914. CC https://github.com/rust-lang/rust/issues/64068.
2019-10-10 04:07:02 +00:00
Adam Perry
8a097f2619 Clarify comment, dedupe match arms in shim.rs.
Also add a missing terminal newline to a test.
2019-10-09 21:02:54 -07:00
Adam Perry
b8414c13ab Return ReifyShim from Instance::resolve_for_fn_ptr when track_caller present.
This ICEs in MIR currently, which I think is to be expected since none of the MIR plumbing is set up. I added a test which confirms that the shim is being used for reifying a track_caller function.
2019-10-09 20:19:09 -07:00
Adam Perry
0132738437 Reifying callers of Instance::resolve use resolve_for_fn_ptr. 2019-10-09 20:19:09 -07:00
Adam Perry
f5f67e78bb Add Instance::resolve_for_fn_ptr 2019-10-09 20:19:09 -07:00
Adam Perry
012116f860 Add InstanceDef::ReifyShim for track_caller functions. 2019-10-09 20:19:09 -07:00
bors
aa45e032d9 Auto merge of #64939 - nnethercote:snapshot-cleanups, r=nikomatsakis
Snapshot clean-ups

Two minor clean-ups involving snapshots.
2019-10-10 00:19:29 +00:00
bors
ece4977138 Auto merge of #65249 - matthewjasper:revert-into-drop, r=nnethercote
Revert "Make `into` schedule drop for the destination"

This was a *very* large perf regression in some cases. I'll undo the revert once I have time to avoid the regression.
2019-10-09 20:29:05 +00:00
Matthew Jasper
a0342c8965 Revert "Make into schedule drop for the destination"
This reverts commit 37026837a3.
2019-10-09 21:13:18 +01:00
Esteban Küber
4bb1592402 Suggest if let on let refutable binding 2019-10-09 12:25:48 -07:00
ben
89cc0467a2 Pretty print raw pointers in consts as '{pointer}'. 2019-10-10 08:11:31 +13:00
Esteban Küber
faf8a2af7a Only suggest change mut if vars are resolved 2019-10-09 11:42:29 -07:00