Commit Graph

98032 Commits

Author SHA1 Message Date
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
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
Mazdak Farrokhzad
9d69783a46 typeck/pat.rs: (*) -> (note_1) for clarity. 2019-08-24 19:15:52 +02:00
Mazdak Farrokhzad
862bb385d1 typeck/pat.rs: simplify check_pat_walk. 2019-08-24 19:15:47 +02:00
Mazdak Farrokhzad
f09f1a7139 typeck/pat.rs: extract check_pat_slice. 2019-08-24 19:15:42 +02:00
Mazdak Farrokhzad
b4a4e718de typeck/pat.rs: extract check_pat_ref. 2019-08-24 19:15:36 +02:00
Mazdak Farrokhzad
3de221a862 typeck/pat.rs: extract check_pat_box. 2019-08-24 19:15:31 +02:00
Mazdak Farrokhzad
3a51caa648 typeck/pat.rs: extract check_pat_tuple. 2019-08-24 19:15:26 +02:00
Mazdak Farrokhzad
c16248d3a1 typeck/pat.rs: extract check_pat_ident. 2019-08-24 19:15:21 +02:00
Mazdak Farrokhzad
d4afae943f typeck/pat.rs: extract check_pat_range. 2019-08-24 19:15:16 +02:00
Mazdak Farrokhzad
d891e70b64 typeck/pat.rs: extract check_pat_lit. 2019-08-24 19:15:11 +02:00
Mazdak Farrokhzad
23dc37d21d typeck/pat.rs: extract calc_default_binding_mode. 2019-08-24 19:15:05 +02:00
Mazdak Farrokhzad
3ec5d07b1d typeck/pat.rs: simplify peel_off_references. 2019-08-24 19:14:59 +02:00
Mazdak Farrokhzad
8b4114b0d4 typeck/pat.rs: extract peel_off_references and define def_bm algorithm more declaratively. 2019-08-24 19:14:46 +02:00
Mazdak Farrokhzad
d1580eef65 typeck/pat.rs: extract is_non_ref_pat. 2019-08-24 19:14:08 +02:00
Mazdak Farrokhzad
dbe6d59d6e typeck/pat.rs: move note out of check_dereferenceable as it angers VSCode. 2019-08-24 19:13:53 +02:00
Mazdak Farrokhzad
11d40910cd typeck: move check_pat_walk and children to pat.rs. 2019-08-24 19:13:06 +02:00
bors
0507d49755 Auto merge of #63808 - Rosto75:master, r=KodrAus
A bunch of minor documentation tweaks and fixes.
2019-08-23 05:11:41 +00:00
bors
a71e32e407 Auto merge of #63801 - jeremystucki:patch-1, r=jonas-schievink
Update .mailmap
2019-08-23 01:27:58 +00:00
bors
ee7161db98 Auto merge of #63522 - topecongiro:rustfmt-1.4.5, r=Centril
Update rustfmt to 1.4.5

This update includes a bug fix that fixes generating invalid code when formatting an impl block with const generics inside a where clause.

**Changes**
0462008de8...1de58ce46d
2019-08-22 21:51:14 +00:00
bors
760226733e Auto merge of #63807 - Centril:rollup-b8lo8ct, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63624 (When declaring a declarative macro in an item it's only accessible inside it)
 - #63737 (Fix naming misspelling)
 - #63767 (Use more optimal Ord implementation for integers)
 - #63782 (Fix confusion in theme picker functions)
 - #63788 (Add amanjeev to rustc-guide toolstate)
 - #63796 (Tweak E0308 on opaque types)
 - #63805 (Apply few Clippy suggestions)

Failed merges:

r? @ghost
2019-08-22 18:06:31 +00:00
Tomasz Różański
d9f3258186 Fix for 7e13679. 2019-08-22 19:27:16 +02:00
Jeremy Stucki
2f790ee5d2
Update .mailmap 2019-08-22 16:47:42 +02:00
Mazdak Farrokhzad
3068064430
Rollup merge of #63805 - mati865:clippy, r=Centril
Apply few Clippy suggestions

Somewhat follow-up of https://github.com/rust-lang/rust/pull/62806

Changes per commit are rather small so I can squash them if that's preferred.
2019-08-22 15:15:45 +02:00
Mazdak Farrokhzad
aa9490bd7b
Rollup merge of #63796 - estebank:opaque_future, r=Centril
Tweak E0308 on opaque types

```
error[E0308]: if and else have incompatible types
  --> file.rs:21:9
   |
18 | /     if true {
19 | |         thing_one()
   | |         ----------- expected because of this
20 | |     } else {
21 | |         thing_two()
   | |         ^^^^^^^^^^^ expected opaque type, found a different opaque type
22 | |     }.await
   | |_____- if and else have incompatible types
   |
   = note: expected type `impl std::future::Future` (opaque type)
              found type `impl std::future::Future` (opaque type)
   = note: distinct uses of `impl Trait` result in different opaque types
   = help: if both futures resolve to the same type, consider `await`ing on both of them
```

r? @Centril
CC #63167
2019-08-22 15:15:43 +02:00
Mazdak Farrokhzad
6c1cdb75ab
Rollup merge of #63788 - mark-i-m:rustc-guide-toolstate-add, r=ehuss
Add amanjeev to rustc-guide toolstate

cc @amanjeev @spastorino

r? @ehuss
2019-08-22 15:15:42 +02:00
Mazdak Farrokhzad
1f56441a00
Rollup merge of #63782 - GuillaumeGomez:theme-switch-fix, r=kinnison
Fix confusion in theme picker functions

To reproduce the bug currently: click on the theme picker button twice (to show it then hide it). Then click anywhere else: the dropdown menu appears again.

The problem was coming from a confusion of what the `hideThemeButtonState` and `showThemeButtonState` were supposed to do. I switched their codes and updated the `switchThemeButtonState` function. It now works as expected.

r? @kinnison
2019-08-22 15:15:40 +02:00
Mazdak Farrokhzad
30fd79cb6c
Rollup merge of #63767 - lzutao:integer-ord-suboptimal, r=nagisa
Use more optimal Ord implementation for integers

Closes #63758
r? @nagisa

### Compare results

([godbolt link](https://godbolt.org/z/dsbczy))

Old assembly:
```asm
example::cmp1:
  mov eax, dword ptr [rdi]
  mov ecx, dword ptr [rsi]
  cmp eax, ecx
  setae dl
  add dl, dl
  add dl, -1
  xor esi, esi
  cmp eax, ecx
  movzx eax, dl
  cmove eax, esi
  ret
```

New assembly:
```asm
example::cmp2:
  mov eax, dword ptr [rdi]
  xor ecx, ecx
  cmp eax, dword ptr [rsi]
  seta cl
  mov eax, 255
  cmovae eax, ecx
  ret
```

Old llvm-mca statistics:
```
Iterations:        100
Instructions:      1100
Total Cycles:      243
Total uOps:        1300

Dispatch Width:    6
uOps Per Cycle:    5.35
IPC:               4.53
Block RThroughput: 2.2
```

New llvm-mca statistics:
```
Iterations:        100
Instructions:      700
Total Cycles:      217
Total uOps:        1100

Dispatch Width:    6
uOps Per Cycle:    5.07
IPC:               3.23
Block RThroughput: 1.8
```
2019-08-22 15:15:38 +02:00
Mazdak Farrokhzad
0784395912
Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink
Fix naming misspelling

Fixes #63734
2019-08-22 15:15:36 +02:00
Mazdak Farrokhzad
8a26ba77ef
Rollup merge of #63624 - estebank:unreachable-macro, r=petrochenkov
When declaring a declarative macro in an item it's only accessible inside it

Fix #63164.
r? @petrochenkov
2019-08-22 15:15:35 +02:00
Tomasz Różański
eae5d77995 Change variables names to be more consistent.
Changed all instances of `c_str` into `cstr` in the documentation examples. This is also consistent with the module source code.
2019-08-22 15:09:03 +02:00
Tomasz Różański
cdedd268d2 Make use of existing constants.
f32::consts::PI / 2.0 -> f32::consts::FRAC_PI_2
f32::consts::PI / 4.0 -> f32::consts::FRAC_PI_4
f64::consts::PI / 2.0 -> f64::consts::FRAC_PI_2
f64::consts::PI / 4.0 -> f64::consts::FRAC_PI_4
2019-08-22 14:59:31 +02:00
Tomasz Różański
3b04e91d27 Change code formatting for readability. 2019-08-22 14:27:51 +02:00
Tomasz Różański
49dce2935f Fix punctuation. 2019-08-22 13:14:42 +02:00
Tomasz Różański
7e13679cde Remove redundant mut. 2019-08-22 13:12:31 +02:00
Tomasz Różański
4ee6ee0daa Fix formatting. 2019-08-22 13:06:39 +02:00
Tomasz Różański
a078a34f05 Fix a typo. 2019-08-22 13:04:32 +02:00
Mateusz Mikuła
edabcddf4d Apply clippy::let_and_return suggestion 2019-08-22 12:02:02 +02:00
Mateusz Mikuła
7f4aba40fc Apply clippy::needless_return suggestions 2019-08-22 12:02:02 +02:00
Mateusz Mikuła
b7ad3f9fc4 Apply clippy::redundant_field_names suggestion 2019-08-22 12:02:02 +02:00
Jeremy Stucki
6ce242fb6e
Update .mailmap 2019-08-22 10:06:25 +02:00
YangHau
4f613ffeb0 Fix naming misspelling 2019-08-22 15:03:19 +08:00