Commit Graph

96957 Commits

Author SHA1 Message Date
Vadim Petrochenkov
676d282dd3 Deny unused_lifetimes through rustbuild 2019-07-28 18:47:02 +03:00
Vadim Petrochenkov
434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
bors
023525dbda 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
2019-07-28 12:50:34 +00:00
Matthew Jasper
8876b3b9b0 Resolve const parameters with modern hygiene
Declarations were already modernized, resulting in cases where a macro
couldn't resolve it's own identifier.
2019-07-28 13:34:03 +01:00
Matthew Jasper
3dca17e62d Disallow duplicate lifetime parameters with legacy hygiene
They were resolved with modern hygiene, making this just a strange way
to shadow lifetimes.
2019-07-28 13:33:51 +01:00
Vadim Petrochenkov
61729b3bf0 tidy: Cleanup the directory whitelist 2019-07-28 15:07:16 +03:00
Ralf Jung
c119291b55 get_size_and_align: fix handling of function pointers 2019-07-28 13:26:28 +02:00
Vadim Petrochenkov
b92697b8fb cleanup: Remove some language features related to built-in macros
They are now library features.
2019-07-28 14:14:48 +03:00
Ralf Jung
828e7b685a miri: add get and get_mut to AllocMap; use that in get_size_and_align and avoid rightwards drift 2019-07-28 12:58:39 +02:00
Kornel
55c07b39ae SystemTime docs: recommend Instant for elapsed time 2019-07-28 11:08:39 +01:00
bors
0cfb2f7fbd 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
2019-07-28 09:12:04 +00:00
Mazdak Farrokhzad
370aa19f28
Rollup merge of #63071 - rust-lang:some-new-labels, r=pietroalbini
Allow rustbot to add `F-*` + `requires-nightly`.

r? @pietroalbini
2019-07-28 11:11:16 +02:00
Mazdak Farrokhzad
d17ad1b069
Rollup merge of #63067 - JohnTitor:test-for-50900, r=Centril
Add test for issue-50900

Closes #50900
2019-07-28 11:11:15 +02:00
Mazdak Farrokhzad
4b3a017b35
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
2019-07-28 11:11:14 +02:00
Mazdak Farrokhzad
a558668cf2
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
```
2019-07-28 11:11:12 +02:00
Mazdak Farrokhzad
48802974aa
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).
2019-07-28 11:11:10 +02:00
Mazdak Farrokhzad
b405aa2d03
Rollup merge of #62806 - mati865:clippy, r=TimNN
Fix few Clippy warnings
2019-07-28 11:11:08 +02:00
Mazdak Farrokhzad
2826bdcfa6
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
2019-07-28 11:11:06 +02:00
Mazdak Farrokhzad
75e23ff411
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
2019-07-28 11:11:04 +02:00
Mazdak Farrokhzad
84c6d3088e
Allow rustbot to add F-* + requires-nightly. 2019-07-28 10:29:38 +02:00
Yuki Okushi
15307ca993 Move to src/test/ui/match/ 2019-07-28 16:51:21 +09:00
Yuki Okushi
29a00ef4a6 Add test for issue-50900 2019-07-28 16:26:01 +09:00
Mazdak Farrokhzad
d33696fcb4 borrowck-describe-lvalue: --bless --compare-mode=nll. 2019-07-28 07:04:16 +02:00
Mazdak Farrokhzad
87742073a0 And --bless tests accordingly for those exceptions. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
18ccd6a33c Add exceptions for ExprKind::Err/TyKind::Error. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
5f4dd1d19a Address comments re. off-topic errors. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
becdba80ea Address comments in lowering + parsing. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
397a027aa7 Use AstP more in lowering. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
59b5dae918 Update error_codes.rs with new subslice syntax. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
acc6a6d8cb --bless tests after rebase. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
1060513ddc Get out of bootstrapping pickle. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
984f9db946 Adjust documentation in HAIR. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
cec8649933 Update unstable book wrt. subslice patterns. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
7c0b1da2c1 Win some lose some; Unfortunately we lost recovery in one case. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
e3cdadd73f (pat, ..,) is now syntactically legal. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
06e5ae5c82 Account for better recovery in two cases. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
e725ea2215 Intersection patterns 'p1 @ p2' are not supported. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
91c8b53f45 --bless tests due to new subslice syntax. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
75da43dc87 Use new 'p @ ..' syntax in tests. 2019-07-28 06:53:39 +02:00
Mazdak Farrokhzad
891a736b02 Test parsing and recovery of all sorts of range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
f6c8234f9f And also --bless those recovery tests. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
2411134c78 Update tests wrt. recovery of range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
2f55354759 Recover on 'X..' / 'X..=' / 'X...' range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
974413fcc5 Recover on '..X' / '..=X' / '...X' range patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
62b29a1e17 Adjust parsing of Slice, Tuple, TupleStruct patterns. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
7e1b671f8a Cleanup using the new parse_*_seq methods. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
7aeb4b7327 Add more parse_*_seq methods for code reuse. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
0a40ef23ad Cleanup parse_seq_* methods + record trailing separators. 2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
694b3c3ef2 Adjust lowering of Slice patterns.
- Make sure extra `x @ ..` do not cause ICEs.
2019-07-28 06:53:38 +02:00
Mazdak Farrokhzad
d5df1e0b0f Adjust lowering of Tuple/TupleStruct patterns.
- Make sure we ban duplicate '..'.
- Avoid ICEs on PatKind::Rest that doesn't generate HIR nodes.
2019-07-28 06:53:38 +02:00