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
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
Michael Woerister
a9853fce25
Add 'unlikely' annotation to branch in crate DepNodeIndex caching.
2019-10-10 09:42:06 +02: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
Nicholas Nethercote
8cd25e7245
Remove tag
from iterate_until_fixed_point()
.
...
The function only has one call site, so we don't need a tag argument.
2019-10-10 16:23:08 +11:00
Nicholas Nethercote
59e41edcc1
Special-case ReEmpty
in expand_node()
.
...
This wins 6% on `unicode_normalization`, by avoiding a call to
`lub_concrete_regions()` and a `Region` equality test.
2019-10-10 16:21:37 +11:00
Nicholas Nethercote
53e739305a
Tweak tcx
usage in lub_concrete_regions()
.
...
Some places use the local `tcx` variable, some use `self.tcx()`. This
commit removes the local variable so that all places use `self.tcx()`,
for consistency.
2019-10-10 16:20:31 +11: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 37026837a3f23486d3cf1009d9136927168ddb33.
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
Esteban Küber
2c6bcac535
review comments
2019-10-09 10:17:29 -07:00
Esteban Küber
4fcaa4a283
review comments
2019-10-09 10:17:29 -07:00
Esteban Küber
722bb515e2
Obligation must apply modulo regions
2019-10-09 10:17:29 -07:00
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
Oliver Scherer
76fe6a41ba
Refactor a nested if
to a match
2019-10-09 19:12:49 +02:00
Oliver Scherer
76a7667e79
Move test next to likeminded ones
2019-10-09 19:09:08 +02:00
bors
20cc752726
Auto merge of #65228 - Wind-River:real_master, r=dtolnay
...
vxworks: add checking (r == 0)
2019-10-09 16:31:49 +00:00
Andreas Jonson
6ae36a37ac
make it possible to add args to cargo in x.py
...
eg. make it easier to test -Ztimings for rustc
2019-10-09 17:45:19 +02:00
Vadim Petrochenkov
48f8beddd8
resolve: Use field spans for reporting the private constructor error
2019-10-09 18:07:22 +03:00
Vadim Petrochenkov
5d8af38329
resolve: Keep field spans for diagnostics
2019-10-09 18:07:22 +03:00
Michael Woerister
0ee6a96eb7
Remove some outdated comments about dependency tracking from cstore_impl.
2019-10-09 16:58:17 +02:00
Michael Woerister
003d5a6367
self-profiling: Add events for tracking crate metadata loading related activities.
2019-10-09 16:58:17 +02:00
Michael Woerister
9dbd7be70f
Cache the DepNodeIndex of upstream crates in order to avoid multiple locks and table lookups on each access of crate metadata.
2019-10-09 16:58:10 +02:00