Commit Graph

80455 Commits

Author SHA1 Message Date
Niko Matsakis
0b620186fd
propagate boring vs interesting causal info for constraints/tests 2018-07-01 15:30:42 +01:00
Niko Matsakis
609bb27514
categorize Locations as interesting or boring 2018-07-01 15:27:15 +01:00
Niko Matsakis
dbeda5ee29
remove the at_location from Locations
We are not currently using it for anything; even polonius just uses
the `from_location`.
2018-07-01 15:27:10 +01:00
Niko Matsakis
73f8333e78 update mir-opt tests 2018-07-01 10:13:05 -04:00
Niko Matsakis
865320f6a4 remove the ins set altogether 2018-07-01 10:13:05 -04:00
Niko Matsakis
5ddda3f195
rename ToLocations to NormalizeLocation 2018-07-01 15:00:34 +01:00
bors
ef9a322843 Auto merge of #51883 - estebank:placement-suggestion, r=varkor
Suggest correct comparison against negative literal

When parsing as emplacement syntax (`x<-1`), suggest the correct syntax
for comparison against a negative value (`x< -1`).

Fix #45651.
2018-07-01 13:37:05 +00:00
Oliver Schneider
0ccebdff6d Update clippy submodule 2018-07-01 13:39:27 +02:00
bors
e100ce4f92 Auto merge of #51855 - Eh2406:i51821, r=nikomatsakis
A fix for 51821

This dedupe the vec of `OutlivesConstraint` using a `FxHashSet<(RegionVid, RegionVid)>` it alsow adds a `struct ConstraintSet` to encapsulate/ensure this behavere.
2018-07-01 10:41:51 +00:00
Niko Matsakis
ac5bd5dd2b remove the FxHashSet since it's not helping us in practice
It turns out that we don't have duplicates, just self-cycles.
2018-07-01 05:53:35 -04:00
Niko Matsakis
be0e77837a use WorkQueue to track dirty bits in liveness 2018-07-01 05:24:16 -04:00
Niko Matsakis
388ff03248 create a new WorkQueue data structure 2018-07-01 05:22:50 -04:00
bors
d94b804863 Auto merge of #51882 - varkor:check-type_dependent_defs, r=estebank
Always check type_dependent_defs

Directly indexing into `type_dependent_defs` has caused multiple ICEs in the past (https://github.com/rust-lang/rust/issues/46771, https://github.com/rust-lang/rust/issues/49241, etc.) and is almost certainly responsible for #51798 too. This PR ensures we always check `type_dependent_defs` first, which should prevent any more of these (or at least make them easier to track down).
2018-07-01 08:41:50 +00:00
Takanori Ishibashi
2e8d9d7a25 absoluate -> absolute 2018-07-01 17:37:42 +09:00
bors
a1703baf52 Auto merge of #51877 - oli-obk:lowering_cleanups3, r=cramertj
Lowering cleanups [3/N]

Needs https://github.com/rust-lang/rust/pull/51806 to be merged first
2018-07-01 06:37:23 +00:00
Zack M. Davis
c2d44b2286 in which the private/restricted-in-public error messaging gets specific
April 2016's Issue #33174 called out the E0446 diagnostics as
confusing. While adding the name of the restricted type to the message
(548e681f) clarified matters somewhat, Esteban Küber pointed out that we
could stand to place a secondary span on the restricted type.

Here, we differentiate between crate-visible, truly private, and
otherwise restricted types, and place a secondary span specifically on
the visibility modifier of the restricted type's declaration (which we
can do now that HIR visibilities have spans!).

At long last, this resolves #33174.
2018-06-30 22:48:05 -07:00
Zack M. Davis
8d1cbb018e private no-mangle lints: help hint note if visibility modifier is pub
If the item is `pub`, one imagines users being confused as to why it's
not reachable/exported; a code suggestion is beyond our local knowledge
here, but we can at least offer a prose hint. (Thanks to Vadim
Petrochenkov for shooting down the present author's original bad idea
for the note text.)

While we're here, use proper HELP expectations instead of ad hoc
comments to communicate (and now, enforce) the expected suggestions in
test/ui/lint/suggestions.rs.
2018-06-30 22:48:05 -07:00
Zack M. Davis
53307473fd private no-mangle lints: issue suggestion for restricted visibility
This is probably quite a lot less likely to come up in practice than the
"inherited" (no visibility keyword) case, but now that we have
visibility spans in the HIR, we can do this, and it presumably doesn't
hurt to be exhaustive. (Who can say but that the attention to detail
just might knock someone's socks off, someday, somewhere?)

This is inspired by #47383.
2018-06-30 22:47:47 -07:00
Zack M. Davis
104985b827 unreachable_pub lint: grab pub span from HIR rather than inferring it
This is a true fix for #50455, superior to the mere bandage offered
in #50476.
2018-06-30 22:41:02 -07:00
Zack M. Davis
4ae89129e1 in which hir::Visibility recalls whence it came (i.e., becomes Spanned)
There are at least a couple (and plausibly even three) diagnostics that
could use the spans of visibility modifiers in order to be reliably
correct (rather than hacking and munging surrounding spans to try to
infer where the visibility keyword must have been).

We follow the naming convention established by the other `Spanned` HIR
nodes: the "outer" type alias gets the "prime" node-type name, the
"inner" enum gets the name suffixed with an underscore, and the variant
names are prefixed with the prime name and `pub use` exported from here
(from HIR).

Thanks to veteran reviewer Vadim Petrochenkov for suggesting this
uniform approach. (A previous draft, based on the reasoning that
`Visibility::Inherited` should not have a span, tried to hack in a named
`span` field on `Visibility::Restricted` and a positional field on
`Public` and `Crate`. This was ... not so uniform.)
2018-06-30 22:41:01 -07:00
Zack M. Davis
9df9c9df7b choose a less arbitrary span when parsing the empty visibility modifier
Visibility spans were added to the AST in #47799 (d6bdf296) as a
`Spanned<_>`—which means that we need to choose a span even in the case
of inherited visibility (what you get when there's no `pub` &c. keyword
at all). That initial implementation's choice is pretty
counterintuitive, which could matter if we want to use it as a site to
suggest inserting a visibility modifier, &c.

(The phrase "Schelling span" in the comment is meant in analogy to the
game-theoretic concept of a "Schelling point", a value that is chosen
simply because it's what one can expect to agree upon with other agents
in the absence of explicit coördination.)
2018-06-30 22:20:28 -07:00
bors
e953e4621e Auto merge of #51869 - nnethercote:rm-clone_from, r=nikomatsakis
Avoid needless allocations in `liveness_of_locals`.

We don't need to replace the heap-allocated bitset, we can just
overwrite its contents.

This speeds up most NLL benchmarks, the best by 1.5%.

r? @nikomatsakis
2018-07-01 04:23:29 +00:00
Andy Russell
5468e12ca0
add label to unknown meta item error 2018-06-30 21:38:18 -04:00
Alexander Regueiro
1c34227042 Modified expected error messages in accordance with rebase. 2018-07-01 02:26:31 +01:00
Andy Russell
f315943970
move deprecation-sanity test to ui 2018-06-30 20:44:21 -04:00
Andy Russell
011eaed59d
factor built-in attribute parsing into submodule 2018-06-30 20:44:20 -04:00
bors
33b40f5679 Auto merge of #51943 - oli-obk:miriup, r=kennytm
Update the miri submodule

r? @kennytm
2018-07-01 00:04:14 +00:00
Oliver Schneider
824c5dfa61 Also run the bootstrap in bootstrap mode 2018-07-01 01:50:12 +02:00
Oliver Schneider
8f55152f84 Did you mean to block nightlies on clippy? 2018-07-01 01:35:39 +02:00
Alexander Regueiro
13b82ecf80 Minor refactoring. 2018-06-30 23:53:52 +01:00
Alexander Regueiro
9f751a9c5a Added incremental test for interlinking static references. 2018-06-30 23:53:52 +01:00
Alexander Regueiro
f8132d39d2 Added tests fo referring to statics by value in other statics. 2018-06-30 23:52:33 +01:00
Alexander Regueiro
9e484720bf Added tests for writing to static mut's in statics. 2018-06-30 23:52:33 +01:00
Alexander Regueiro
a2cd95fd9e Fixed bug with miri const evaluation where allocation is recursively borrowed. 2018-06-30 23:52:33 +01:00
Alexander Regueiro
349d53c2a9 Added miri error for evaluating foreign statics.
Updated tests accordingly.
2018-06-30 23:52:33 +01:00
Alexander Regueiro
13931762e9 Loosened rules involving statics mentioning other statics.
Updated tests accordingly.
2018-06-30 23:52:33 +01:00
Zack M. Davis
db2f3d7a88 clarify why we're suggesting removing semicolon after braced items
Previously (issue #46186, pull-request #46258), a suggestion was added
to remove the semicolon after we fail to parse an item, but issue #51603
complains that it's still insufficiently obvious why. Let's add a note.

Resolves #51603.
2018-06-30 14:11:44 -07:00
bors
48af7714d8 Auto merge of #51717 - Mark-Simulacrum:snap, r=alexcrichton
Bootstrap from 1.28.0 beta
2018-06-30 21:01:05 +00:00
Mark Simulacrum
3d68774968 Notice non-toplevel dll dependencies in rustbuild
Previously Cargo would hardlink all the dependencies into the "root" as
foo.dll and the `toplevel` array would get populated with these, but
that's no longer the case. Instead, cargo will only do this for the
final artifacts/final libraries.

Rustbuild is updated to continue looping through the artifacts mentioned
instead of early-returning. This should fix the bug.

@alexcrichton found the cause of this and suggested this fix.
2018-06-30 13:17:49 -07:00
Mark Simulacrum
ad97f8b491 Bootstrap from 1.28.0-beta.3 2018-06-30 13:17:49 -07:00
Jorge Aparicio
6531879e91 more s/llvm-tools/llvm-tools-preview/ 2018-06-30 14:40:36 -05:00
Wesley Wiser
faef6a30e6 Copy undef_masks correctly for repeated bytes 2018-06-30 15:20:10 -04:00
bors
74c89b0230 Auto merge of #51849 - nikomatsakis:issue-51820-places-conflict, r=eddyb
optimize `places_conflict` to avoid complex vectors etc

Fixes #51820
2018-06-30 18:55:09 +00:00
bors
8772747c5f Auto merge of #51862 - estebank:lifetime-spans, r=nikomatsakis
Point to lifetime spans on lifetime errors
2018-06-30 16:52:12 +00:00
Guillaume Gomez
115df57757 reduce search-index size 2018-06-30 16:28:25 +02:00
Oliver Schneider
5f85e022e7 Update the miri submodule 2018-06-30 16:10:39 +02:00
bors
96b47337d9 Auto merge of #51828 - kennytm:no-simd-swap-for-mac, r=alexcrichton
Do not allow LLVM to increase a TLS's alignment on macOS.

This addresses the various TLS segfault on macOS 10.10.

Fix #51794.
Fix #51758.
Fix #50867.
Fix #48866.
Fix #46355.
Fix #44056.
2018-06-30 14:00:24 +00:00
kennytm
e3d113eca9
Do not allow LLVM to increase a TLS's alignment on macOS. 2018-06-30 21:36:03 +08:00
Matthew Jasper
c613aa5a95 Improve error messages when assigning to a local that starts initialized 2018-06-30 11:02:38 +01:00
Oliver Schneider
7879369fa6 Remove some global state from the lowering pass 2018-06-30 11:45:11 +02:00