Commit Graph

95056 Commits

Author SHA1 Message Date
Esteban Küber
56e30e1f3f Tweak transparent enums and unions diagnostic spans 2019-06-14 13:39:13 -07:00
Ralf Jung
d54b27d33a update miri 2019-06-14 21:58:33 +02:00
John Kåre Alsaker
007aabae93 Remove unnecessary lift calls 2019-06-14 21:11:50 +02:00
Esteban Küber
34c4117f5f review comment: do not rely on path str to identify std::clone::Clone 2019-06-14 11:44:20 -07:00
Matthew Jasper
5c84cd37cb Use sym constansts for PrimitiveTypeTable keys 2019-06-14 18:54:58 +01:00
Matthew Jasper
4e212c6ddc Avoid some unnecessary symbol interner operations 2019-06-14 18:54:58 +01:00
Esteban Küber
ae8d6a82fe review comments: avoid string modification 2019-06-14 10:45:13 -07:00
Aaron Kutch
363940bbe1 Change ... to ..= where applicable 2019-06-14 12:24:38 -05:00
Alex Crichton
ea1bec3a8a Turn down the myriad-closures test
This tests takes nearly 5 minutes to compile on CI where the CPUs we
have aren't exactly the fastest. This test does actually require all
closures to exist to exhibit the original bug, but it seems a little
excessive to test a single bug on CI on all platforms which simply pegs
a single CPU for 5 minutes with no parallelism opportunities, so this
turns down the test to still exercise it somewhat at least.
2019-06-14 09:53:59 -07:00
bors
9606f6fa64 Auto merge of #61817 - eddyb:begone-gcx-attempt-2, r=oli-obk
Unify all uses of 'gcx and 'tcx.

This is made possible by @Zoxc landing #57214 (see https://github.com/rust-lang/rust/pull/57214#issuecomment-465036053 for the decision).

A bit of context for the approach: just like #61722, this is *not* how I originally intended to go about this, but @Zoxc and my own experimentation independently resulted in the same conclusion:
The interim alias `type TyCx<'tcx> = TyCtxt<'tcx, 'tcx>;` attempt required more work (adding `use`s), even only for handling the `TyCtxt<'tcx, 'tcx>` case and not the general `TyCtxt<'gcx, 'tcx>` one.

What this PR is based on is the realization that `'gcx` is a special-enough name that it can be replaced, without caring for context, with `'tcx`, and then repetitions of the name `'tcx` be compacted away.
After that, only a small number of error categories remained, each category easily dealt with with either more mass replacements (e.g. `TyCtxt<'tcx, '_>` -> `TyCtxt<'tcx>`) or by hand.

For the `rustfmt` commit, I used https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, and manually filtered out some noise, like in #61735 and #61722, and like the latter, there was also a weird bug to work around.
It should be reviewed separately, and dropped if unwanted (in this PR it's pretty significant).

cc @rust-lang/compiler r? @nikomatsakis
2019-06-14 16:20:35 +00:00
Eduard-Mihai Burtescu
afc39bbf24 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-14 18:58:32 +03:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
bors
fc550d4295 Auto merge of #61421 - vorner:string-in-rc-into-raw-docs, r=RalfJung
docs: Use String in Rc::into_raw examples

It is unclear if accessing an integer after `drop_in_place` has been
called on it is undefined behaviour or not, as demonstrated by the
discussion in
https://github.com/rust-lang/rust/pull/60766#pullrequestreview-243414222.

Avoid these uncertainties by using String which frees memory in its
`drop_in_place` to make sure this is undefined behaviour. The message in
the docs should be to watch out and not access the data after that, not
discussing when one maybe could get away with it O:-).
2019-06-14 12:37:28 +00:00
Yuki Okushi
e252aaec70 Fix examples 2019-06-14 20:12:01 +09:00
Felix S Klock II
0baa9258dd
put back the workarounds for #60846
based on https://github.com/rust-lang/rust/pull/61754#issuecomment-501743750 I am adding `bootstrap` to the cfg-preconditions for the two manual `unsafe impls`'s of `Send` and `Sync` for `TokenTree`.
2019-06-14 12:19:26 +02:00
bors
e699ea096f Auto merge of #61679 - zackmdavis:maybe_dont_indicate_the_anonymous_lifetime, r=oli-obk
in which we decline to suggest the anonymous lifetime in declarations

The elided-lifetimes-in-path lint (part of our suite of Rust 2018 idiom lints which we are hoping to promote to Warn status) was firing with an illegal suggestion to write an anonymous lifetime in a
struct/item declaration (where we don't allow it). The linting code was already deciding whether to act on the basis of a `ParamMode` enum, indicating whether the present path-segment was part of an
expression, or anywhere else. The present case seemed to be part of the "anywhere else", and yet meriting different rules as far as the lint was concerned, so it seemed expedient to introduce a new enum member. We yank out `TyKind::Path` arm into its own method so that we can call it with our new `ParamMode` specifically when lowering struct fields—one would have hoped to think of something more elegant than this, but it definitely beats changing the signature of `lower_ty` to take a `ParamMode`!

Resolves #61124.

cc @memoryruins
r? @oli-obk
2019-06-14 09:39:17 +00:00
Marc-Antoine Perennou
4d5f97e833 rustbuild: include llvm-libunwind in dist tarball
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-14 11:24:59 +02:00
Ralf Jung
e5f840ecb5 make sure we use cfg-if as a std dependency 2019-06-14 11:01:28 +02:00
Ralf Jung
00bae8774c note some safety concerns of raw-ptr-to-ref casts 2019-06-14 10:47:32 +02:00
Mazdak Farrokhzad
065151f8b2 type_alias_enum_variants: add regression test for #61801. 2019-06-14 09:17:29 +02:00
Zack M. Davis
17653dd3da in which we decline to lint single-use lifetimes in derived impls
Resolves #53738.
2019-06-14 00:07:27 -07:00
Zack M. Davis
7a3184a04c in which we decline to suggest the anonymous lifetime in declarations
The elided-lifetimes-in-path lint (part of our suite of Rust 2018
idiom lints which we are hoping to promote to Warn status) was firing
with an illegal suggestion to write an anonymous lifetime in a
struct/item declaration (where we don't allow it). The linting code
was already deciding whether to act on the basis of a `ParamMode`
enum, indicating whether the present path-segment was part of an
expression, or anywhere else. The present case seemed to be part of
the "anywhere else", and yet meriting different rules as far as the
lint was concerned, so it seemed expedient to introduce a new enum
member. We yank out a `TyKind::Path` arm into its own method so that
we can call it with our new `ParamMode` specifically when lowering
struct fields. (The alternative strategy of changing the signature of
`lower_ty` to take a `ParamMode` would be inelegant given that most of
the `TyKind` match arm bodies therein don't concern themselves with
`ParamMode`.)

Resolves #61124.
2019-06-14 00:01:59 -07:00
Mazdak Farrokhzad
d3024138f8 PatKind::Path: avoid calling resolve_ty_and_res_ufcs twice. 2019-06-14 09:00:21 +02:00
bors
42503d5790 Auto merge of #61803 - Centril:write_resolution, r=petrochenkov
typeck: small refactoring, add 'fn write_resolution'
2019-06-14 06:46:01 +00:00
bors
bcc568f27b Auto merge of #61792 - lzutao:issue-51301, r=Centril
Add ui test for issue 51301

Closes #51301
2019-06-14 03:57:28 +00:00
Yuki Okushi
047f9bc94d Add explanation for E0592 2019-06-14 11:19:21 +09:00
Esteban Küber
8ce063a216 Verify that the clone method call actually corresponds to std::clone::Clone::clone 2019-06-13 18:00:24 -07:00
Esteban Küber
bdb05a84f3 When suggesting to borrow, remove useless clones 2019-06-13 16:46:07 -07:00
David Wood
bc36aabf5f
typeck: Fix ICE for blocks in repeat expr count.
This commit extends the work in #61698 to get the `DefId` of const
parameters from block that resolve to a const parameter (as well as
const parameters directly, as it was previously).
2019-06-13 23:34:38 +01:00
bors
cdd743755a Auto merge of #61639 - Mark-Simulacrum:bootstrap-cleanup, r=alexcrichton
Bootstrap cleanup

Each commit is (mostly) standalone and probably best reviewed as such. Nothing too major just some drive-by nits as I was looking through the code.

r? @alexcrichton
2019-06-13 22:23:42 +00:00
Matthew Jasper
89ea69ab23 Add a test for simple matches 2019-06-13 21:05:21 +01:00
Matthew Jasper
df3de7b4b3 Add some more comments on how TestKind works 2019-06-13 21:05:21 +01:00
Matthew Jasper
a1d0266878 Generate MIR thats easier for llvm for str matches
LLVM appears to prefer (spend less time optimizing) long if chains if
it receives them in approzimately source order.
This fixes a ~10% regression for optimized builds of the encoding benchmark
on perf.rlo due to the changes to decision tree construction.
2019-06-13 21:05:21 +01:00
Matthew Jasper
ef1fc86b52 Call str::eq and <[T]>::eq for match comparisons
We used to call the less efficient `<&str>::eq` and `<&[T]>::eq`.
2019-06-13 21:05:21 +01:00
Matthew Jasper
da22793a35 Create fewer basic blocks in match MIR lowering 2019-06-13 21:05:21 +01:00
bors
0e4a56b4b0 Auto merge of #61772 - alexcrichton:pr-and-master-builds, r=pietroalbini
ci: Enable toolstate tracking on Azure

Currently just run it through its paces but don't actually push to
official locations. Instead let's just push to a separate fork (mine) as
well as open issues in a separate fork (mine). Make sure that people
aren't pinged for these issues as well!

This should hopefully ensure that everything is working on Azure and
give us a chance to work through any issues that come up.

Fixes https://github.com/rust-lang/rust/issues/61790
Fixes https://github.com/rust-lang/rust/issues/61371
2019-06-13 15:44:58 +00:00
Mark Rousskov
d728d27ef3 Remove unnecessary Std dependency 2019-06-13 08:57:55 -06:00
Mark Rousskov
11543585c2 Delete unused fields on Crate struct 2019-06-13 08:57:55 -06:00
Mark Rousskov
7234d8cb5e Inline prepare_tool_cmd
Removing the tool argument in the previous commit means it's no longer
restricted to just bootstrap tools despite being written as such.
Inlining it prevents accidental use.
2019-06-13 08:57:55 -06:00
Mark Rousskov
0e14818321 Delete unnecessary command 2019-06-13 08:57:55 -06:00
Mark Rousskov
92f5e58ccc Delete Rustbook step
There's no need to have it given it merely forwarded to RustbookSrc.
2019-06-13 08:57:55 -06:00
Mazdak Farrokhzad
a17e918284 typeck: small refactoring, add 'fn write_resolution' 2019-06-13 16:45:18 +02:00
Alex Crichton
521edee2e5 ci: Enable toolstate tracking on Azure
Currently just run it through its paces but don't actually push to
official locations. Instead let's just push to a separate fork (mine) as
well as open issues in a separate fork (mine). Make sure that people
aren't pinged for these issues as well!

This should hopefully ensure that everything is working on Azure and
give us a chance to work through any issues that come up.
2019-06-13 07:09:51 -07:00
bors
57a3300c25 Auto merge of #61799 - Centril:rollup-vpm5uxr, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61598 (Handle index out of bound errors during const eval without panic)
 - #61720 (std: Remove internal definitions of `cfg_if!` macro)
 - #61757 (Deprecate ONCE_INIT in future 1.38 release)
 - #61766 (submodules: update clippy from c0dbd34b to bd33a97c)
 - #61791 (Small cleanup in `check_pat_path`)

Failed merges:

r? @ghost
2019-06-13 12:52:29 +00:00
Mazdak Farrokhzad
8917b8e32c
Rollup merge of #61791 - Centril:cleanup-check_pat_path, r=petrochenkov
Small cleanup in `check_pat_path`
2019-06-13 14:52:00 +02:00
Mazdak Farrokhzad
e70a1062ac
Rollup merge of #61766 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from c0dbd34b to bd33a97c

Changes:
````
Fix implicit_return docs
rustup https://github.com/rust-lang/rust/pull/61758/files
Remove wrong lifetime from LintContext
Workaround for rust-lang/rustfmt#3615
Fixing eta with respect to lazy evaluation.
````
r? @oli-obk
2019-06-13 14:51:59 +02:00
Mazdak Farrokhzad
e45c83ca23
Rollup merge of #61757 - sfackler:deprecate-once-init, r=alexcrichton
Deprecate ONCE_INIT in future 1.38 release

Once::new() has been a stable const fn for a while now.

Closes #61746
2019-06-13 14:51:57 +02:00
Mazdak Farrokhzad
ca06f8896b
Rollup merge of #61720 - alexcrichton:libstd-cfg-if-dep, r=sfackler
std: Remove internal definitions of `cfg_if!` macro

This is duplicated in a few locations throughout the sysroot to work
around issues with not exporting a macro in libstd but still wanting it
available to sysroot crates to define blocks. Nowadays though we can
simply depend on the `cfg-if` crate on crates.io, allowing us to use it
from there!
2019-06-13 14:51:56 +02:00
Mazdak Farrokhzad
a0d05150c9
Rollup merge of #61598 - estebank:const-idx, r=oli-obk
Handle index out of bound errors during const eval without panic

Fix #61595
2019-06-13 14:51:53 +02:00
Michal 'vorner' Vaner
79e5839992
docs: Use String in Rc::into_raw examples
It is unclear if accessing an integer after `drop_in_place` has been
called on it is undefined behaviour or not, as demonstrated by the
discussion in
https://github.com/rust-lang/rust/pull/60766#pullrequestreview-243414222.

Avoid these uncertainties by using String which frees memory in its
`drop_in_place` to make sure this is undefined behaviour. The message in
the docs should be to watch out and not access the data after that, not
discussing when one maybe could get away with it O:-).
2019-06-13 13:18:59 +02:00