]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoFix 2018 edition expanded pretty printing
Matthew Jasper [Sun, 25 Aug 2019 21:36:13 +0000 (22:36 +0100)]
Fix 2018 edition expanded pretty printing

4 years agoRemove `Ident::{gensym, is_gensymed}`
Matthew Jasper [Sun, 25 Aug 2019 20:31:42 +0000 (21:31 +0100)]
Remove `Ident::{gensym, is_gensymed}`

`gensym_if_underscore` still exists. The symbol interner can still
create arbitray gensyms, this is just not exposed publicly.

4 years agoMove tests for unit tests to their own directory
Matthew Jasper [Sun, 25 Aug 2019 20:21:07 +0000 (21:21 +0100)]
Move tests for unit tests to their own directory

4 years agoMake use of hygiene in AST passes
Matthew Jasper [Sun, 25 Aug 2019 20:03:24 +0000 (21:03 +0100)]
Make use of hygiene in AST passes

4 years agoAllow ast passes to create hygienic spans
Matthew Jasper [Sun, 25 Aug 2019 19:58:03 +0000 (20:58 +0100)]
Allow ast passes to create hygienic spans

4 years agoAdd an ExpnKind for AST passes
Matthew Jasper [Sun, 25 Aug 2019 18:59:51 +0000 (19:59 +0100)]
Add an ExpnKind for AST passes

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

4 years agoRollup merge of #63760 - ehuss:update-books, r=ehuss
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:26 +0000 (11:52 +0200)]
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)

4 years agoRollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkov
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:25 +0000 (11:52 +0200)]
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

4 years agoRollup merge of #63755 - Centril:simplify-prexp-gating, r=petrochenkov
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:23 +0000 (11:52 +0200)]
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".

4 years agoRollup merge of #63753 - ehuss:bump-toml, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:21 +0000 (11:52 +0200)]
Rollup merge of #63753 - ehuss:bump-toml, r=Mark-Simulacrum

Bump toml dependency.

Just removing an old/duplicated dependency from the workspace.

4 years agoRollup merge of #63721 - Mark-Simulacrum:decouple-error-index, r=matthewjasper
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:20 +0000 (11:52 +0200)]
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

4 years agoresolve/expand: Rename some things for clarity and add comments
Vadim Petrochenkov [Mon, 19 Aug 2019 21:24:28 +0000 (00:24 +0300)]
resolve/expand: Rename some things for clarity and add comments

4 years agoexpand: Do not do questionable span adjustment before eagerly expanding an expression
Vadim Petrochenkov [Mon, 19 Aug 2019 20:44:57 +0000 (23:44 +0300)]
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.

4 years agoexpand: Keep the correct current expansion ID for eager expansions
Vadim Petrochenkov [Mon, 19 Aug 2019 20:35:25 +0000 (23:35 +0300)]
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.

4 years agoAdd a test for an opaque macro eagerly expanding its arguments
Vadim Petrochenkov [Mon, 19 Aug 2019 20:10:07 +0000 (23:10 +0300)]
Add a test for an opaque macro eagerly expanding its arguments

4 years agotake into account the system theme
Guillaume Gomez [Mon, 27 May 2019 13:57:44 +0000 (15:57 +0200)]
take into account the system theme

4 years agoupdate Miri
Ralf Jung [Wed, 21 Aug 2019 07:37:23 +0000 (09:37 +0200)]
update Miri

4 years agoci: move libc mirrors to the rust-lang-ci-mirrors bucket
Pietro Albini [Wed, 21 Aug 2019 07:06:55 +0000 (09:06 +0200)]
ci: move libc mirrors to the rust-lang-ci-mirrors bucket