]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #62910 - petrochenkov:buildwarn2, r=Mark-Simulacrum
bors [Sun, 28 Jul 2019 16:34:59 +0000 (16:34 +0000)]
Auto merge of #62910 - petrochenkov:buildwarn2, r=Mark-Simulacrum

cleanup: Remove lint annotations in specific crates that are already enforced by rustbuild

Remove some random unnecessary lint `allow`s.

Deny `unused_lifetimes` through rustbuild.

r? @Mark-Simulacrum

4 years agoFix `cfg(parallel_compiler)` mode
Vadim Petrochenkov [Wed, 24 Jul 2019 08:44:14 +0000 (11:44 +0300)]
Fix `cfg(parallel_compiler)` mode

Fix rebase

4 years agoDeny `unused_lifetimes` through rustbuild
Vadim Petrochenkov [Tue, 23 Jul 2019 19:17:27 +0000 (22:17 +0300)]
Deny `unused_lifetimes` through rustbuild

4 years agoRemove lint annotations in specific crates that are already enforced by rustbuild
Vadim Petrochenkov [Tue, 23 Jul 2019 17:34:17 +0000 (20:34 +0300)]
Remove lint annotations in specific crates that are already enforced by rustbuild

Remove some random unnecessary lint `allow`s

4 years agoAuto merge of #62943 - matthiaskrgr:submodule_upd, r=matthiaskrgr
bors [Sun, 28 Jul 2019 12:50:34 +0000 (12:50 +0000)]
Auto merge of #62943 - matthiaskrgr:submodule_upd, r=matthiaskrgr

submodules: update clippy from 164310dd to dc69a5c0

Changes:
````
ci: temporarily disable rustfmt checks/tetss since it's broken for nightly
rustup https://github.com/rust-lang/rust/pull/62964
Bump version of clippy_dummy
update test stderr, not sure which rustc pull request caused this.
rustup https://github.com/rust-lang/rust/pull/62859
Fix tests for edition 2018 compatibility
Revert "Revert global fmt config and use `rustfmt::skip`"
Fix breakage due to rust-lang/rust#60913
Fix breakage due to rust-lang/rust#62705
Revert global fmt config and use `rustfmt::skip`
Fix fmt
rustup https://github.com/rust-lang/rust/pull/62679/
Update pulldown-cmark to 0.5.3
rustup https://github.com/rust-lang/rust/pull/62764
Add test
Format code
Decrease maximum length for stderr files
Improved imports
Fix "unkown clippy lint" error in UI test.
Corrections for PR review.
Implement lint for inherent to_string() method.
UI Test Cleanup: Extract match_ref_pats tests
Update UI tests
Allow no_effect lint
Remove comment
cargo fmt
UI Test Cleanup: Split up checked_unwrap tests
Removed lintining on never type.
UI Test Cleanup: Split out out_of_bounds_indexing
false positives fixes of `implicit_return`
Ignore generated fresh lifetimes in elision check.
````

fixes clippy toolstate
r? @Manishearth

4 years agoAuto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril
bors [Sun, 28 Jul 2019 09:12:04 +0000 (09:12 +0000)]
Auto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #62550 (Implement RFC 2707 + Parser recovery for range patterns)
 - #62759 (Actually add rustc-guide to toolstate, don't fail builds for the guide)
 - #62806 (Fix few Clippy warnings)
 - #62974 (bump crossbeam-epoch dependency)
 - #63051 (Avoid ICE when referencing desugared local binding in borrow error)
 - #63061 (In which we constantly improve the Vec(Deque) array PartialEq impls)
 - #63067 (Add test for issue-50900)
 - #63071 (Allow rustbot to add `F-*` + `requires-nightly`.)

Failed merges:

r? @ghost

4 years agoRollup merge of #63071 - rust-lang:some-new-labels, r=pietroalbini
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:16 +0000 (11:11 +0200)]
Rollup merge of #63071 - rust-lang:some-new-labels, r=pietroalbini

Allow rustbot to add `F-*` + `requires-nightly`.

r? @pietroalbini

4 years agoRollup merge of #63067 - JohnTitor:test-for-50900, r=Centril
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:15 +0000 (11:11 +0200)]
Rollup merge of #63067 - JohnTitor:test-for-50900, r=Centril

Add test for issue-50900

Closes #50900

4 years agoRollup merge of #63061 - Centril:constantly-improving, r=scottmcm
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:14 +0000 (11:11 +0200)]
Rollup merge of #63061 - Centril:constantly-improving, r=scottmcm

In which we constantly improve the Vec(Deque) array PartialEq impls

Use the same approach as in https://github.com/rust-lang/rust/pull/62435 as sanctioned by https://github.com/rust-lang/rust/issues/61415#issuecomment-504155110.

r? @scottmcm

4 years agoRollup merge of #63051 - estebank:borrow-ice, r=matthewjasper
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:12 +0000 (11:11 +0200)]
Rollup merge of #63051 - estebank:borrow-ice, r=matthewjasper

Avoid ICE when referencing desugared local binding in borrow error

To avoid leaking the names of local bindings from expressions like for loops, #60984 explicitly ignored them, but an assertion that `LocalKind::Var` *must* have a name would trigger an ICE.

Before this change, the binding generated by desugaring the for loop would leak into the diagnostic (#63027):
```
error[E0515]: cannot return value referencing local variable `__next`
  --> return-local-binding-from-desugaring.rs:LL:CC
   |
LL |     for ref x in xs {
   |         ----- `__next` is borrowed here
...
LL |     result
   |     ^^^^^^ returns a value referencing data owned by the current function
```

Ideally `LocalKind` would carry more information to more accurately explain the problem, but for now, in order to avoid the ICE (fix #63026), we accept `LocalKind::Var` without a name and produce the following output:

```
error[E0515]: cannot return value referencing local binding
  --> $DIR/return-local-binding-from-desugaring.rs:30:5
   |
LL |     for ref x in xs {
   |                  -- local binding introduced here
...
LL |     result
   |     ^^^^^^ returns a value referencing data owned by the current function
```

4 years agoRollup merge of #62974 - RalfJung:crossbeam, r=alexcrichton
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:10 +0000 (11:11 +0200)]
Rollup merge of #62974 - RalfJung:crossbeam, r=alexcrichton

bump crossbeam-epoch dependency

The new crossbeam-epoch release depends on a memoffset with a whole bunch of soundness holes fixed.

The old memoffset is still indirectly depended on (at least) by rustc-rayon, though -- a crate that looks rather unmaintained (no change in more than a year).

4 years agoRollup merge of #62806 - mati865:clippy, r=TimNN
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:08 +0000 (11:11 +0200)]
Rollup merge of #62806 - mati865:clippy, r=TimNN

Fix few Clippy warnings

4 years agoRollup merge of #62759 - mark-i-m:rustc-guide-toolstate-check, r=kennytm
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:06 +0000 (11:11 +0200)]
Rollup merge of #62759 - mark-i-m:rustc-guide-toolstate-check, r=kennytm

Actually add rustc-guide to toolstate, don't fail builds for the guide

cc @ehuss

r? @kennytm

4 years agoRollup merge of #62550 - Centril:rest-patterns, r=petrochenkov
Mazdak Farrokhzad [Sun, 28 Jul 2019 09:11:04 +0000 (11:11 +0200)]
Rollup merge of #62550 - Centril:rest-patterns, r=petrochenkov

Implement RFC 2707 + Parser recovery for range patterns

Implement https://github.com/rust-lang/rfcs/pull/2707.

- Add a new basic syntactic pattern form `ast::PatKind::Rest` (parsed as `..` or `DOTDOT`) and simplify `ast::PatKind::{Slice, Tuple, TupleStruct}` as a result.

- Lower `ast::PatKind::Rest` in combination with the aforementioned `PatKind` variants as well as `PatKind::Ident`. The HIR remains unchanged for now (may be advisable to make slight adjustments later).

- Refactor `parser.rs` wrt. parsing sequences and lists of things in the process.

- Add parser recovery for range patterns of form `X..`, `X..=`, `X...`, `..Y`, `..=Y`, and `...Y`.
   This should make it easy to actually support these patterns semantically later if we so desire.

cc https://github.com/rust-lang/rust/issues/62254

r? @petrochenkov

4 years agoAllow rustbot to add `F-*` + `requires-nightly`.
Mazdak Farrokhzad [Sun, 28 Jul 2019 08:29:38 +0000 (10:29 +0200)]
Allow rustbot to add `F-*` + `requires-nightly`.

4 years agoMove to src/test/ui/match/
Yuki Okushi [Sun, 28 Jul 2019 07:51:21 +0000 (16:51 +0900)]
Move to src/test/ui/match/

4 years agoAdd test for issue-50900
Yuki Okushi [Sun, 28 Jul 2019 07:26:01 +0000 (16:26 +0900)]
Add test for issue-50900

4 years agoborrowck-describe-lvalue: --bless --compare-mode=nll.
Mazdak Farrokhzad [Sun, 28 Jul 2019 05:04:16 +0000 (07:04 +0200)]
borrowck-describe-lvalue: --bless --compare-mode=nll.

4 years agoAnd --bless tests accordingly for those exceptions.
Mazdak Farrokhzad [Wed, 24 Jul 2019 02:01:38 +0000 (04:01 +0200)]
And --bless tests accordingly for those exceptions.

4 years agoAdd exceptions for ExprKind::Err/TyKind::Error.
Mazdak Farrokhzad [Wed, 24 Jul 2019 02:01:12 +0000 (04:01 +0200)]
Add exceptions for ExprKind::Err/TyKind::Error.

4 years agoAddress comments re. off-topic errors.
Mazdak Farrokhzad [Wed, 24 Jul 2019 00:30:37 +0000 (02:30 +0200)]
Address comments re. off-topic errors.

4 years agoAddress comments in lowering + parsing.
Mazdak Farrokhzad [Wed, 24 Jul 2019 00:00:46 +0000 (02:00 +0200)]
Address comments in lowering + parsing.

4 years agoUse AstP more in lowering.
Mazdak Farrokhzad [Thu, 11 Jul 2019 14:11:09 +0000 (16:11 +0200)]
Use AstP more in lowering.

4 years agoUpdate error_codes.rs with new subslice syntax.
Mazdak Farrokhzad [Wed, 10 Jul 2019 16:53:39 +0000 (18:53 +0200)]
Update error_codes.rs with new subslice syntax.

4 years ago--bless tests after rebase.
Mazdak Farrokhzad [Wed, 10 Jul 2019 14:18:01 +0000 (16:18 +0200)]
--bless tests after rebase.

4 years agoGet out of bootstrapping pickle.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:18:01 +0000 (05:18 +0200)]
Get out of bootstrapping pickle.

4 years agoAdjust documentation in HAIR.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:17:26 +0000 (05:17 +0200)]
Adjust documentation in HAIR.

4 years agoUpdate unstable book wrt. subslice patterns.
Mazdak Farrokhzad [Wed, 10 Jul 2019 03:16:47 +0000 (05:16 +0200)]
Update unstable book wrt. subslice patterns.

4 years agoWin some lose some; Unfortunately we lost recovery in one case.
Mazdak Farrokhzad [Mon, 8 Jul 2019 13:35:56 +0000 (15:35 +0200)]
Win some lose some; Unfortunately we lost recovery in one case.

4 years ago(pat, ..,) is now syntactically legal.
Mazdak Farrokhzad [Mon, 8 Jul 2019 01:03:12 +0000 (03:03 +0200)]
(pat, ..,) is now syntactically legal.

4 years agoAccount for better recovery in two cases.
Mazdak Farrokhzad [Tue, 9 Jul 2019 04:30:03 +0000 (06:30 +0200)]
Account for better recovery in two cases.

4 years agoIntersection patterns 'p1 @ p2' are not supported.
Mazdak Farrokhzad [Mon, 8 Jul 2019 00:06:49 +0000 (02:06 +0200)]
Intersection patterns 'p1 @ p2' are not supported.

4 years ago--bless tests due to new subslice syntax.
Mazdak Farrokhzad [Sun, 7 Jul 2019 23:58:28 +0000 (01:58 +0200)]
--bless tests due to new subslice syntax.

4 years agoUse new 'p @ ..' syntax in tests.
Mazdak Farrokhzad [Sun, 7 Jul 2019 23:47:46 +0000 (01:47 +0200)]
Use new 'p @ ..' syntax in tests.

4 years agoTest parsing and recovery of all sorts of range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 23:50:54 +0000 (01:50 +0200)]
Test parsing and recovery of all sorts of range patterns.

4 years agoAnd also --bless those recovery tests.
Mazdak Farrokhzad [Tue, 9 Jul 2019 06:44:56 +0000 (08:44 +0200)]
And also --bless those recovery tests.

4 years agoUpdate tests wrt. recovery of range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 06:44:46 +0000 (08:44 +0200)]
Update tests wrt. recovery of range patterns.

4 years agoRecover on 'X..' / 'X..=' / 'X...' range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 04:06:41 +0000 (06:06 +0200)]
Recover on 'X..' / 'X..=' / 'X...' range patterns.

4 years agoRecover on '..X' / '..=X' / '...X' range patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 01:55:13 +0000 (03:55 +0200)]
Recover on '..X' / '..=X' / '...X' range patterns.

4 years agoAdjust parsing of Slice, Tuple, TupleStruct patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:36:14 +0000 (10:36 +0200)]
Adjust parsing of Slice, Tuple, TupleStruct patterns.

4 years agoCleanup using the new parse_*_seq methods.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:34:53 +0000 (10:34 +0200)]
Cleanup using the new parse_*_seq methods.

4 years agoAdd more parse_*_seq methods for code reuse.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:31:24 +0000 (10:31 +0200)]
Add more parse_*_seq methods for code reuse.

4 years agoCleanup parse_seq_* methods + record trailing separators.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:27:07 +0000 (10:27 +0200)]
Cleanup parse_seq_* methods + record trailing separators.

4 years agoAdjust lowering of Slice patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:03:30 +0000 (10:03 +0200)]
Adjust lowering of Slice patterns.
- Make sure extra `x @ ..` do not cause ICEs.

4 years agoAdjust lowering of Tuple/TupleStruct patterns.
Mazdak Farrokhzad [Tue, 9 Jul 2019 08:11:21 +0000 (10:11 +0200)]
Adjust lowering of Tuple/TupleStruct patterns.
- Make sure we ban duplicate '..'.
- Avoid ICEs on PatKind::Rest that doesn't generate HIR nodes.

4 years agoAdjust and document 'Pat::to_ty' accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:23:51 +0000 (09:23 +0200)]
Adjust and document 'Pat::to_ty' accordingly.

4 years agoAdjust pretty printing accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:12:14 +0000 (09:12 +0200)]
Adjust pretty printing accordingly.

4 years agoAdjust feature gating of subslice patterns accordingly.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:12:49 +0000 (09:12 +0200)]
Adjust feature gating of subslice patterns accordingly.

4 years agoAdjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:25:18 +0000 (09:25 +0200)]
Adjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'.

4 years agoIntroduce 'ast::Pat::is_rest(&self) -> bool'.
Mazdak Farrokhzad [Tue, 9 Jul 2019 07:26:11 +0000 (09:26 +0200)]
Introduce 'ast::Pat::is_rest(&self) -> bool'.

4 years agoAdd 'ast::PatKind::Rest'.
Mazdak Farrokhzad [Sat, 6 Jul 2019 22:26:55 +0000 (00:26 +0200)]
Add 'ast::PatKind::Rest'.

4 years agoAdd tests for Vec(Deque) array PartialEq impls.
Mazdak Farrokhzad [Sun, 28 Jul 2019 04:46:41 +0000 (06:46 +0200)]
Add tests for Vec(Deque) array PartialEq impls.

4 years agoUse const generics for some VecDeque impls.
Mazdak Farrokhzad [Sun, 28 Jul 2019 03:12:16 +0000 (05:12 +0200)]
Use const generics for some VecDeque impls.

4 years agoUse const generics for some Vec/CCow impls.
Mazdak Farrokhzad [Sun, 28 Jul 2019 03:06:20 +0000 (05:06 +0200)]
Use const generics for some Vec/CCow impls.

4 years agoreview comments
Esteban Küber [Sun, 28 Jul 2019 02:12:00 +0000 (19:12 -0700)]
review comments

4 years agoAuto merge of #63057 - Centril:rollup-z3a3c6v, r=Centril
bors [Sun, 28 Jul 2019 01:03:16 +0000 (01:03 +0000)]
Auto merge of #63057 - Centril:rollup-z3a3c6v, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #61207 (Allow lifetime elision in `Pin<&(mut) Self>`)
 - #62074 (squash of all commits for nth_back on ChunksMut)
 - #62771 (Break dependencies between `syntax_ext` and other crates)
 - #62883 (Refactoring use common code between option, result and accum)
 - #62949 (Re-enable assertions in PPC dist builder)
 - #62996 (tidy: Add a check for inline unit tests)
 - #63038 (Make more informative error on outer attribute after inner)
 - #63050 (ci: download awscli from our mirror)

Failed merges:

r? @ghost

4 years agoRollup merge of #63050 - pietroalbini:vendor-awscli, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:55 +0000 (03:01 +0200)]
Rollup merge of #63050 - pietroalbini:vendor-awscli, r=Mark-Simulacrum

ci: download awscli from our mirror

This fixes multiple network issues we had when downloading awscli from PyPI on Azure Pipelines by vendoring awscli itself and its dependencies in our S3 bucket. Instructions on how to update the cache are present at the top of `src/ci/install-awscli.sh`.

r? @alexcrichton or @Mark-Simulacrum
fixes #62967

4 years agoRollup merge of #63038 - eupn:outer-attribute-diag, r=estebank
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:53 +0000 (03:01 +0200)]
Rollup merge of #63038 - eupn:outer-attribute-diag, r=estebank

Make more informative error on outer attribute after inner

Fixes #61218.

?r @estebank

4 years agoRollup merge of #62996 - petrochenkov:outest, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:51 +0000 (03:01 +0200)]
Rollup merge of #62996 - petrochenkov:outest, r=Mark-Simulacrum

tidy: Add a check for inline unit tests

As described in https://github.com/rust-lang/rust/issues/61097.

There's a large whitelist right now, because in many crates the tests are not outlined yet.
~This PR only outlines tests in one crate (`rustc_lexer`) as an example.~

r? @Mark-Simulacrum

4 years agoRollup merge of #62949 - mati865:patch-1, r=alexcrichton
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:50 +0000 (03:01 +0200)]
Rollup merge of #62949 - mati865:patch-1, r=alexcrichton

Re-enable assertions in PPC dist builder

Fixes https://github.com/rust-lang/rust/issues/36150

Log of successful build:
https://dev.azure.com/mati865/6518b167-4cf6-4587-b3d1-8e137f2fb2e4/_apis/build/builds/23/logs/825

4 years agoRollup merge of #62883 - Stargateur:refactoring-adapters, r=scottmcm
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:48 +0000 (03:01 +0200)]
Rollup merge of #62883 - Stargateur:refactoring-adapters, r=scottmcm

Refactoring use common code between option, result and accum

`Option` and `Result` have almost exactly the same code that in `accum.rs` that implement `Sum` and `Product`. This PR just move some code to use the same code for all of them. I believe is better to not implement this `Iterator` feature twice.

I'm not very familiar with pub visibility hope I didn't make then public. However, maybe these adapters could be useful and we could think to make then pub.

#59605
#11084

r? @pnkfelix

4 years agoRollup merge of #62771 - petrochenkov:depext, r=eddyb
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:46 +0000 (03:01 +0200)]
Rollup merge of #62771 - petrochenkov:depext, r=eddyb

Break dependencies between `syntax_ext` and other crates

Move `source_util` macros into `syntax_ext`.
Move other early code generation facilities like standard library injection into `syntax_ext`.

The only crate that depends on `syntax_ext` now is `rustc_interface` which is one of the "final" crates that depend on everything.

Minor: Cleanup dependencies of `rustc_driver`, many of them are no longer used after introduction of `rustc_interface`.

r? @eddyb

4 years agoRollup merge of #62074 - wizAmit:feature/mut_chunks_nth_back, r=scottmcm
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:44 +0000 (03:01 +0200)]
Rollup merge of #62074 - wizAmit:feature/mut_chunks_nth_back, r=scottmcm

squash of all commits for nth_back on ChunksMut

wip nth_back for chunks_mut

working chunksmut

fixed nth_back for chunksmut

Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
r? @timvermeulen
r? @scottmcm

4 years agoRollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
Mazdak Farrokhzad [Sun, 28 Jul 2019 01:01:42 +0000 (03:01 +0200)]
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril

Allow lifetime elision in `Pin<&(mut) Self>`

This PR changes `self: &(mut) S` elision rules to instead visit the type of `self` and look for `&(mut) S` (where `is_self_ty(S)`) within it

Replaces #60944

Closes #52675

r? @eddyb
cc @cramertj @Centril @withoutboats @scottmcm

4 years agoAvoid ICE when referencing desugared local binding in borrow error
Esteban Küber [Sat, 27 Jul 2019 20:23:34 +0000 (13:23 -0700)]
Avoid ICE when referencing desugared local binding in borrow error

4 years agoci: download awscli from our mirror
Pietro Albini [Sat, 27 Jul 2019 20:18:40 +0000 (22:18 +0200)]
ci: download awscli from our mirror

This fixes multiple network issues we had when downloading awscli from
PyPI on Azure Pipelines by vendoring awscli itself and its dependencies
in our S3 bucket. Instructions on how to update the cache are present at
the top of src/ci/install-awscli.sh

4 years agoAuto merge of #63029 - petrochenkov:rpass, r=Centril
bors [Sat, 27 Jul 2019 19:27:36 +0000 (19:27 +0000)]
Auto merge of #63029 - petrochenkov:rpass, r=Centril

Move run-pass tests to ui

This is the second attempt at doing https://github.com/rust-lang/rust/pull/53994 (which was previously reverted in https://github.com/rust-lang/rust/pull/54530).

The issue with inability to run the test suite in a faster way (https://github.com/rust-lang/rust/issues/54047) that motivated the revert was recently addressed by https://github.com/rust-lang/rust/pull/61755.

r? @Centril

4 years agotidy: Add a check for inline unit tests and benchmarks
Vadim Petrochenkov [Fri, 26 Jul 2019 00:01:18 +0000 (03:01 +0300)]
tidy: Add a check for inline unit tests and benchmarks

4 years agosubmodules: update clippy from 164310dd to dc69a5c0
Matthias Krüger [Sat, 27 Jul 2019 17:40:28 +0000 (19:40 +0200)]
submodules: update clippy from 164310dd to dc69a5c0

Changes:
````
ci: temporarily disable rustfmt checks/tetss since it's broken for nightly
rustup https://github.com/rust-lang/rust/pull/62964
Bump version of clippy_dummy
update test stderr, not sure which rustc pull request caused this.
rustup https://github.com/rust-lang/rust/pull/62859
Fix tests for edition 2018 compatibility
Revert "Revert global fmt config and use `rustfmt::skip`"
Fix breakage due to rust-lang/rust#60913
Fix breakage due to rust-lang/rust#62705
Revert global fmt config and use `rustfmt::skip`
Fix fmt
rustup https://github.com/rust-lang/rust/pull/62679/
Update pulldown-cmark to 0.5.3
rustup https://github.com/rust-lang/rust/pull/62764
Add test
Format code
Decrease maximum length for stderr files
Improved imports
Fix "unkown clippy lint" error in UI test.
Corrections for PR review.
Implement lint for inherent to_string() method.
UI Test Cleanup: Extract match_ref_pats tests
Update UI tests
Allow no_effect lint
Remove comment
cargo fmt
UI Test Cleanup: Split up checked_unwrap tests
Removed lintining on never type.
UI Test Cleanup: Split out out_of_bounds_indexing
false positives fixes of `implicit_return`
Ignore generated fresh lifetimes in elision check.
````

4 years agoFix issues with git converting CRLF to CR
Vadim Petrochenkov [Sat, 27 Jul 2019 10:47:26 +0000 (13:47 +0300)]
Fix issues with git converting CRLF to CR

UI tests now run on asmjs-unknown-emscripten, ignore tests with inline assembly which is not supported on emscripten targets

4 years agoRemove run-pass test suites
Vadim Petrochenkov [Fri, 26 Jul 2019 23:26:27 +0000 (02:26 +0300)]
Remove run-pass test suites

4 years agotests: Move run-pass tests with naming conflicts to ui
Vadim Petrochenkov [Fri, 26 Jul 2019 23:07:23 +0000 (02:07 +0300)]
tests: Move run-pass tests with naming conflicts to ui

4 years agotests: Move run-pass tests without naming conflicts to ui
Vadim Petrochenkov [Fri, 26 Jul 2019 22:33:01 +0000 (01:33 +0300)]
tests: Move run-pass tests without naming conflicts to ui

4 years agotests: Add missing run-pass annotations
Vadim Petrochenkov [Fri, 26 Jul 2019 21:54:25 +0000 (00:54 +0300)]
tests: Add missing run-pass annotations

4 years agoAuto merge of #63043 - Centril:rollup-f4baee4, r=Centril
bors [Sat, 27 Jul 2019 15:41:45 +0000 (15:41 +0000)]
Auto merge of #63043 - Centril:rollup-f4baee4, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #62423 (Fix cycle error with existential types)
 - #62979 (Cleanup save-analysis JsonDumper)
 - #62982 (Don't access a static just for its size and alignment)
 - #63013 (add `repr(transparent)` to `IoSliceMut` where missing)
 - #63014 (Stop bare trait lint applying to macro call sites)
 - #63036 (Add lib section to rustc_lexer's Cargo.toml)

Failed merges:

r? @ghost

4 years agoRollup merge of #63036 - topecongiro:add-lib-section, r=matklad
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:52 +0000 (17:40 +0200)]
Rollup merge of #63036 - topecongiro:add-lib-section, r=matklad

Add lib section to rustc_lexer's Cargo.toml

This is required to fix the rustc-ap-syntax build error in the recent version. The error could also be fixed on the [rustc-auto-publish](https://github.com/alexcrichton/rustc-auto-publish) side by manually adding `[lib]` section if one does not exist. The latter approach, however, may have a surprising side effect, so I am opting for a simpler solution for now.

r? @alexcrichton

4 years agoRollup merge of #63014 - davidtwco:rustfix-incorrect-dyn-suggestion, r=estebank
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:51 +0000 (17:40 +0200)]
Rollup merge of #63014 - davidtwco:rustfix-incorrect-dyn-suggestion, r=estebank

Stop bare trait lint applying to macro call sites

Fixes #61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way.

r? @estebank

4 years agoRollup merge of #63013 - nivkner:ffi-safe-slice, r=sfackler
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:49 +0000 (17:40 +0200)]
Rollup merge of #63013 - nivkner:ffi-safe-slice, r=sfackler

add `repr(transparent)` to `IoSliceMut` where missing

tried using `IoSliceMut` in FFI, got `improper_ctypes` warning.

according to the docs: `IoSliceMut` is  "guaranteed to be ABI compatible with the `iovec` type" so it should be usable in FFI.
`IoSlice` is also `repr(transparent)` for every platform where these types contain `iovec`-like types.
vxworks also has `IoSliceMut` as transparent so its not even consistently one or the other.

no comment about this next to the types or in the PR that introduced the types, so assuming this was just missed.

r? @sfackler

4 years agoRollup merge of #62982 - oli-obk:static_cycle, r=RalfJung
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:48 +0000 (17:40 +0200)]
Rollup merge of #62982 - oli-obk:static_cycle, r=RalfJung

Don't access a static just for its size and alignment

cc @RalfJung

fixes #62189

4 years agoRollup merge of #62979 - Mark-Simulacrum:json-dumper-pretty, r=Xanewok
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:46 +0000 (17:40 +0200)]
Rollup merge of #62979 - Mark-Simulacrum:json-dumper-pretty, r=Xanewok

Cleanup save-analysis JsonDumper

4 years agoRollup merge of #62423 - Aaron1011:fix/existential-cycle, r=oli-obk
Mazdak Farrokhzad [Sat, 27 Jul 2019 15:40:45 +0000 (17:40 +0200)]
Rollup merge of #62423 - Aaron1011:fix/existential-cycle, r=oli-obk

Fix cycle error with existential types

Fixes #61863

We now allow uses of `existential type`'s that aren't defining uses - that is, uses which don't constrain the underlying concrete type.

To make this work correctly, we also modify `eq_opaque_type_and_type` to not try to apply additional constraints to an opaque type. If we have code like this:

```rust
existential type Foo;
fn foo1() -> Foo { ... }
fn foo2() -> Foo { foo1() }
```

then `foo2` doesn't end up constraining `Foo`, which means that `foo2` will end up using the type `Foo` internally - that is, an actual `TyKind::Opaque`. We don't want to equate this to the underlying concrete type - we just need to enforce the basic equality constraint between the two types (here, the return type of `foo1` and the return type of `foo2`)

4 years agotidy: Fix a regression in `#[test]` detection in libcore
Vadim Petrochenkov [Thu, 25 Jul 2019 22:22:59 +0000 (01:22 +0300)]
tidy: Fix a regression in `#[test]` detection in libcore

`contents` is the whole file rather than a single line.

4 years agotidy: libcoretest.rs -> unit_tests.rs
Vadim Petrochenkov [Thu, 25 Jul 2019 22:18:35 +0000 (01:18 +0300)]
tidy: libcoretest.rs -> unit_tests.rs

4 years agoAdd comment
topecongiro [Sat, 27 Jul 2019 13:10:09 +0000 (22:10 +0900)]
Add comment

4 years agoFix ui/parser/attr test
Evgenii P [Sat, 27 Jul 2019 12:35:55 +0000 (19:35 +0700)]
Fix ui/parser/attr test

4 years agoFix failing UI tests
Evgenii P [Sat, 27 Jul 2019 11:24:48 +0000 (18:24 +0700)]
Fix failing UI tests

4 years agoTreat doc comments separately
Evgenii P [Sat, 27 Jul 2019 11:24:17 +0000 (18:24 +0700)]
Treat doc comments separately

4 years agosyntax_ext: `proc_macro_decls` -> `proc_macro_harness`
Vadim Petrochenkov [Thu, 18 Jul 2019 20:29:57 +0000 (23:29 +0300)]
syntax_ext: `proc_macro_decls` -> `proc_macro_harness`

Few other minor renamings for consistency.
Remove one unused dependency from `rustc_passes`.
Fix libsyntax tests.
Fix rebase.

4 years agoMove standard library injection into libsyntax_ext
Vadim Petrochenkov [Thu, 18 Jul 2019 19:29:07 +0000 (22:29 +0300)]
Move standard library injection into libsyntax_ext

4 years agoMove test harness generation into libsyntax_ext
Vadim Petrochenkov [Thu, 18 Jul 2019 18:29:15 +0000 (21:29 +0300)]
Move test harness generation into libsyntax_ext

4 years agoMove proc macro server into libsyntax
Vadim Petrochenkov [Thu, 18 Jul 2019 18:02:34 +0000 (21:02 +0300)]
Move proc macro server into libsyntax

4 years agoBreak dependencies between `syntax_ext` and some other crates
Vadim Petrochenkov [Wed, 17 Jul 2019 22:49:10 +0000 (01:49 +0300)]
Break dependencies between `syntax_ext` and some other crates

Move `source_uitil` macros into `syntax_ext`
Cleanup dependencies of `rustc_driver`

4 years agoMake more informative error on outer attr after inner
Evgenii P [Sat, 27 Jul 2019 09:45:45 +0000 (16:45 +0700)]
Make more informative error on outer attr after inner

4 years agoAuto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
bors [Sat, 27 Jul 2019 09:32:44 +0000 (09:32 +0000)]
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung

Optimize RefCell read borrowing

Instead of doing two comparisons we can do only one with a bit of cleverness.

LLVM currently can't do this optimization itself on x86-64.

4 years agoAdd lib section to rustc_lexer's Cargo.toml
topecongiro [Sat, 27 Jul 2019 08:21:42 +0000 (17:21 +0900)]
Add lib section to rustc_lexer's Cargo.toml

4 years agoarbitrary_self_types lifetime elision: --bless --compare-mode=nll
Taiki Endo [Sat, 27 Jul 2019 03:35:05 +0000 (12:35 +0900)]
arbitrary_self_types lifetime elision: --bless --compare-mode=nll

4 years agoFix typo
Taiki Endo [Fri, 26 Jul 2019 06:41:00 +0000 (15:41 +0900)]
Fix typo

4 years agoAdd tests for `self: (&)AssocType`
Taiki Endo [Fri, 26 Jul 2019 06:20:04 +0000 (15:20 +0900)]
Add tests for `self: (&)AssocType`

4 years agoAdd test for multiple ref-self
Taiki Endo [Mon, 15 Jul 2019 16:09:25 +0000 (01:09 +0900)]
Add test for multiple ref-self

4 years agoMinor clean up
Taiki Endo [Mon, 15 Jul 2019 15:48:28 +0000 (00:48 +0900)]
Minor clean up