96102 Commits

Author SHA1 Message Date
Andre Bogus
cbac7815fe More questionmarks in doctests 2019-08-01 17:27:57 +02:00
bors
ec30876f30 Auto merge of #62468 - rust-lang:mutable-overloaded-operators, r=estebank
Improve diagnostics for invalid mutation through overloaded operators

Closes #58864
Closes #52941
Closes #57839
2019-07-13 13:44:40 +00:00
bors
6b468c6360 Auto merge of #60266 - albins:polonius-liveness, r=nikomatsakis
Fact generation for liveness calculations in Polonius

This PR tracks ongoing work to extend `rustc` with support for generating variable use, definition, and later also drop output for the Polonius solver, the whole of which is being tracked in [Polonius Issue #104](https://github.com/rust-lang/polonius/issues/104).
2019-07-13 10:15:40 +00:00
bors
4a95e9704d Auto merge of #61953 - Centril:shared-from-iter, r=RalfJung
Add `impl<T> FromIterator<T> for Arc/Rc<[T]>`

Add implementations of `FromIterator<T> for Arc/Rc<[T]>` with symmetrical logic.

This also takes advantage of specialization in the case of iterators with known length (`TrustedLen`) to elide the final allocation/copying from a `Vec<T>` into `Rc<[T]>` because we can allocate the space for the `Rc<[T]>` directly when the size is known. This is the primary motivation and why this is to be preferred over `iter.collect::<Vec<_>>().into(): Rc<[T]>`.

Moreover, this PR does some refactoring in some places.

r? @RalfJung for the code
cc @alexcrichton from T-libs
2019-07-13 06:49:02 +00:00
bors
a9c7febb87 Auto merge of #62613 - lzutao:clippy-up, r=Manishearth
submodules: Update clippy from 316da7eb to b0290424

r? @Manishearth
2019-07-13 03:12:20 +00:00
bors
e13fe7ff5e Auto merge of #62635 - Centril:rollup-potvfnk, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #61535 (Coherence test when a generic type param has a default value from an associated type)
 - #62274 (rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.)
 - #62431 (Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*`)
 - #62453 (in which we suggest anonymizing single-use lifetimes in paths )
 - #62568 (Replace unsafe_destructor_blind_to_params with may_dangle)
 - #62578 (Add test for #49919)
 - #62595 (Document that the crate keyword refers to the project root)
 - #62599 (move mem::uninitialized deprecation back by 1 release, to 1.39)
 - #62605 (Emit dropped unemitted errors to aid in ICE debugging)
 - #62607 (Correctly break out of recovery loop)
 - #62608 (`async unsafe fn` tests)
 - #62623 (downgrade indirect_structural_match lint to allow)

Failed merges:

r? @ghost
2019-07-12 23:37:39 +00:00
Albin Stjerna
9d3c59d697 rustfmt all the things! 2019-07-12 22:49:15 +02:00
Albin Stjerna
ac0a3d106b polonius: add generation of liveneness-related facts
Notably contains an ugly hack to generate initialization information for
variables that will go away when we have that functionality in Polonius.
2019-07-12 22:48:02 +02:00
Mazdak Farrokhzad
fe4e32a4e6
Rollup merge of #62623 - pnkfelix:issue-62614-downgrade-indirect-structural-match-lint-to-allow, r=zackmdavis
downgrade indirect_structural_match lint to allow

This is a short-term band-aid for the regression aspect of #62614.
2019-07-12 22:46:54 +02:00
Mazdak Farrokhzad
b1d6163622
Rollup merge of #62608 - delan:async-unsafe-fn-tests, r=Centril
`async unsafe fn` tests

- cc #62121

r? @Centril
2019-07-12 22:46:53 +02:00
Mazdak Farrokhzad
a7f1649fbb
Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkov
Correctly break out of recovery loop

Fix #61858.
2019-07-12 22:46:52 +02:00
Mazdak Farrokhzad
d709e8d9d0
Rollup merge of #62605 - estebank:emit-dropped-err, r=pnkfelix
Emit dropped unemitted errors to aid in ICE debugging
2019-07-12 22:46:50 +02:00
Mazdak Farrokhzad
d69e9588f0
Rollup merge of #62599 - RalfJung:uninit, r=cramertj
move mem::uninitialized deprecation back by 1 release, to 1.39

As per discussion at https://github.com/rust-lang/rust/issues/53491#issuecomment-509271182. Three releases also agrees with the precedent from `trim_left/right`. Three releases means that even nightly users (including rustc itself) get a full cycle from when the announcement is made in the stable release to when nightly starts to warn.
2019-07-12 22:46:49 +02:00
Mazdak Farrokhzad
a4252fe6d2
Rollup merge of #62595 - ngoldbaum:path-clarity-doc, r=Centril
Document that the crate keyword refers to the project root

👋 this is my first rust contribution so I hope I'm doing everything correctly. Help very much appreciated if I'm not.

As far as I can tell this use of `crate` is only documented [in the edition guide for rust 2018](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#the-crate-keyword-refers-to-the-current-crate). However it should probably be in the documentation for the `crate` keyword itself. This adds that documentation.
2019-07-12 22:46:47 +02:00
Mazdak Farrokhzad
992bcd0266
Rollup merge of #62578 - JohnTitor:add-test-for-49919, r=alexcrichton
Add test for #49919

Closes #49919
2019-07-12 22:46:46 +02:00
Mazdak Farrokhzad
d70ea7ce48
Rollup merge of #62568 - lzutao:replace_may_dangle, r=matthewjasper
Replace unsafe_destructor_blind_to_params with may_dangle

This PR will completely remove support for `#[unsafe_destructor_blind_to_params]` attribute,
which is deprecated in #38970 by `[may_dangle]` unsafe  attribute.

Closes #34761
2019-07-12 22:46:44 +02:00
Mazdak Farrokhzad
e706438d00
Rollup merge of #62453 - zackmdavis:single_path, r=estebank
in which we suggest anonymizing single-use lifetimes in paths

Following @nikomatsakis's [October 2017 comment](https://github.com/rust-lang/rust/issues/44752#issuecomment-340885834).

![path_anon_suggest](https://user-images.githubusercontent.com/1076988/60761598-e2619180-a000-11e9-9144-1bdf8eb848e3.png)

r? @estebank
cc @eddyb (you were saying something about running single-use-lifetimes against the tree the other week?)
2019-07-12 22:46:43 +02:00
Mazdak Farrokhzad
f169b15e1d
Rollup merge of #62431 - czipperz:add-messages-to-must-use-is_-methods, r=scottmcm
Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*`

r? @RalfJung
2019-07-12 22:46:41 +02:00
Mazdak Farrokhzad
9ffeb26e0b
Rollup merge of #62274 - eddyb:const-false-unwind, r=pnkfelix
rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.

As far as I can tell, this was accidentally omitted from #47802.
Fixes #62272.

r? @matthewjasper or @nikomatsakis
2019-07-12 22:46:40 +02:00
Mazdak Farrokhzad
74ac956fad
Rollup merge of #61535 - ohadravid:test-generic-with-default-assiociated-type-re-rebalance-coherence, r=nikomatsakis
Coherence test when a generic type param has a default value from an associated type

A followup on #61400.
Before `re_rebalance_coherence`, this fails to compile (even though it should be accepted).
`re_rebalance_coherence` had no direct test for this, and I wanted to (a) make sure it doesn't regress in the future and (b) get it on record that this is actually the intended behavior.
2019-07-12 22:46:38 +02:00
Albin Stjerna
e775bf33c0 Upgrade Polonius 2019-07-12 22:41:00 +02:00
Esteban Küber
8c5f6907a1 add test case 2019-07-12 11:13:03 -07:00
Felix S. Klock II
44d27ba28d Change indirect_structural_match lint to allow-by-default.
This is a way to address the regression aspect of rust-lang/rust#62614 in the
short term without actually fixing the bug. (My thinking is that the bug that
this lint detects has gone undetected for this long, it can wait a bit longer
until I or someone else has a chance to put in a proper fix that accounts for
rust-lang/rust#62614.)
2019-07-12 15:32:12 +02:00
Felix S. Klock II
00e0d8790d Turn indirect_structural_match lint on explicitly in ui tests. 2019-07-12 15:27:21 +02:00
bors
71f9384e3b Auto merge of #61462 - GuillaumeGomez:fix-local-storage, r=Manishearth
[rustdoc] Fix storage usage when disabled

Fixes #61239.

@starblue: Can you give a try to this change please? I tried on chrome and firefox and both worked so if you're using another web browser, that might be useful. :)

r? @Manishearth
2019-07-12 12:04:25 +00:00
Lzu Tao
b95e15e2e5 submodules: Update clippy from 316da7eb to b0290424 2019-07-12 09:30:07 +00:00
bors
cd1381e91f Auto merge of #62549 - ehuss:update-cargo-vendor, r=alexcrichton
Update cargo-vendor usage

This contains a variety of updates to clean up the usage of cargo-vendor.

- Remove the install step for the old cargo-vendor now that it is built-in to cargo and available in the stage0 install.
- Update installation instructions, dealing with vendoring. The current instructions of running `sudo ./x.py install` is broken, it will almost always fail (since the vendor directory doesn't exist). Since the steps for properly handling this are numerous, I'm recommending removing the suggestion to use `sudo` altogether.
- If the sudo-forced-vendoring detects that the vendor directory is not available, abort with instructions on how to fix.
- Now that cargo-vendor is built-in, automatically run it if it looks like it is needed.
- Update instructions on how to install cargo.
- Remove the unused markdown link references in README/CONTRIBUTING. This reverts most of #44935. These references don't do anything if they are unused.

Closes #49269
cc #61142 #48771 #40108
2019-07-12 08:35:46 +00:00
Delan Azabani
5f8d0a1920 test unsafe fn and async unsafe fn calls in unsafe { async || } 2019-07-12 15:10:52 +10:00
bors
1b1b538843 Auto merge of #61590 - matthewjasper:remove-borrowck-mir-dependency, r=pnkfelix
Remove rustc_mir dependency from rustc_borrowck

Also renames `rustc_borrowck` to `rustc_ast_borrowck` and removes all error reporting from it.

cc #59193
2019-07-12 04:56:05 +00:00
Delan Azabani
d023e47877 remove redundant async_closure test in async-await.rs 2019-07-12 14:50:13 +10:00
Delan Azabani
60f480dacb test E0133 when calling free/impl async unsafe fn in async fn 2019-07-12 14:44:50 +10:00
Delan Azabani
e65c1c44a2
remove unused #![feature(async_closure)]
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-12 14:42:44 +10:00
Delan Azabani
beb2435724 test unsafe fn and async unsafe fn calls in async in unsafe 2019-07-12 14:15:09 +10:00
Delan Azabani
0f66ce65db test E0133 when calling free/impl async unsafe fn in safe code 2019-07-12 13:59:17 +10:00
Delan Azabani
1574c2dee2 align async-await.rs and await-macro.rs with one another 2019-07-12 13:23:30 +10:00
Esteban Küber
cc481a46cb Correctly break out of recovery loop 2019-07-11 20:02:54 -07:00
Esteban Küber
c9f7a3d206 Emit dropped unemitted errors to aid in ICE debugging 2019-07-11 16:59:19 -07:00
bors
e31911ef8f Auto merge of #62594 - JohnTitor:update-miri, r=RalfJung
Update miri

Fixes #62347

r? @RalfJung
2019-07-11 21:54:55 +00:00
Ralf Jung
608249703c move mem::uninitialized deprecation back by 1 release, to 1.39 2019-07-11 22:24:01 +02:00
Lzu Tao
8347917dd9 Remove feature gate dropck_parametricity completely
Therefore we also remove `#[unsafe_destructor_blind_to_params]`
attribute completly.
2019-07-11 18:44:56 +00:00
Nathan Goldbaum
d4fcbb4bdb document that crate refers to the project root 2019-07-11 14:25:53 -04:00
Lzu Tao
ab3adf380d Replace unsafe_destructor_blind_to_params with may_dangle 2019-07-11 18:14:56 +00:00
Matthew Jasper
34ddc70c3f Move rustc_borrowck -> rustc_ast_borrowck 2019-07-11 18:54:02 +01:00
Matthew Jasper
be085d7c0f Remove rustc_mir dependency from rustc_borrowck 2019-07-11 18:54:02 +01:00
Yuki Okushi
f8b620da75 Update miri 2019-07-12 02:43:19 +09:00
bors
4bb6b4a5ed Auto merge of #62503 - pnkfelix:dont-recur-infiitely-from-print-def-path, r=eddyb
Dont recur infinitely from print_def_path

Fix #61711
2019-07-11 13:34:29 +00:00
bors
97b1128589 Auto merge of #62574 - petrochenkov:dcrate-40000, r=Mark-Simulacrum
pretty-print: Do not lose the `$crate` printing flag in `print_tt`

https://github.com/rust-lang/rust/pull/62393 had this accidental mistake.

Fixes https://github.com/rust-lang/rust/issues/62562
r? @Mark-Simulacrum
2019-07-11 10:05:09 +00:00
Vadim Petrochenkov
e38106599a Address review comments 2019-07-11 12:34:57 +03:00
Eduard-Mihai Burtescu
baa9efb178 rustc_mir: follow FalseUnwind's real_target edge in qualify_consts. 2019-07-11 12:28:02 +03:00
Vadim Petrochenkov
af26e7f4f4 pretty-print: Merge print_tts and print_tts_ext 2019-07-11 12:08:29 +03:00