]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoparser: drive-by: simplify `parse_arg_general`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:57:34 +0000 (22:57 +0200)]
parser: drive-by: simplify `parse_arg_general`.

4 years agoparser: `let` stmts & `for` exprs: allow or-patterns.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:54:07 +0000 (22:54 +0200)]
parser: `let` stmts & `for` exprs: allow or-patterns.

4 years agoparser: document `parse_pat`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:35:53 +0000 (22:35 +0200)]
parser: document `parse_pat`.

4 years agoparser: `parse_pats` -> `parse_top_pat{_unpack}`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 20:04:28 +0000 (22:04 +0200)]
parser: `parse_pats` -> `parse_top_pat{_unpack}`.

4 years agoparser: document `ban_unexpected_or_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:38:36 +0000 (18:38 +0200)]
parser: document `ban_unexpected_or_or`.

4 years agoparser: move `maybe_recover_unexpected_comma` to a more appropriate place.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:37:41 +0000 (18:37 +0200)]
parser: move `maybe_recover_unexpected_comma` to a more appropriate place.

4 years agoparser: use `eat_or_separator` for leading vert.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:34:35 +0000 (18:34 +0200)]
parser: use `eat_or_separator` for leading vert.

4 years agoparser: improve `parse_pat_with_or` docs.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:15:17 +0000 (18:15 +0200)]
parser: improve `parse_pat_with_or` docs.

4 years agoparser: extract `eat_or_separator`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 16:13:19 +0000 (18:13 +0200)]
parser: extract `eat_or_separator`.

4 years agoparser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 15:44:27 +0000 (17:44 +0200)]
parser: integrate `maybe_recover_unexpected_comma` in `parse_pat_with_or`.

4 years agoparser: extract `maybe_recover_unexpected_comma`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 15:11:12 +0000 (17:11 +0200)]
parser: extract `maybe_recover_unexpected_comma`.

4 years agoparser: simplify `parse_pat_with_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:55:52 +0000 (16:55 +0200)]
parser: simplify `parse_pat_with_or`.

4 years agoparser: `multiple-pattern-typo`: cover more or-pattern places.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:52:49 +0000 (16:52 +0200)]
parser: `multiple-pattern-typo`: cover more or-pattern places.

4 years agoparser: move `multiple-pattern-typo` -> `or-patterns` directory.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:45:08 +0000 (16:45 +0200)]
parser: move `multiple-pattern-typo` -> `or-patterns` directory.

4 years agoparser: improve or-patterns recovery.
Mazdak Farrokhzad [Sun, 18 Aug 2019 14:35:19 +0000 (16:35 +0200)]
parser: improve or-patterns recovery.

4 years agoparser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:45:44 +0000 (15:45 +0200)]
parser: refactor `parse_pat_with_or` + use it in [p0, p1, ..] pats.

4 years agoparser: type alias `type Expected = Option<&'static str>;`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:31:34 +0000 (15:31 +0200)]
parser: type alias `type Expected = Option<&'static str>;`.

4 years agoparser: extract `ban_unexpected_or_or`.
Mazdak Farrokhzad [Sun, 18 Aug 2019 13:28:14 +0000 (15:28 +0200)]
parser: extract `ban_unexpected_or_or`.

4 years agoAuto merge of #63823 - petrochenkov:noapply2, r=matthewjasper
bors [Sat, 24 Aug 2019 14:07:06 +0000 (14:07 +0000)]
Auto merge of #63823 - petrochenkov:noapply2, r=matthewjasper

Audit uses of `apply_mark` in built-in macros + Remove default macro transparencies

Every use of `apply_mark` in a built-in or procedural macro is supposed to look like this
```rust
location.with_ctxt(SyntaxContext::root().apply_mark(ecx.current_expansion.id))
```
where `SyntaxContext::root()` means that the built-in/procedural macro is defined directly, rather than expanded from some other macro.

However, few people understood what `apply_mark` does, so we had a lot of copy-pasted uses of it looking e.g. like
```rust
span = span.apply_mark(ecx.current_expansion.id);
```
, which doesn't really make sense for procedural macros, but at the same time is not too harmful, if the macros use the traditional `macro_rules` hygiene.

So, to fight this, we stop using `apply_mark` directly in built-in macro implementations, and follow the example of regular proc macros instead and use analogues of `Span::def_site()` and `Span::call_site()`, which are much more intuitive and less error-prone.
- `ecx.with_def_site_ctxt(span)` takes the `span`'s location and combines it with a def-site context.
- `ecx.with_call_site_ctxt(span)` takes the `span`'s location and combines it with a call-site context.

Even if called multiple times (which sometimes happens due to some historical messiness of the built-in macro code) these functions will produce the same result, unlike `apply_mark` which will grow  the mark chain further in this case.

---

After `apply_mark`s in built-in macros are eliminated, the remaining `apply_mark`s are very few in number, so we can start passing the previously implicit `Transparency` argument to them explicitly, thus eliminating the need in `default_transparency` fields in hygiene structures and `#[rustc_macro_transparency]` annotations on built-in macros.

So, the task of making built-in macros opaque can now be formulated as "eliminate `with_legacy_ctxt` in favor of `with_def_site_ctxt`" rather than "replace `#[rustc_macro_transparency = "semitransparent"]` with `#[rustc_macro_transparency = "opaque"]`".

r? @matthewjasper

4 years agoAuto merge of #63637 - alexcrichton:remove-libtest-step, r=Mark-Simulacrum
bors [Sat, 24 Aug 2019 05:39:52 +0000 (05:39 +0000)]
Auto merge of #63637 - alexcrichton:remove-libtest-step, r=Mark-Simulacrum

bootstrap: Merge the libtest build step with libstd

Since its inception rustbuild has always worked in three stages: one for
libstd, one for libtest, and one for rustc. These three stages were
architected around crates.io dependencies, where rustc wants to depend
on crates.io crates but said crates don't explicitly depend on libstd,
requiring a sysroot assembly step in the middle. This same logic was
applied for libtest where libtest wants to depend on crates.io crates
(`getopts`) but `getopts` didn't say that it depended on std, so it
needed `std` built ahead of time.

Lots of time has passed since the inception of rustbuild, however,
and we've since gotten to the point where even `std` itself is depending
on crates.io crates (albeit with some wonky configuration). This
commit applies the same logic to the two dependencies that the `test`
crate pulls in from crates.io, `getopts` and `unicode-width`. Over the
many years since rustbuild's inception `unicode-width` was the only
dependency picked up by the `test` crate, so the extra configuration
necessary to get crates building in this crate graph is unlikely to be
too much of a burden on developers.

After this patch it means that there are now only two build phasese of
rustbuild, one for libstd and one for rustc. The libtest/libproc_macro
build phase is all lumped into one now with `std`.

This was originally motivated by rust-lang/cargo#7216 where Cargo was
having to deal with synthesizing dependency edges but this commit makes
them explicit in this repository.

4 years agoAuto merge of #63824 - Centril:split-feature_gate, r=oli-obk
bors [Sat, 24 Aug 2019 01:50:03 +0000 (01:50 +0000)]
Auto merge of #63824 - Centril:split-feature_gate, r=oli-obk

Refactor `feature_gate.rs` into modules & cleanup

Split `src/libsyntax/feature_gate.rs` into `src/libsyntax/feature_gate/` with files:
- `accepted.rs` (accepted feature gates)
- `removed.rs` (...)
- `active.rs` (...)
- `builtin_attrs.rs` (definition of builtin attributes and their gates as well as gating `cfg` flags)
- `check.rs` (post expansion checking of feature gates)
- `mod.rs` (just reexports)

Additionally, `tidy.rs` is adjusted to respect the new scheme.

Also, `builtin_attrs.rs` sees some cleanup, organization, and DSL-ification to reduce repetition.

This is probably best read commit-by-commit I think.

r? @oli-obk

4 years agobootstrap: Merge the libtest build step with libstd
Alex Crichton [Fri, 16 Aug 2019 15:29:08 +0000 (08:29 -0700)]
bootstrap: Merge the libtest build step with libstd

Since its inception rustbuild has always worked in three stages: one for
libstd, one for libtest, and one for rustc. These three stages were
architected around crates.io dependencies, where rustc wants to depend
on crates.io crates but said crates don't explicitly depend on libstd,
requiring a sysroot assembly step in the middle. This same logic was
applied for libtest where libtest wants to depend on crates.io crates
(`getopts`) but `getopts` didn't say that it depended on std, so it
needed `std` built ahead of time.

Lots of time has passed since the inception of rustbuild, however,
and we've since gotten to the point where even `std` itself is depending
on crates.io crates (albeit with some wonky configuration). This
commit applies the same logic to the two dependencies that the `test`
crate pulls in from crates.io, `getopts` and `unicode-width`. Over the
many years since rustbuild's inception `unicode-width` was the only
dependency picked up by the `test` crate, so the extra configuration
necessary to get crates building in this crate graph is unlikely to be
too much of a burden on developers.

After this patch it means that there are now only two build phasese of
rustbuild, one for libstd and one for rustc. The libtest/libproc_macro
build phase is all lumped into one now with `std`.

This was originally motivated by rust-lang/cargo#7216 where Cargo was
having to deal with synthesizing dependency edges but this commit makes
them explicit in this repository.

4 years agoAuto merge of #63814 - malbarbo:wasi-error-kind, r=alexcrichton
bors [Fri, 23 Aug 2019 22:09:07 +0000 (22:09 +0000)]
Auto merge of #63814 - malbarbo:wasi-error-kind, r=alexcrichton

Implement decode_error_kind for wasi

Based on the implementation for unix targets,

4 years agoAuto merge of #63819 - najamelan:patch-1, r=Centril
bors [Fri, 23 Aug 2019 16:22:06 +0000 (16:22 +0000)]
Auto merge of #63819 - najamelan:patch-1, r=Centril

rustc docs: Update single-use-lifetimes

When using this, rustc emits a warning that the lint has been renamed (to having an 's' at the end)

4 years agoImplement decode_error_kind for wasi
Marco A L Barbosa [Thu, 22 Aug 2019 17:40:21 +0000 (14:40 -0300)]
Implement decode_error_kind for wasi

Based on the implementation for unix targets

4 years agoAuto merge of #63815 - sebastinez:sebastinez-doc-#63792, r=jonas-schievink
bors [Fri, 23 Aug 2019 12:40:32 +0000 (12:40 +0000)]
Auto merge of #63815 - sebastinez:sebastinez-doc-#63792, r=jonas-schievink

Update occurences of as_slice to as_str in comments

Fix #63792

4 years agoAuto merge of #63521 - newpavlov:redox_builder, r=pietroalbini
bors [Fri, 23 Aug 2019 08:58:24 +0000 (08:58 +0000)]
Auto merge of #63521 - newpavlov:redox_builder, r=pietroalbini

Re-enable Redox builder (take 2)

Closes: #63160
4 years agoAuto merge of #63808 - Rosto75:master, r=KodrAus
bors [Fri, 23 Aug 2019 05:11:41 +0000 (05:11 +0000)]
Auto merge of #63808 - Rosto75:master, r=KodrAus

A bunch of minor documentation tweaks and fixes.

4 years agoAuto merge of #63801 - jeremystucki:patch-1, r=jonas-schievink
bors [Fri, 23 Aug 2019 01:27:58 +0000 (01:27 +0000)]
Auto merge of #63801 - jeremystucki:patch-1, r=jonas-schievink

Update .mailmap

4 years ago`--bless` some tests due to message format change.
Mazdak Farrokhzad [Thu, 22 Aug 2019 23:09:51 +0000 (01:09 +0200)]
`--bless` some tests due to message format change.

4 years agoFix `tidy` fallout due to `feature_gate.rs` refactoring.
Mazdak Farrokhzad [Thu, 22 Aug 2019 22:06:32 +0000 (00:06 +0200)]
Fix `tidy` fallout due to `feature_gate.rs` refactoring.

4 years agosyntax: move `feature_gate.rs`.
Mazdak Farrokhzad [Thu, 22 Aug 2019 21:49:55 +0000 (23:49 +0200)]
syntax: move `feature_gate.rs`.

4 years agosyntax: extract `check.rs`.
Mazdak Farrokhzad [Thu, 22 Aug 2019 21:48:08 +0000 (23:48 +0200)]
syntax: extract `check.rs`.

4 years agobuiltin_attrs.rs: retain FIXMEs.
Mazdak Farrokhzad [Thu, 22 Aug 2019 21:35:03 +0000 (23:35 +0200)]
builtin_attrs.rs: retain FIXMEs.

4 years agobuiltin_attrs.rs: organize!
Mazdak Farrokhzad [Thu, 22 Aug 2019 21:30:59 +0000 (23:30 +0200)]
builtin_attrs.rs: organize!

4 years agobuiltin_attrs.rs: cleanup with `(un)gated!`.
Mazdak Farrokhzad [Thu, 22 Aug 2019 18:40:50 +0000 (20:40 +0200)]
builtin_attrs.rs: cleanup with `(un)gated!`.

4 years agobuiltin_attrs.rs: refactor `rustc_attrs` entries.
Mazdak Farrokhzad [Thu, 22 Aug 2019 17:37:04 +0000 (19:37 +0200)]
builtin_attrs.rs: refactor `rustc_attrs` entries.

4 years agobuiltin_attrs.rs: simplify `cfg_fn`.
Mazdak Farrokhzad [Thu, 22 Aug 2019 16:37:28 +0000 (18:37 +0200)]
builtin_attrs.rs: simplify `cfg_fn`.

4 years agosyntax: extract `builin_attrs.rs`.
Mazdak Farrokhzad [Thu, 22 Aug 2019 16:32:31 +0000 (18:32 +0200)]
syntax: extract `builin_attrs.rs`.

4 years agosyntax: extract `active.rs` feature gates.
Mazdak Farrokhzad [Tue, 20 Aug 2019 16:50:33 +0000 (18:50 +0200)]
syntax: extract `active.rs` feature gates.

4 years agosyntax: extract `removed.rs` feature gates.
Mazdak Farrokhzad [Tue, 20 Aug 2019 16:41:18 +0000 (18:41 +0200)]
syntax: extract `removed.rs` feature gates.

4 years agosyntax: extract `accepted.rs` feature gates.
Mazdak Farrokhzad [Tue, 20 Aug 2019 16:40:53 +0000 (18:40 +0200)]
syntax: extract `accepted.rs` feature gates.

4 years agoRemove default macro transparencies
Vadim Petrochenkov [Thu, 22 Aug 2019 22:44:18 +0000 (01:44 +0300)]
Remove default macro transparencies

All transparancies are passed explicitly now.
Also remove `#[rustc_macro_transparency]` annotations from built-in macros, they are no longer used.
`#[rustc_macro_transparency]` only makes sense for declarative macros now.

4 years agohygiene: Require passing transparency explicitly to `apply_mark`
Vadim Petrochenkov [Thu, 22 Aug 2019 22:31:01 +0000 (01:31 +0300)]
hygiene: Require passing transparency explicitly to `apply_mark`

4 years agoincremental: Do not rely on default transparency when decoding syntax contexts
Vadim Petrochenkov [Thu, 22 Aug 2019 21:27:46 +0000 (00:27 +0300)]
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.

4 years agoresolve: Do not rely on default transparency when detecting proc macro derives
Vadim Petrochenkov [Wed, 21 Aug 2019 22:29:34 +0000 (01:29 +0300)]
resolve: Do not rely on default transparency when detecting proc macro derives

4 years agoAudit uses of `apply_mark` in built-in macros
Vadim Petrochenkov [Wed, 21 Aug 2019 18:28:22 +0000 (21:28 +0300)]
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.

4 years agoUpdate single-use-lifetimes
Naja Melan [Thu, 22 Aug 2019 22:39:21 +0000 (22:39 +0000)]
Update single-use-lifetimes

When using this, rustc emits a warning that the lint has been renamed (to having an 's' at the end)

4 years agoAuto merge of #63522 - topecongiro:rustfmt-1.4.5, r=Centril
bors [Thu, 22 Aug 2019 21:51:14 +0000 (21:51 +0000)]
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**
https://github.com/rust-lang/rustfmt/compare/0462008de87d2757e8ef1dc26f2c54dd789a59a8...1de58ce46d64b1164a214dc0b7fb7c400576c3a6

4 years agoUpdate occurences of as_slice
Sebastian Martinez [Thu, 22 Aug 2019 19:16:22 +0000 (16:16 -0300)]
Update occurences of as_slice

Update occurences of as_slice to as_str

4 years agoAuto merge of #63807 - Centril:rollup-b8lo8ct, r=Centril
bors [Thu, 22 Aug 2019 18:06:31 +0000 (18:06 +0000)]
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

4 years agoFix for 7e13679.
Tomasz Różański [Thu, 22 Aug 2019 17:27:16 +0000 (19:27 +0200)]
Fix for 7e13679.

4 years agoUpdate .mailmap
Jeremy Stucki [Thu, 22 Aug 2019 14:47:42 +0000 (16:47 +0200)]
Update .mailmap

4 years agoRollup merge of #63805 - mati865:clippy, r=Centril
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:45 +0000 (15:15 +0200)]
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.

4 years agoRollup merge of #63796 - estebank:opaque_future, r=Centril
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:43 +0000 (15:15 +0200)]
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

4 years agoRollup merge of #63788 - mark-i-m:rustc-guide-toolstate-add, r=ehuss
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:42 +0000 (15:15 +0200)]
Rollup merge of #63788 - mark-i-m:rustc-guide-toolstate-add, r=ehuss

Add amanjeev to rustc-guide toolstate

cc @amanjeev @spastorino

r? @ehuss

4 years agoRollup merge of #63782 - GuillaumeGomez:theme-switch-fix, r=kinnison
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:40 +0000 (15:15 +0200)]
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

4 years agoRollup merge of #63767 - lzutao:integer-ord-suboptimal, r=nagisa
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:38 +0000 (15:15 +0200)]
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
```

4 years agoRollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:36 +0000 (15:15 +0200)]
Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink

Fix naming misspelling

Fixes #63734

4 years agoRollup merge of #63624 - estebank:unreachable-macro, r=petrochenkov
Mazdak Farrokhzad [Thu, 22 Aug 2019 13:15:35 +0000 (15:15 +0200)]
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

4 years agoChange variables names to be more consistent.
Tomasz Różański [Thu, 22 Aug 2019 13:09:03 +0000 (15:09 +0200)]
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.

4 years agoMake use of existing constants.
Tomasz Różański [Thu, 22 Aug 2019 12:59:31 +0000 (14:59 +0200)]
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

4 years agoChange code formatting for readability.
Tomasz Różański [Thu, 22 Aug 2019 12:27:51 +0000 (14:27 +0200)]
Change code formatting for readability.

4 years agoFix punctuation.
Tomasz Różański [Thu, 22 Aug 2019 11:14:42 +0000 (13:14 +0200)]
Fix punctuation.

4 years agoRemove redundant `mut`.
Tomasz Różański [Thu, 22 Aug 2019 11:12:31 +0000 (13:12 +0200)]
Remove redundant `mut`.

4 years agoFix formatting.
Tomasz Różański [Thu, 22 Aug 2019 11:06:39 +0000 (13:06 +0200)]
Fix formatting.

4 years agoFix a typo.
Tomasz Różański [Thu, 22 Aug 2019 11:04:32 +0000 (13:04 +0200)]
Fix a typo.

4 years agoApply clippy::let_and_return suggestion
Mateusz Mikuła [Thu, 22 Aug 2019 09:51:59 +0000 (11:51 +0200)]
Apply clippy::let_and_return suggestion

4 years agoApply clippy::needless_return suggestions
Mateusz Mikuła [Thu, 22 Aug 2019 09:47:36 +0000 (11:47 +0200)]
Apply clippy::needless_return suggestions

4 years agoApply clippy::redundant_field_names suggestion
Mateusz Mikuła [Thu, 22 Aug 2019 09:44:57 +0000 (11:44 +0200)]
Apply clippy::redundant_field_names suggestion

4 years agoUpdate .mailmap
Jeremy Stucki [Thu, 22 Aug 2019 08:06:25 +0000 (10:06 +0200)]
Update .mailmap

4 years agoFix naming misspelling
YangHau [Tue, 20 Aug 2019 11:46:23 +0000 (19:46 +0800)]
Fix naming misspelling

4 years agoAuto merge of #63175 - jsgf:argsfile, r=jsgf
bors [Thu, 22 Aug 2019 06:14:49 +0000 (06:14 +0000)]
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.

4 years agoreview comments: reword and add test
Esteban Küber [Wed, 21 Aug 2019 22:35:38 +0000 (15:35 -0700)]
review comments: reword and add test

4 years agoreview comments
Esteban Küber [Wed, 21 Aug 2019 23:11:01 +0000 (16:11 -0700)]
review comments

4 years agoWhen declaring a declarative macro in an item it's only accessible inside it
Esteban Küber [Fri, 16 Aug 2019 01:58:20 +0000 (18:58 -0700)]
When declaring a declarative macro in an item it's only accessible inside it

4 years agoAuto merge of #63705 - mark-i-m:fix-guide-1, r=ehuss
bors [Wed, 21 Aug 2019 22:25:45 +0000 (22:25 +0000)]
Auto merge of #63705 - mark-i-m:fix-guide-1, r=ehuss

Update rustc-guide

Should fix toolstate failure

r? @ehuss

4 years agoAdd clarification on E0308 about opaque types
Esteban Küber [Wed, 21 Aug 2019 18:49:51 +0000 (11:49 -0700)]
Add clarification on E0308 about opaque types

4 years agoFix typo in E0308 if/else label
Esteban Küber [Wed, 21 Aug 2019 18:46:31 +0000 (11:46 -0700)]
Fix typo in E0308 if/else label

4 years agorevert num_cpus change
newpavlov [Wed, 21 Aug 2019 17:16:52 +0000 (20:16 +0300)]
revert num_cpus change

4 years agoAuto merge of #63790 - Centril:rollup-m4ax3r9, r=Centril
bors [Wed, 21 Aug 2019 17:09:25 +0000 (17:09 +0000)]
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

4 years agoAdd codegen test for integers compare
Lzu Tao [Wed, 21 Aug 2019 15:50:43 +0000 (15:50 +0000)]
Add codegen test for integers compare

4 years agoupdate rustc-guide
Mark Mansi [Mon, 19 Aug 2019 16:06:15 +0000 (11:06 -0500)]
update rustc-guide

4 years agoRollup merge of #63781 - mati865:clippy, r=oli-obk,ehuss
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:45 +0000 (17:31 +0200)]
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.

4 years agoRollup merge of #63780 - u32i64:issue-63712, r=estebank
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:43 +0000 (17:31 +0200)]
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

4 years agoRollup merge of #63772 - pietroalbini:mirrors-libc, r=alexcrichton
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:42 +0000 (17:31 +0200)]
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

4 years agoRollup merge of #63747 - RalfJung:miri, r=RalfJung
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:41 +0000 (17:31 +0200)]
Rollup merge of #63747 - RalfJung:miri, r=RalfJung

update Miri

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

r? @oli-obk

4 years agoRollup merge of #63717 - petrochenkov:eager, r=matthewjasper
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:39 +0000 (17:31 +0200)]
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

4 years agoRollup merge of #61236 - GuillaumeGomez:system-theme, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:38 +0000 (17:31 +0200)]
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

4 years agoadd amanjeev
Mark Mansi [Wed, 21 Aug 2019 15:16:57 +0000 (10:16 -0500)]
add amanjeev

4 years agomore `--bless`ing + test error annotations fixes
Artem Varaksa [Wed, 21 Aug 2019 12:13:13 +0000 (15:13 +0300)]
more `--bless`ing + test error annotations fixes

4 years agoAuto merge of #63779 - Centril:rollup-sx96dli, r=Centril
bors [Wed, 21 Aug 2019 11:40:23 +0000 (11:40 +0000)]
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

4 years ago`r#type` -> `ty`
Artem Varaksa [Wed, 21 Aug 2019 11:32:38 +0000 (14:32 +0300)]
`r#type` -> `ty`

4 years agoFix confusion in theme picker functions
Guillaume Gomez [Wed, 21 Aug 2019 11:10:06 +0000 (13:10 +0200)]
Fix confusion in theme picker functions

4 years agoReplaced skipStorage with saveTheme variable
Guillaume Gomez [Wed, 21 Aug 2019 10:49:01 +0000 (12:49 +0200)]
Replaced skipStorage with saveTheme variable

4 years agoimprove diagnostics: break/continue wrong context
Artem Varaksa [Wed, 21 Aug 2019 10:17:59 +0000 (13:17 +0300)]
improve diagnostics: break/continue wrong context

4 years agoRun Clippy without json-rendered flag
Mateusz Mikuła [Wed, 21 Aug 2019 10:14:00 +0000 (12:14 +0200)]
Run Clippy without json-rendered flag

4 years agoAdd a regression test for issue #63460
Vadim Petrochenkov [Wed, 21 Aug 2019 09:53:11 +0000 (12:53 +0300)]
Add a regression test for issue #63460

4 years agoRollup merge of #63766 - oli-obk:const_eval_dedup, r=zackmdavis
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:29 +0000 (11:52 +0200)]
Rollup merge of #63766 - oli-obk:const_eval_dedup, r=zackmdavis

Remove some duplication when resolving constants

4 years agoRollup merge of #63762 - rust-lang:fix-async-date, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:28 +0000 (11:52 +0200)]
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