Commit Graph

97996 Commits

Author SHA1 Message Date
Vadim Petrochenkov
b0c4d0f8cb incremental: Do not rely on default transparency when decoding syntax contexts
Using `ExpnId`s default transparency here instead of the mark's real transparency was actually incorrect.
2019-08-23 01:44:33 +03:00
Vadim Petrochenkov
bf345dd6e3 resolve: Do not rely on default transparency when detecting proc macro derives 2019-08-23 01:44:33 +03:00
Vadim Petrochenkov
0fb01d219c Audit uses of apply_mark in built-in macros
Replace them with equivalents of `Span::{def_site,call_site}` from proc macro API.
The new API is much less error prone and doesn't rely on macros having default transparency.
2019-08-23 01:44:33 +03: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
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
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
YangHau
4f613ffeb0 Fix naming misspelling 2019-08-22 15:03:19 +08:00
bors
201e52e5fe Auto merge of #63175 - jsgf:argsfile, r=jsgf
rustc: implement argsfiles for command line

Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line.  This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`.

See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters.

This is useful for very large command lines, or when command lines are being generated into files by other tooling.
2019-08-22 06:14:49 +00:00
Esteban Küber
a710c610b2 review comments: reword and add test 2019-08-21 16:49:26 -07:00
Esteban Küber
4971667f17 review comments 2019-08-21 16:11:01 -07:00
Esteban Küber
8c07d7814d When declaring a declarative macro in an item it's only accessible inside it 2019-08-21 15:41:51 -07:00
bors
42dcd4b7c5 Auto merge of #63705 - mark-i-m:fix-guide-1, r=ehuss
Update rustc-guide

Should fix toolstate failure

r? @ehuss
2019-08-21 22:25:45 +00:00
Esteban Küber
ba8e09415b Add clarification on E0308 about opaque types 2019-08-21 15:05:21 -07:00
Esteban Küber
1c82987782 Fix typo in E0308 if/else label 2019-08-21 15:05:20 -07:00
bors
e44fdf9792 Auto merge of #63790 - Centril:rollup-m4ax3r9, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #61236 (take into account the system theme)
 - #63717 (Fix nested eager expansions in arguments of `format_args`)
 - #63747 (update Miri)
 - #63772 (ci: move libc mirrors to the rust-lang-ci-mirrors bucket)
 - #63780 (Improve diagnostics: break/continue in wrong context)
 - #63781 (Run Clippy without json-rendered flag)

Failed merges:

r? @ghost
2019-08-21 17:09:25 +00:00
Lzu Tao
f5b16f6212 Add codegen test for integers compare 2019-08-21 15:50:43 +00:00
Mark Mansi
9f14526f73 update rustc-guide 2019-08-21 10:33:00 -05:00
Mazdak Farrokhzad
1294774e94
Rollup merge of #63781 - mati865:clippy, r=oli-obk,ehuss
Run Clippy without json-rendered flag

Removed in https://github.com/rust-lang/rust/pull/62766

Replacing it with `--json=diagnostic-rendered-ansi` fails:
```
error: using `--json` requires also using `--error-format=json`
```
Running `./x.py clippy src/libstd` locally works fine (with colors) on Linux so I don't know if there is something to fix.
2019-08-21 17:31:45 +02:00
Mazdak Farrokhzad
3a1eb34c2e
Rollup merge of #63780 - u32i64:issue-63712, r=estebank
Improve diagnostics: break/continue in wrong context

- Fix #63712
- Use `` `break` `` or `` `continue` `` instead of always `break` in `cannot _...`
- Show the enclosing closure or async block we're talking about
- `` `break` outside of loop `` -> `` `break` outside of a loop `` for consistency

r? @estebank
2019-08-21 17:31:43 +02:00
Mazdak Farrokhzad
f362387c40
Rollup merge of #63772 - pietroalbini:mirrors-libc, r=alexcrichton
ci: move libc mirrors to the rust-lang-ci-mirrors bucket

Finishing up #63485. Already moved the objects.

r? @alexcrichton
2019-08-21 17:31:42 +02:00
Mazdak Farrokhzad
ddb6314998
Rollup merge of #63747 - RalfJung:miri, r=RalfJung
update Miri

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

r? @oli-obk
2019-08-21 17:31:41 +02:00
Mazdak Farrokhzad
70436969e0
Rollup merge of #63717 - petrochenkov:eager, r=matthewjasper
Fix nested eager expansions in arguments of `format_args`

Fixes https://github.com/rust-lang/rust/issues/63460
Fixes https://github.com/rust-lang/rust/issues/63685 (regression from making `format_args` opaque - https://github.com/rust-lang/rust/pull/63114)

r? @matthewjasper
2019-08-21 17:31:39 +02:00
Mazdak Farrokhzad
d034ccabe4
Rollup merge of #61236 - GuillaumeGomez:system-theme, r=Mark-Simulacrum
take into account the system theme

Fixes #61079.

The CSS can now take into account the system theme. I used it to generate some content on the document and from there, if no theme has already been selected, it'll look at the system level theme.

r? @QuietMisdreavus
cc @fenhl
2019-08-21 17:31:38 +02:00
Mark Mansi
a9900be9f4 add amanjeev 2019-08-21 10:16:57 -05:00
Artem Varaksa
600a64bdb5 more --blessing + test error annotations fixes 2019-08-21 15:13:13 +03:00
bors
7b0085a613 Auto merge of #63779 - Centril:rollup-sx96dli, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63721 (Do not emit JSON dumps of diagnostic codes)
 - #63753 (Bump toml dependency.)
 - #63755 (Use dedicated type for spans in pre-expansion gating.)
 - #63759 (Allow 'default async fn' to parse.)
 - #63760 (Update books)
 - #63762 (`async_await` was stabilized in 1.39.0, not 1.38.0.)
 - #63766 (Remove some duplication when resolving constants)

Failed merges:

r? @ghost
2019-08-21 11:40:23 +00:00
Artem Varaksa
dd7082e3d2 r#type -> ty 2019-08-21 14:32:38 +03:00
Guillaume Gomez
3375b05cd0 Fix confusion in theme picker functions 2019-08-21 13:10:06 +02:00
Guillaume Gomez
1bd94241b7 Replaced skipStorage with saveTheme variable 2019-08-21 12:49:01 +02:00
Artem Varaksa
a8d7ea74a4 improve diagnostics: break/continue wrong context 2019-08-21 13:17:59 +03:00
Mateusz Mikuła
5cf43bdd54 Run Clippy without json-rendered flag 2019-08-21 12:14:00 +02:00
Vadim Petrochenkov
fe2dc91972 Add a regression test for issue #63460 2019-08-21 12:53:11 +03:00
Mazdak Farrokhzad
b25ec04384
Rollup merge of #63766 - oli-obk:const_eval_dedup, r=zackmdavis
Remove some duplication when resolving constants
2019-08-21 11:52:29 +02:00
Mazdak Farrokhzad
0e8a1a4e78
Rollup merge of #63762 - rust-lang:fix-async-date, r=Mark-Simulacrum
`async_await` was stabilized in 1.39.0, not 1.38.0.

r? @Mark-Simulacrum
2019-08-21 11:52:28 +02:00
Mazdak Farrokhzad
e276e06913
Rollup merge of #63760 - ehuss:update-books, r=ehuss
Update books

## nomicon

25 commits in 8a7d05615e5bc0a7fb961b4919c44f5221ee54da..38b9a76bc8b59ac862663807fc51c9b757337fd6
2019-08-07 07:46:59 -0500 to 2019-08-19 10:04:32 -0400
- Fix transmute_copy link
- some edits
- drop parenthetical
- clarify dangling
- fix def.n of dangling
- fold uninit integer rule with reading uninit memory
- refactor null a bit
- resolve some nits
- raw ptrs must be initialized like integers
- Apply suggestions from code review
- explain when metadata is invalid
- mention !
- add more cases of UB
- avoid redundant UB
- stick to broader UB for raw ptr offsets/derefs for now
- be more precise about dangling
- subsume the NonNull things as library types
- handle recursion in the heading
- Define 'producing'
- NonNull, NonZero*
- list more ptr offset computations
- UB
- Fix typo in subtyping
- Add colon to `MySuperSliceable` too
- Fix typo `str::mem` to `std::mem`

## reference

2 commits in b4b3536839042a6743fc76f0d9ad2a812020aeaa..d191a0cdd3b92648e0f1e53b13140a14677cc65b
2019-08-07 02:29:50 +0200 to 2019-08-15 08:42:23 +0200
- Fix warning in stable-check (rust-lang-nursery/reference#653)
- our closure syntax comes from Ruby (rust-lang-nursery/reference#650)

## rust-by-example

5 commits in f2c15ba5ee89ae9469a2cf60494977749901d764..580839d90aacd537f0293697096fa8355bc4e673
2019-08-07 10:14:25 -0300 to 2019-08-17 23:17:50 -0300
- macros.md: Changing Sometime to more appropriate adverb form Sometimes (rust-lang/rust-by-example#1243)
- Add colon after "See Also" (rust-lang/rust-by-example#1242)
- Update enter_question_mark.md (rust-lang/rust-by-example#1208)
- Add destructuring bind examples (rust-lang/rust-by-example#1238)
- Change initial parameters in `fibonacci()` call. (rust-lang/rust-by-example#1241)

## embedded-book

1 commits in c5da1e11915d3f28266168baaf55822f7e3fe999..432ca26686c11d396eed6a59499f93ce1bf2433c
2019-08-05 23:02:10 +0000 to 2019-08-09 23:20:22 +0000
- semihosting: add comment adding feature flag to panic-semihosting  (rust-embedded/book#203)
2019-08-21 11:52:26 +02:00
Mazdak Farrokhzad
67e39ed51c
Rollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkov
Allow 'default async fn' to parse.

- Parse default async fn. Fixes #63716.

(`cherry-pick`ed from 3rd commit in https://github.com/rust-lang/rust/pull/63749.)

r? @petrochenkov
2019-08-21 11:52:25 +02:00
Mazdak Farrokhzad
b6556744b5
Rollup merge of #63755 - Centril:simplify-prexp-gating, r=petrochenkov
Use dedicated type for spans in pre-expansion gating.

- Simplify the overall pre-expansion gating "experience".
2019-08-21 11:52:23 +02:00
Mazdak Farrokhzad
61ae1ccb14
Rollup merge of #63753 - ehuss:bump-toml, r=Mark-Simulacrum
Bump toml dependency.

Just removing an old/duplicated dependency from the workspace.
2019-08-21 11:52:21 +02:00
Mazdak Farrokhzad
d7c162aefd
Rollup merge of #63721 - Mark-Simulacrum:decouple-error-index, r=matthewjasper
Do not emit JSON dumps of diagnostic codes

This decouples the error index generator from libsyntax for the most part (though it still depends on librustdoc for the markdown parsing and generation).

Fixes #34588
2019-08-21 11:52:20 +02:00
Vadim Petrochenkov
93d369bc2b resolve/expand: Rename some things for clarity and add comments 2019-08-21 11:53:39 +03:00
Vadim Petrochenkov
a83c35692f expand: Do not do questionable span adjustment before eagerly expanding an expression
Maybe it made sense when it was introduced, but now it's doing something incorrect.
2019-08-21 11:53:39 +03:00
Vadim Petrochenkov
96032aa5ef expand: Keep the correct current expansion ID for eager expansions
Solve the problem of `ParentScope` entries for eager expansions not exising in the resolver map by creating them on demand.
2019-08-21 11:53:39 +03:00