Commit graph

98487 commits

Author SHA1 Message Date
bors
9267119019 Auto merge of #63873 - Centril:rollup-jgglypd, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #62744 (Refactor `TinyList::contains` and `len` to iterate instead of recurse)
 - #63813 (Do not suggest `.try_into()` on `i32::from(x)`)
 - #63833 (Suggest calling closure with resolved return type when appropriate)
 - #63839 (Ensure miri can do bit ops on pointer values)
 - #63854 (Modifies how Arg, Arm, Field, FieldPattern and Variant are visited)
 - #63859 (Don't unwrap the result of `span_to_snippet`)

Failed merges:

r? @ghost
2019-08-25 00:47:28 +00:00
Mazdak Farrokhzad
4d3d06ae53
Rollup merge of #63859 - matthewjasper:check-snippet-result, r=Centril
Don't unwrap the result of `span_to_snippet`

Closes #63800
2019-08-25 02:45:05 +02:00
Mazdak Farrokhzad
b0d374a0b1
Rollup merge of #63854 - c410-f3r:attrs-visit, r=petrochenkov
Modifies how Arg, Arm, Field, FieldPattern and Variant are visited

Part of the necessary work to accomplish #63468.
2019-08-25 02:45:04 +02:00
Mazdak Farrokhzad
7059f0571a
Rollup merge of #63839 - oli-obk:intptrcast, r=RalfJung
Ensure miri can do bit ops on pointer values

r? @RalfJung

Fixes https://github.com/rust-lang/miri/issues/916
2019-08-25 02:45:02 +02:00
Mazdak Farrokhzad
3d4b1135f8
Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkov
Suggest calling closure with resolved return type when appropriate

Follow up to #63337. CC #63100.

```
error[E0308]: mismatched types
  --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
   |
LL |     let closure = || 42;
   |                   -- closure defined here
LL |     let _: usize = closure;
   |                    ^^^^^^^
   |                    |
   |                    expected usize, found closure
   |                    help: use parentheses to call this closure: `closure()`
   |
   = note: expected type `usize`
              found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
```
2019-08-25 02:45:01 +02:00
Mazdak Farrokhzad
ed8e13c2cb
Rollup merge of #63813 - estebank:int-from, r=varkor
Do not suggest `.try_into()` on `i32::from(x)`

Fix #63697.
2019-08-25 02:44:59 +02:00
Mazdak Farrokhzad
5761fc759a
Rollup merge of #62744 - llogiq:tiny-list-refactor, r=eddyb
Refactor `TinyList::contains` and `len` to iterate instead of recurse

None
2019-08-25 02:44:58 +02:00
Mazdak Farrokhzad
083963e58c parser: 'while parsing this or-pattern...' 2019-08-25 01:50:21 +02:00
Mazdak Farrokhzad
1202cb0e2b parser: simplify parse_pat_with_or_{inner} 2019-08-25 01:00:19 +02:00
Mazdak Farrokhzad
5a7e1cb46a typeck/pat.rs: dedup in check_pat_box. 2019-08-25 00:27:55 +02:00
Mazdak Farrokhzad
4f75327659 typeck/pat.rs: dedup in check_pat_ref. 2019-08-25 00:08:47 +02:00
Esteban Küber
3890befa8e review comment 2019-08-24 14:54:35 -07:00
Mazdak Farrokhzad
0ab8430332 parser: reword || recovery. 2019-08-24 23:44:28 +02:00
Mazdak Farrokhzad
e3747722fb parser: extract recover_inner_leading_vert. 2019-08-24 23:10:46 +02:00
Mazdak Farrokhzad
3a405421e7 parse_top_pat: silence leading vert gating sometimes. 2019-08-24 23:05:04 +02:00
Mazdak Farrokhzad
a9ef8592e4 parser: bool -> TopLevel. 2019-08-24 22:48:23 +02:00
Mazdak Farrokhzad
b2966e651d parser: bool -> GateOr. 2019-08-24 22:29:57 +02:00
Mazdak Farrokhzad
b205055c7b parser: better recovery for || in inner pats. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
1ffea18ddb or-patterns: harden feature gating tests. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
d3b3bceffb move feature-gate-or_patterns.* -> ui/or-patterns/ 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
f35432e188 or-patterns: add syntactic tests. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
a9af18bed5 move ui/or-pattern-mismatch -> ui/or-patterns/. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
5f6bec8ecf parser: drive-by: simplify parse_arg_general. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
95792b4d5a parser: let stmts & for exprs: allow or-patterns. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
92d66a1317 parser: document parse_pat. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
b7178ef983 parser: parse_pats -> parse_top_pat{_unpack}. 2019-08-24 21:53:55 +02:00
Mazdak Farrokhzad
8f6a0cdb0f parser: document ban_unexpected_or_or. 2019-08-24 21:32:49 +02:00
Mazdak Farrokhzad
39f5e5bec4 parser: move maybe_recover_unexpected_comma to a more appropriate place. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
6498959377 parser: use eat_or_separator for leading vert. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
dc5bbaf7b2 parser: improve parse_pat_with_or docs. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
7b59b4f14d parser: extract eat_or_separator. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
a4a34ab62d parser: integrate maybe_recover_unexpected_comma in parse_pat_with_or. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
21d9b85c0d parser: extract maybe_recover_unexpected_comma. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
f852c7ce1c parser: simplify parse_pat_with_or. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
5f57feec0a parser: multiple-pattern-typo: cover more or-pattern places. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
d34ee769b0 parser: move multiple-pattern-typo -> or-patterns directory. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
30b841dce0 parser: improve or-patterns recovery. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
0bbea47794 parser: refactor parse_pat_with_or + use it in [p0, p1, ..] pats. 2019-08-24 21:32:48 +02:00
Mazdak Farrokhzad
1ba7550a89 parser: type alias type Expected = Option<&'static str>;. 2019-08-24 21:31:54 +02:00
Mazdak Farrokhzad
5299d8a191 parser: extract ban_unexpected_or_or. 2019-08-24 21:31:54 +02:00
Edd Barrett
a4b3dbe4c1 Improve the documentation for std::hint::black_box. 2019-08-24 19:00:13 +01:00
Mazdak Farrokhzad
5fbfcd8872 typeck/pat.rs: extract error_inexistent_fields. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
ba2a784c38 typeck/pat.rs: extract error_unmentioned_fields. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
25f605ae99 typeck/pat.rs: extract error_field_already_bound. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
729fbeb70b typeck/pat.rs: extract diagnostics from check_pat_slice. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
2ab69aef03 typeck/pat.rs: extract new_ref_ty. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
97986b5704 typeck/pat.rs: some common imports. 2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
41e8aed3cf typeck/pat.rs: check_pat_walk -> check_pat.
It's just shorter and we usually don't use the `_walk` suffix.
2019-08-24 19:57:05 +02:00
Mazdak Farrokhzad
65deeae76d typeck/pat.rs: check_pat_top is the entry point.
This clarifies the fact that type checking patterns unconditionally
starts with `BindByValue` as the default binding mode making the
notion of a default binding mode internal to type checking patterns.
2019-08-24 19:56:56 +02:00
bors
eeba189cfb Auto merge of #63858 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from cd3df6be to 2bcb6155

Changes:
````
Refactor some minor things
Use more if-chains
Refactor 'lint_or_fun_call'
Refactor 'check_unwrap_or_default'
Refactor 'check_impl_item'
Add missing field to LitKind::Str
Run update_lints for Unicode lint
Re-add false positive check
Add raw string regression test for useless_format lint
Re-factor useless_format lint
Update Unicode lint tests
Add two more tests, allow 2 other lints.
Fix `temporary_cstring_as_ptr` false negative
Add more testcases for redundant_pattern_matching
Fix suggestions for redundant_pattern_matching
Add note on how to find the latest beta commit
Remove feature gate for async_await
Update if_chain doc link
Requested test cleanup
Requested changes
Ignore lines starting with '#'
run-rustfix for unseparated-prefix-literals
Add autofixable suggestion for unseparated integer literal suffices
Further text improvements
Add image
docs: Explain how to update the changelog
````

r? @oli-obk  @Manishearth
2019-08-24 17:49:35 +00:00