]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #62452 - Centril:rollup-5jww3h7, r=Centril
bors [Sat, 6 Jul 2019 21:47:45 +0000 (21:47 +0000)]
Auto merge of #62452 - Centril:rollup-5jww3h7, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #60081 (Refactor unicode.py script)
 - #61862 (Make the Weak::{into,as}_raw methods)
 - #62243 (Improve documentation for built-in macros)
 - #62422 (Remove some uses of mem::uninitialized)
 - #62436 (normalize use of backticks/lowercase in compiler messages for librustc_mir)

Failed merges:

r? @ghost

5 years agoRollup merge of #62436 - fakenine:normalize_use_of_backticks_compiler_messages_1...
Mazdak Farrokhzad [Sat, 6 Jul 2019 20:14:39 +0000 (22:14 +0200)]
Rollup merge of #62436 - fakenine:normalize_use_of_backticks_compiler_messages_1, r=Centril

normalize use of backticks/lowercase in compiler messages for librustc_mir

normalize use of backticks/lowercase in compiler messages for librustc_mir

https://github.com/rust-lang/rust/issues/60532

r? @alexreg

5 years agoRollup merge of #62422 - lzutao:remove-some-mem-uinit, r=alexcrichton
Mazdak Farrokhzad [Sat, 6 Jul 2019 20:14:38 +0000 (22:14 +0200)]
Rollup merge of #62422 - lzutao:remove-some-mem-uinit, r=alexcrichton

Remove some uses of mem::uninitialized

cc #62397
r? @RalfJung

5 years agoRollup merge of #62243 - petrochenkov:macrodoc, r=eddyb
Mazdak Farrokhzad [Sat, 6 Jul 2019 20:14:36 +0000 (22:14 +0200)]
Rollup merge of #62243 - petrochenkov:macrodoc, r=eddyb

Improve documentation for built-in macros

This is the `libcore` part of https://github.com/rust-lang/rust/pull/62086.
Right now the only effect is improved documentation.

The changes in the last few commits are required to make the `libcore` change compile successfully.

5 years agoRollup merge of #61862 - vorner:weak-into-raw-methods, r=sfackler
Mazdak Farrokhzad [Sat, 6 Jul 2019 20:14:35 +0000 (22:14 +0200)]
Rollup merge of #61862 - vorner:weak-into-raw-methods, r=sfackler

Make the Weak::{into,as}_raw methods

Because Weak doesn't Deref, so there's no reason for them to be only
associated methods.

As kindly pointed out here https://github.com/rust-lang/rust/pull/60766#issuecomment-501706422 by @chpio.

5 years agoRollup merge of #60081 - pawroman:cleanup_unicode_script, r=varkor
Mazdak Farrokhzad [Sat, 6 Jul 2019 20:14:33 +0000 (22:14 +0200)]
Rollup merge of #60081 - pawroman:cleanup_unicode_script, r=varkor

Refactor unicode.py script

Hi, I noticed that the `unicode.py` script used some deprecated escapes in regular expressions. E.g. `\d`, `\w`, `\.` will be illegal in the future without "raw strings". This is now fixed. I have also cleaned up the script quite a bit.

## Escape deprecation

OK (note the `r`):
`re.compile(r"\d")`

Deprecated (from Python 3.6 onwards, see [here][link1] and [here][link2]):
`re.compile("\d")`.

[link1]: https://docs.python.org/3.6/whatsnew/3.6.html#deprecated-python-behavior
[link2]: https://bugs.python.org/issue27364

This was evident running the script using Python 3.7 like so:

```
$ python3 -Wall unicode.py
unicode.py:227: DeprecationWarning: invalid escape sequence \w
  re1 = re.compile("^ *([0-9A-F]+) *; *(\w+)")
unicode.py:228: DeprecationWarning: invalid escape sequence \.
  re2 = re.compile("^ *([0-9A-F]+)\.\.([0-9A-F]+) *; *(\w+)")
unicode.py:453: DeprecationWarning: invalid escape sequence \d
  pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode"
```

The documentation states that
> A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Although this will eventually become a SyntaxError, that will not be for several Python releases.

## Testing

To test my changes, I had to add support for choosing the Unicode version to use. The script will default to latest release (which is 12.0.0 at the moment, repo has 11.0.0 checked in).

The script generates the exact same output for version 11.0.0 with Python 2.7 and 3.7 and no longer generates any deprecation warnings:

```
$ python3 -Wall unicode.py -v 11.0.0
Using Unicode version: 11.0.0
Regenerated tables.rs.
$ git diff tables.rs
$ python2 -Wall unicode.py -v 11.0.0
Using Unicode version: 11.0.0
Regenerated tables.rs.
$ git diff tables.rs
$ python2 --version
Python 2.7.16
$ python3 --version
Python 3.7.3
```

## Extra functionality

Furthermore, the script will check and download the latest Unicode version by default (without the `-v` argument). The `--help` is below:

```
$ ./unicode.py --help
usage: unicode.py [-h] [-v VERSION]

Regenerate Unicode tables (tables.rs).

optional arguments:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION
                        Unicode version to use (if not specified, defaults to
                        latest available final release).
```

## Cleanups

I have cleaned up the code quite a bit, with Python best practices and code style in mind. I'm happy to provide more details and rationale for all my changes if the reviewers so desire.

One externally visible change is that the Unicode data will now be downloaded into `src/libcore/unicode/downloaded` directory suffixed by Unicode version:

```
$ pwd
.../rust/src/libcore/unicode
$ exa -T downloaded/
downloaded
├── 11.0.0
│  ├── DerivedCoreProperties.txt
│  ├── DerivedNormalizationProps.txt
│  ├── PropList.txt
│  ├── ReadMe.txt
│  ├── Scripts.txt
│  ├── SpecialCasing.txt
│  └── UnicodeData.txt
└── 12.0.0
   ├── DerivedCoreProperties.txt
   ├── DerivedNormalizationProps.txt
   ├── PropList.txt
   ├── ReadMe.txt
   ├── Scripts.txt
   ├── SpecialCasing.txt
   └── UnicodeData.txt
```

5 years agonormalize use of backticks/lowercase in compiler messages for librustc_mir
Samy Kacimi [Sat, 6 Jul 2019 07:48:03 +0000 (09:48 +0200)]
normalize use of backticks/lowercase in compiler messages for librustc_mir

https://github.com/rust-lang/rust/issues/60532

r? @alexreg

5 years agoAuto merge of #59772 - andrehjr:add-rustc-guide-to-toolstate, r=mark-i-m
bors [Sat, 6 Jul 2019 18:19:01 +0000 (18:19 +0000)]
Auto merge of #59772 - andrehjr:add-rustc-guide-to-toolstate, r=mark-i-m

Add rustc guide to toolstate

Closes #59597

5 years agoresolve: Reserve cfg/cfg_attr/derive only in attribute sub-namespace
Vadim Petrochenkov [Sat, 29 Jun 2019 22:24:34 +0000 (01:24 +0300)]
resolve: Reserve cfg/cfg_attr/derive only in attribute sub-namespace

5 years agoDon't return an error from linkcheck when it's not supported'
André Luis Leal Cardoso Junior [Fri, 5 Jul 2019 17:36:24 +0000 (14:36 -0300)]
Don't return an error from linkcheck when it's not supported'

5 years agoIgnore unused variable for non-linux builds
André Luis Leal Cardoso Junior [Fri, 5 Jul 2019 14:57:33 +0000 (11:57 -0300)]
Ignore unused variable for non-linux builds

5 years agofix macos build
Mark Mansi [Fri, 5 Jul 2019 01:20:14 +0000 (20:20 -0500)]
fix macos build

5 years agocfg: linkcheck only on x86-64 linux
Mark Mansi [Tue, 25 Jun 2019 00:07:32 +0000 (19:07 -0500)]
cfg: linkcheck only on x86-64 linux

5 years agoadd missing libssl-dev dependency to docker images on travis
André Luis Leal Cardoso Junior [Sat, 18 May 2019 20:33:52 +0000 (17:33 -0300)]
add missing libssl-dev dependency to docker images on travis

5 years agoAdd 'Apache-2.0 OR MIT' license variation to tidy/tools check
André Luis Leal Cardoso Junior [Sat, 4 May 2019 19:20:24 +0000 (16:20 -0300)]
Add 'Apache-2.0 OR MIT' license variation to tidy/tools check

5 years agoMove installing of deps to the docker container, instead of installing on the host...
André Luis Leal Cardoso Junior [Mon, 8 Apr 2019 23:59:06 +0000 (20:59 -0300)]
Move installing of deps to the docker container, instead of installing on the host machine on travis

5 years agoAdd linkcheck command to rustbook tool
André Luis Leal Cardoso Junior [Sun, 7 Apr 2019 12:59:33 +0000 (09:59 -0300)]
Add linkcheck command to rustbook tool

5 years agoTrack rustc-guide on toolstate
André Luis Leal Cardoso Junior [Thu, 4 Apr 2019 16:06:05 +0000 (13:06 -0300)]
Track rustc-guide on toolstate

5 years agoadd ./x.py test src/doc/rustc-guide
André Luis Leal Cardoso Junior [Thu, 4 Apr 2019 16:05:22 +0000 (13:05 -0300)]
add ./x.py test src/doc/rustc-guide

5 years agoprivacy: Only opaque macros leak private things
Vadim Petrochenkov [Sat, 29 Jun 2019 22:12:04 +0000 (01:12 +0300)]
privacy: Only opaque macros leak private things

5 years agoFix tidy issues
Vadim Petrochenkov [Sat, 29 Jun 2019 22:09:59 +0000 (01:09 +0300)]
Fix tidy issues

5 years agoImprove documentation for built-in macros
Vadim Petrochenkov [Sat, 29 Jun 2019 14:51:20 +0000 (17:51 +0300)]
Improve documentation for built-in macros

5 years ago`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`
Vadim Petrochenkov [Sun, 23 Jun 2019 13:37:28 +0000 (16:37 +0300)]
`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`

5 years ago`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`
Vadim Petrochenkov [Sat, 29 Jun 2019 14:30:51 +0000 (17:30 +0300)]
`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`

5 years agoAuto merge of #61988 - Centril:there-is-only-loop, r=matthewjasper
bors [Sat, 6 Jul 2019 06:15:44 +0000 (06:15 +0000)]
Auto merge of #61988 - Centril:there-is-only-loop, r=matthewjasper

[let_chains, 3/6] And then there was only Loop

Here we remove `hir::ExprKind::While`.
Instead, we desugar: `'label: while $cond $body` into:

```rust
'label: loop {
    match DropTemps($cond) {
        true => $body,
        _ => break,
    }
}
```

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.
This is a follow up to https://github.com/rust-lang/rust/pull/59288 which did the same for `if` expressions.

r? @matthewjasper

5 years ago--bless --compare-mode=nll
Mazdak Farrokhzad [Fri, 5 Jul 2019 08:34:30 +0000 (10:34 +0200)]
--bless --compare-mode=nll

5 years agoBless mir-opt/while-storage.rs.
Mazdak Farrokhzad [Wed, 26 Jun 2019 15:44:26 +0000 (17:44 +0200)]
Bless mir-opt/while-storage.rs.

5 years agoCleanup liveness comment.
Mazdak Farrokhzad [Wed, 26 Jun 2019 12:51:01 +0000 (14:51 +0200)]
Cleanup liveness comment.

5 years agowhile_{let_}loops/change_{break,continue}: typeck_tables_of clean.
Mazdak Farrokhzad [Mon, 24 Jun 2019 02:27:20 +0000 (04:27 +0200)]
while_{let_}loops/change_{break,continue}: typeck_tables_of clean.

5 years agoLowering: Fuse ExprKind::While logic + Cleanup.
Mazdak Farrokhzad [Sun, 23 Jun 2019 16:58:36 +0000 (18:58 +0200)]
Lowering: Fuse ExprKind::While logic + Cleanup.

5 years agoMake WhileTrue into an EarlyLintPass lint.
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:30:24 +0000 (01:30 +0200)]
Make WhileTrue into an EarlyLintPass lint.

5 years agoMake sure while-exprs require 'cond: bool' exactly.
Mazdak Farrokhzad [Thu, 20 Jun 2019 12:13:28 +0000 (14:13 +0200)]
Make sure while-exprs require 'cond: bool' exactly.

5 years agoAdjust incremental test while_loops.rs
Mazdak Farrokhzad [Thu, 20 Jun 2019 10:29:22 +0000 (12:29 +0200)]
Adjust incremental test while_loops.rs

5 years agowhile desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.
Mazdak Farrokhzad [Thu, 20 Jun 2019 08:35:27 +0000 (10:35 +0200)]
while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.

5 years agoEnforce 'cond: bool' in while-expr + improve reachability diags.
Mazdak Farrokhzad [Thu, 20 Jun 2019 08:29:42 +0000 (10:29 +0200)]
Enforce 'cond: bool' in while-expr + improve reachability diags.

5 years agomin_const_fn: change error message due to changed desugaring.
Mazdak Farrokhzad [Thu, 20 Jun 2019 05:16:26 +0000 (07:16 +0200)]
min_const_fn: change error message due to changed desugaring.

5 years agoRemove ExprKind::While from HIR.
Mazdak Farrokhzad [Wed, 19 Jun 2019 15:21:28 +0000 (17:21 +0200)]
Remove ExprKind::While from HIR.

5 years agoRemove use of mem::uninitialized in code_gen crate
Lzu Tao [Fri, 5 Jul 2019 19:26:25 +0000 (19:26 +0000)]
Remove use of mem::uninitialized in code_gen crate

5 years agoRemove use of mem::uninitialized in libterm crate
Lzu Tao [Fri, 5 Jul 2019 18:59:56 +0000 (18:59 +0000)]
Remove use of mem::uninitialized in libterm crate

5 years agoAuto merge of #62428 - Centril:rollup-2udow5e, r=Centril
bors [Sat, 6 Jul 2019 02:58:36 +0000 (02:58 +0000)]
Auto merge of #62428 - Centril:rollup-2udow5e, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62151 (Update linked OpenSSL version)
 - #62245 (Miri engine: support extra function (pointer) values)
 - #62257 (forward read_c_str method from Memory to Alloc)
 - #62264 (Fix perf regression from Miri Machine trait changes)
 - #62296 (request at least ptr-size alignment from posix_memalign)
 - #62329 (Remove support for 1-token lookahead from the lexer)
 - #62377 (Add test for ICE #62375)

Failed merges:

r? @ghost

5 years agoRollup merge of #62377 - wesleywiser:fix_62375, r=alexcrichton
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:38:02 +0000 (02:38 +0200)]
Rollup merge of #62377 - wesleywiser:fix_62375, r=alexcrichton

Add test for ICE #62375

Fixes #62375

5 years agoRollup merge of #62329 - matklad:no-peeking, r=petrochenkov
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:38:01 +0000 (02:38 +0200)]
Rollup merge of #62329 - matklad:no-peeking, r=petrochenkov

Remove support for 1-token lookahead from the lexer

`StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead.

`peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking.

After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans.

After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.

5 years agoRollup merge of #62296 - RalfJung:memalign, r=alexcrichton
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:59 +0000 (02:37 +0200)]
Rollup merge of #62296 - RalfJung:memalign, r=alexcrichton

request at least ptr-size alignment from posix_memalign

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

5 years agoRollup merge of #62264 - RalfJung:inline-forcing, r=zackmdavis
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:58 +0000 (02:37 +0200)]
Rollup merge of #62264 - RalfJung:inline-forcing, r=zackmdavis

Fix perf regression from Miri Machine trait changes

Maybe this fixes the perf regression that https://github.com/rust-lang/rust/pull/62003 seemingly introduced?

Cc @nnethercote

5 years agoRollup merge of #62257 - RalfJung:miri-c-str, r=estebank
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:56 +0000 (02:37 +0200)]
Rollup merge of #62257 - RalfJung:miri-c-str, r=estebank

forward read_c_str method from Memory to Alloc

This is more convenient to call when one starts with a `Scalar` (which is the common case).

`read_c_str` is only used in Miri.

5 years agoRollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavis
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:54 +0000 (02:37 +0200)]
Rollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavis

Miri engine: support extra function (pointer) values

We want to add basic support for `dlsym` in Miri (needed to run the latest version of `getrandom`). For that to work, `dlsym` needs to return *something* that can be stored in a function pointer and later called.

So we add a new `ExtraFnVal` type to the `Machine` trait, and enable Miri's memory to associate allocation IDs with such values, so that `create_fn_alloc` and `get_fn` can work on *both* `Instance` (this is used for "normal" function pointers) and `ExtraFnVal`.

Cc @oli-obk

5 years agoRollup merge of #62151 - alexcrichton:update-openssl, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:53 +0000 (02:37 +0200)]
Rollup merge of #62151 - alexcrichton:update-openssl, r=Mark-Simulacrum

Update linked OpenSSL version

This bumps our linked OpenSSL version from 1.1.1a to 1.1.1c, picking up
some various bug fixes and minor security issue fixes.

5 years agoCorrect definition of CONSOLE_SCREEN_BUFFER_INFO
Lzu Tao [Fri, 5 Jul 2019 18:47:55 +0000 (18:47 +0000)]
Correct definition of CONSOLE_SCREEN_BUFFER_INFO

5 years agoAuto merge of #62419 - Centril:rollup-82umycq, r=Centril
bors [Fri, 5 Jul 2019 18:27:52 +0000 (18:27 +0000)]
Auto merge of #62419 - Centril:rollup-82umycq, r=Centril

Rollup of 13 pull requests

Successful merges:

 - #61545 (Implement another internal lints)
 - #62110 (Improve -Ztime-passes)
 - #62133 (Feature gate `rustc` attributes harder)
 - #62158 (Add MemoryExtra in InterpretCx constructor params)
 - #62168 (The (almost) culmination of HirIdification)
 - #62193 (Create async version of the dynamic-drop test)
 - #62369 (Remove `compile-pass` from compiletest)
 - #62380 (rustc_target: avoid negative register counts in the SysV x86_64 ABI.)
 - #62381 (Fix a typo in Write::write_vectored docs)
 - #62390 (Update README.md)
 - #62396 (remove Scalar::is_null_ptr)
 - #62406 (Lint on invalid values passed to x.py --warnings)
 - #62414 (Remove last use of mem::uninitialized in SGX)

Failed merges:

r? @ghost

5 years agoRollup merge of #62414 - jethrogb:jb/sgx-uninit, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:08 +0000 (20:27 +0200)]
Rollup merge of #62414 - jethrogb:jb/sgx-uninit, r=Mark-Simulacrum

Remove last use of mem::uninitialized in SGX

See #62397

5 years agoRollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:06 +0000 (20:27 +0200)]
Rollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJung

Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

Fixes #62402

r? @RalfJung

5 years agoRollup merge of #62396 - RalfJung:miri-no-null, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:05 +0000 (20:27 +0200)]
Rollup merge of #62396 - RalfJung:miri-no-null, r=alexcrichton

remove Scalar::is_null_ptr

Comparing pointers should be done more carefully than that. With https://github.com/rust-lang/miri/pull/825, Miri does not need it any more and it is otherwise unused.

5 years agoRollup merge of #62390 - markebrooks:encourage, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:04 +0000 (20:27 +0200)]
Rollup merge of #62390 - markebrooks:encourage, r=Centril

Update README.md

Let's not discourage contributions.

5 years agoRollup merge of #62381 - pawroman:fix_typo_in_write_vectored, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:02 +0000 (20:27 +0200)]
Rollup merge of #62381 - pawroman:fix_typo_in_write_vectored, r=Centril

Fix a typo in Write::write_vectored docs

Fixed what seems like a typo. "Copy to from" is extremely confusing.

5 years agoRollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisa
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:01 +0000 (20:27 +0200)]
Rollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisa

rustc_target: avoid negative register counts in the SysV x86_64 ABI.

Because `needed_{int,sse}` and `{int,sse}_regs` were only used with integer literals, they were inferred to `i32` and `{int,sse}_regs` could therefore be negative.
There was a check which prevented that, but *only* for aggregate arguments, not scalars.

Fixes #62350.

r? @nagisa or @rkruppe

5 years agoRollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkov
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:59 +0000 (20:26 +0200)]
Rollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkov

Remove `compile-pass` from compiletest

This is a part of #62277.
Removes `compile-pass` from compiletest (and modify some tests' annotations).

r? @Centril

5 years agoRollup merge of #62193 - matthewjasper:dynamic-drop-async, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:58 +0000 (20:26 +0200)]
Rollup merge of #62193 - matthewjasper:dynamic-drop-async, r=Centril

Create async version of the dynamic-drop test

Some of the tests in dynamic-drop have been cut:
* The tests that are just simpler versions of other tests - these tests are already fairly slow due to all of the unwinding and async functions have more control flow paths than normal functions.
* The union test - it's for an unstable feature that has an RFC to remove it.
* The generator test - there aren't async generators yet.
* The tests that show values being leaked - these can be added once the issue is fixed.

r? @Centril
cc  #62121 @cramertj

5 years agoRollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:56 +0000 (20:26 +0200)]
Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc

The (almost) culmination of HirIdification

It's finally over.

This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name.
All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.

5 years agoRollup merge of #62158 - christianpoveda:ecx-memory-extra, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:55 +0000 (20:26 +0200)]
Rollup merge of #62158 - christianpoveda:ecx-memory-extra, r=RalfJung

Add MemoryExtra in InterpretCx constructor params

This is to avoid modifying `MemoryExtra` inside `InterpretCx` after initialization. Related miri PR: https://github.com/rust-lang/miri/pull/792

r? @RalfJung

5 years agoRollup merge of #62133 - petrochenkov:norustc, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:54 +0000 (20:26 +0200)]
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb

Feature gate `rustc` attributes harder

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

5 years agoRollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:52 +0000 (20:26 +0200)]
Rollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc

Improve -Ztime-passes

Two improvements that make `-Ztime-passes` more useful.

r? @Zoxc

5 years agoRollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:51 +0000 (20:26 +0200)]
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk

Implement another internal lints

cc #49509

This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~

~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~

TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros

r? @oli-obk

5 years agoFix test annotation
Yuki Okushi [Fri, 5 Jul 2019 17:06:39 +0000 (02:06 +0900)]
Fix test annotation

5 years agoUpdate rustc-guide
Yuki Okushi [Thu, 4 Jul 2019 11:56:13 +0000 (20:56 +0900)]
Update rustc-guide

5 years agoRemove compile-pass from error codes' explanation
Yuki Okushi [Thu, 4 Jul 2019 11:52:26 +0000 (20:52 +0900)]
Remove compile-pass from error codes' explanation

5 years agoRemove compile-pass from compiletest
Yuki Okushi [Thu, 4 Jul 2019 10:28:20 +0000 (19:28 +0900)]
Remove compile-pass from compiletest

Also change annotations in some tests

5 years agoRemove last use of mem::uninitialized in SGX
Jethro Beekman [Fri, 5 Jul 2019 16:03:49 +0000 (09:03 -0700)]
Remove last use of mem::uninitialized in SGX

5 years agoLint on invalid values passed to x.py --warnings
Mark Rousskov [Fri, 5 Jul 2019 11:24:58 +0000 (07:24 -0400)]
Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

5 years agoAuto merge of #62407 - Centril:rollup-g0zmff7, r=Centril
bors [Fri, 5 Jul 2019 11:53:52 +0000 (11:53 +0000)]
Auto merge of #62407 - Centril:rollup-g0zmff7, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #62123 ( Remove needless lifetimes (std))
 - #62150 (Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.)
 - #62169 (Derive which queries to save using the proc macro)
 - #62238 (Fix code block information icon position)
 - #62292 (Move `async || ...` closures into `#![feature(async_closure)]`)
 - #62323 (Clarify unaligned fields in ptr::{read,write}_unaligned)
 - #62324 (Reduce reliance on `await!(...)` macro)
 - #62371 (Add tracking issue for Box::into_pin)
 - #62383 (Improve error span for async type inference error)
 - #62388 (Break out of the correct number of scopes in loops)

Failed merges:

r? @ghost

5 years agoRollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:13 +0000 (13:53 +0200)]
Rollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddyb

Break out of the correct number of scopes in loops

We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.

Closes #62312

5 years agoRollup merge of #62383 - Aaron1011:fix/async-error-span, r=varkor
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:11 +0000 (13:53 +0200)]
Rollup merge of #62383 - Aaron1011:fix/async-error-span, r=varkor

Improve error span for async type inference error

Fixes #62382

Previously, we would point at the spawn of the 'await' expression,
instead of the actual expression with an unknown type.

5 years agoRollup merge of #62371 - Nemo157:fix-62288, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:10 +0000 (13:53 +0200)]
Rollup merge of #62371 - Nemo157:fix-62288, r=Centril

Add tracking issue for Box::into_pin

Fixes #62288

5 years agoRollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:09 +0000 (13:53 +0200)]
Rollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj

Reduce reliance on `await!(...)` macro

Only the last commit is new.

r? @cramertj

5 years agoRollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:07 +0000 (13:53 +0200)]
Rollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung

Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung

5 years agoRollup merge of #62292 - Centril:split-async-closures, r=cramertj
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:06 +0000 (13:53 +0200)]
Rollup merge of #62292 - Centril:split-async-closures, r=cramertj

Move `async || ...` closures into `#![feature(async_closure)]`

The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`.

New tracking issue: https://github.com/rust-lang/rust/issues/62290

Closes https://github.com/rust-lang/rust/issues/62214.

cc https://github.com/rust-lang/rust/issues/62149

r? @varkor

5 years agoRollup merge of #62238 - GuillaumeGomez:fix-code-block-information-icon-pos, r=QuietM...
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:04 +0000 (13:53 +0200)]
Rollup merge of #62238 - GuillaumeGomez:fix-code-block-information-icon-pos, r=QuietMisdreavus

Fix code block information icon position

Fixes #62118.

A screenshot of the fix:

<img width="720" alt="Screenshot 2019-06-29 at 18 28 59" src="https://user-images.githubusercontent.com/3050060/60386900-edb23b80-9a9b-11e9-9f4f-0f343674348c.png">

r? @rust-lang/rustdoc

5 years agoRollup merge of #62169 - Zoxc:store-query-results, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:02 +0000 (13:53 +0200)]
Rollup merge of #62169 - Zoxc:store-query-results, r=eddyb

Derive which queries to save using the proc macro

Based on https://github.com/rust-lang/rust/pull/62166.

r? @eddyb

5 years agoRollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:00 +0000 (13:53 +0200)]
Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung

Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.

Refs #62061

r? @oli-obk

5 years agoRollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:52:58 +0000 (13:52 +0200)]
Rollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton

 Remove needless lifetimes (std)

Split from #62039

5 years agorustc_target: avoid negative register counts in the SysV x86_64 ABI.
Eduard-Mihai Burtescu [Thu, 4 Jul 2019 16:31:52 +0000 (19:31 +0300)]
rustc_target: avoid negative register counts in the SysV x86_64 ABI.

5 years agoAuto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb
bors [Fri, 5 Jul 2019 06:55:48 +0000 (06:55 +0000)]
Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb

Remove io::Result from syntax::print

Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure

5 years agoremove Scalar::is_null_ptr
Ralf Jung [Fri, 5 Jul 2019 06:44:16 +0000 (08:44 +0200)]
remove Scalar::is_null_ptr

Miri does not need it any more and it is otherwise unused

5 years agoAuto merge of #62376 - Mark-Simulacrum:1.38-nightly, r=alexcrichton
bors [Fri, 5 Jul 2019 03:33:03 +0000 (03:33 +0000)]
Auto merge of #62376 - Mark-Simulacrum:1.38-nightly, r=alexcrichton

Switch master to 1.38

5 years agoPermit use of mem::uninitialized via allow(deprecated)
Mark Rousskov [Thu, 4 Jul 2019 15:24:56 +0000 (11:24 -0400)]
Permit use of mem::uninitialized via allow(deprecated)

5 years agoAdd a "total" measurement to -Ztime-passes.
Nicholas Nethercote [Tue, 25 Jun 2019 03:52:07 +0000 (13:52 +1000)]
Add a "total" measurement to -Ztime-passes.

This is useful for getting the total compilation time at the end.
To do this, the patch changes `print_time_passes_entry` to not increment
the depth, which means that `print_time_passes_entry_internal` is no
longer needed.

5 years agoRemove `solve_nll_region_constraints` measurements from `-Ztime-passes` output.
Nicholas Nethercote [Tue, 25 Jun 2019 00:04:47 +0000 (10:04 +1000)]
Remove `solve_nll_region_constraints` measurements from `-Ztime-passes` output.

Because it pollutes the output with hundreds or thousands of
uninteresting lines for which the time duration is always(?) 0.000s.

5 years agoAuto merge of #62153 - alexcrichton:parallel-compress, r=Mark-Simulacrum
bors [Thu, 4 Jul 2019 22:14:08 +0000 (22:14 +0000)]
Auto merge of #62153 - alexcrichton:parallel-compress, r=Mark-Simulacrum

Update the `rust-installer` submodule

This pulls in a commit which uses parallel xz encoding which should
hopefully help shave some time off the dist builders which spend an
inordinate amount of time compressing this data.

5 years agoUpdate README.md
Mark Brooks [Thu, 4 Jul 2019 21:35:26 +0000 (17:35 -0400)]
Update README.md

5 years agoBreak out of the correct number of scopes in loops
Matthew Jasper [Thu, 4 Jul 2019 20:53:46 +0000 (21:53 +0100)]
Break out of the correct number of scopes in loops

We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.

5 years agoCreate async version of the dynamic-drop test
Matthew Jasper [Thu, 27 Jun 2019 20:46:23 +0000 (21:46 +0100)]
Create async version of the dynamic-drop test

5 years agoUpdate the `rust-installer` submodule
Alex Crichton [Wed, 26 Jun 2019 15:24:43 +0000 (08:24 -0700)]
Update the `rust-installer` submodule

This pulls in a commit which uses parallel xz encoding which should
hopefully help shave some time off the dist builders which spend an
inordinate amount of time compressing this data.

5 years agoAuto merge of #61392 - Zoxc:single-interner, r=eddyb
bors [Thu, 4 Jul 2019 18:44:49 +0000 (18:44 +0000)]
Auto merge of #61392 - Zoxc:single-interner, r=eddyb

Use a single CtxtInterners

Builds on https://github.com/rust-lang/rust/pull/57214

r? @eddyb

5 years agoImprove error span for async type inference error
Aaron Hill [Thu, 4 Jul 2019 18:20:04 +0000 (14:20 -0400)]
Improve error span for async type inference error

Fixes #62382

Previously, we would point at the spawn of the 'await' expression,
instead of the actual expression with an unknown type.

5 years agoFix a typo in Write::write_vectored docs
Paweł Romanowski [Thu, 4 Jul 2019 16:44:34 +0000 (18:44 +0200)]
Fix a typo in Write::write_vectored docs

5 years agoSwitch master to 1.38
Mark Rousskov [Thu, 4 Jul 2019 14:05:50 +0000 (10:05 -0400)]
Switch master to 1.38

5 years agoAdd test for ICE #62375
Wesley Wiser [Thu, 4 Jul 2019 14:48:47 +0000 (10:48 -0400)]
Add test for ICE #62375

Fixes #62375

5 years agoImplement mem::{zeroed,uninitialized} in terms of MaybeUninit.
Alex Gaynor [Wed, 26 Jun 2019 11:50:30 +0000 (07:50 -0400)]
Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.

Refs #62061

5 years agoAdd tracking issue for Box::into_pin
Wim Looman [Thu, 4 Jul 2019 10:55:23 +0000 (12:55 +0200)]
Add tracking issue for Box::into_pin

5 years agoinfer: fix a Region-related debug message
ljedrz [Tue, 2 Jul 2019 07:43:33 +0000 (09:43 +0200)]
infer: fix a Region-related debug message

5 years agofix a dep_graph doc regarding type_of_item
ljedrz [Tue, 2 Jul 2019 06:45:56 +0000 (08:45 +0200)]
fix a dep_graph doc regarding type_of_item