]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #61364 - lzutao:stabilize-reverse_bits, r=Centril
Mazdak Farrokhzad [Sat, 1 Jun 2019 04:50:03 +0000 (06:50 +0200)]
Rollup merge of #61364 - lzutao:stabilize-reverse_bits, r=Centril

Stabilize reverse_bits feature

FCP done in https://github.com/rust-lang/rust/issues/48763#issuecomment-497349379

Closes #48763

r? @Centril

5 years agoRollup merge of #61263 - GuillaumeGomez:valid-html, r=Manishearth
Mazdak Farrokhzad [Sat, 1 Jun 2019 04:50:02 +0000 (06:50 +0200)]
Rollup merge of #61263 - GuillaumeGomez:valid-html, r=Manishearth

Don't generate div inside header (h4/h3/h...) elements

Fixes #60865.

According to the HTML spec, we're not supposed to put `div` elements inside heading elements (h4/h3/h...). It doesn't change the display as far as I could tell.

r? @QuietMisdreavus

5 years agoRollup merge of #60729 - matthewjasper:leak-after-into, r=nikomatsakis
Mazdak Farrokhzad [Sat, 1 Jun 2019 04:50:00 +0000 (06:50 +0200)]
Rollup merge of #60729 - matthewjasper:leak-after-into, r=nikomatsakis

Expand dynamic drop tests for cases in #47949

Adds test cases for #47949

5 years agoAuto merge of #61394 - pietroalbini:rollup-lzugnb4, r=pietroalbini
bors [Sat, 1 Jun 2019 00:57:37 +0000 (00:57 +0000)]
Auto merge of #61394 - pietroalbini:rollup-lzugnb4, r=pietroalbini

Rollup of 11 pull requests

Successful merges:

 - #60897 (error: remove StringError from Debug output)
 - #61304 (Speed up Azure CI installing Windows dependencies)
 - #61319 (Swap order of `unsafe async fn` to `async unsafe fn`)
 - #61342 (Set ellipsis_inclusive_range_patterns lint to warn)
 - #61344 (Add regression test for const generics ICE)
 - #61359 (Fix links in Deref documentation)
 - #61363 (Stabilize iter_nth_back feature)
 - #61369 (Fixed lifetime misspelling)
 - #61372 (Migrate some books to mdbook version 0.2)
 - #61374 (Explicitly suggest 'type_ascription' feature)
 - #61382 (Fixed a typo in core::convert::AsMut)

Failed merges:

r? @ghost

5 years agoAuto merge of #61300 - indygreg:upgrade-cross-make, r=sanxiyn
bors [Fri, 31 May 2019 22:16:09 +0000 (22:16 +0000)]
Auto merge of #61300 - indygreg:upgrade-cross-make, r=sanxiyn

Update musl-cross-make to 0.9.8

This version uses musl 1.1.22 and GCC 6.4.0 by default. It also
contains support for newer binutils and GCC versions, should we
want to bump those as well. But I'm purposefully limiting this
patch in order to reduce the surface area for controversy.

5 years agoAuto merge of #57967 - eddyb:rmangle, r=michaelwoerister
bors [Fri, 31 May 2019 17:10:11 +0000 (17:10 +0000)]
Auto merge of #57967 - eddyb:rmangle, r=michaelwoerister

Introduce Rust symbol mangling scheme.

This is an implementation of a "feature-complete" Rust mangling scheme, in the vein of rust-lang/rfcs#2603 ~~- but with some differences, see https://github.com/rust-lang/rfcs/pull/2603#issuecomment-458410463 for details~~ (@michaelwoerister integrated my proposed changes into the RFC itself).

On nightly, you can now control the mangling scheme with `-Z symbol-mangling-version`, which can be:
* `legacy`: the older mangling version, still the default currently
* `v0`: the new RFC mangling version, as implemented by this PR

To test the new mangling, set `RUSTFLAGS=-Zsymbol-mangling-version=v0` (or change [`rustflags` in `.cargo/config.toml`](https://doc.rust-lang.org/cargo/reference/config.html#configuration-keys)). Please note that only symbols from crates built with that flag will use the new mangling, and that tool support (e.g. debuggers) will be limited initially, and it may take a while for everything to be upstreamed. However, `RUST_BACKTRACE` should work out of the box with either mangling version.

<hr/>

The demangling implementation PR is https://github.com/alexcrichton/rustc-demangle/pull/23
~~(this PR already uses it via a git dependency, to allow testing)~~.

Discussion of the *design* of the mangling scheme should still happen on the RFC, but this PR's specific implementation details can be reviewed in parallel.

*Notes for reviewers*:
* ~~only the last 6 commits are specific to this branch, if necessary I can open a separate PR for everything else (it was meant to be its own small refactoring, but it got a bit out of hand)~~
~~based on #58140~~
* the "harness" commit is only there because it does some extra validation (comparing the demangling from `rustc-demangle` to the compiler's pretty-printing, adjusted slightly to produce the same output), that I would like to try on crater
* ~~there is the question of whether we should turn on the new mangling now, wait for tools to support it (I'm working on that), and/or have it under a `-Z` flag for now~~ (we're gating this on `-Z symbol-mangling-version=v0`, see above)

r? @nikomatsakis / @michaelwoerister cc @rust-lang/compiler

5 years agotest: add a more complex symbol-name testcase.
Eduard-Mihai Burtescu [Thu, 30 May 2019 00:56:45 +0000 (03:56 +0300)]
test: add a more complex symbol-name testcase.

5 years agorustc_codegen_utils: remove symbol name dumping/checking harness, and mw impl.
Eduard-Mihai Burtescu [Wed, 10 Apr 2019 05:33:31 +0000 (08:33 +0300)]
rustc_codegen_utils: remove symbol name dumping/checking harness, and mw impl.

5 years agorustc_codegen_utils: update mw's symbol mangler implementation.
Eduard-Mihai Burtescu [Thu, 4 Apr 2019 18:29:07 +0000 (21:29 +0300)]
rustc_codegen_utils: update mw's symbol mangler implementation.

5 years agorustc_codegen_utils: add harness for dumping/checking symbol names, and mw mangling...
Eduard-Mihai Burtescu [Wed, 29 May 2019 21:42:56 +0000 (00:42 +0300)]
rustc_codegen_utils: add harness for dumping/checking symbol names, and mw mangling impl.

5 years agotest: force `legacy` mangling for run-make-fulldeps/a-b-a-linker-guard.
Eduard-Mihai Burtescu [Tue, 29 Jan 2019 22:53:36 +0000 (00:53 +0200)]
test: force `legacy` mangling for run-make-fulldeps/a-b-a-linker-guard.

5 years agotest: support both (`legacy` and `v0`) choices of mangling.
Eduard-Mihai Burtescu [Sat, 13 Apr 2019 16:03:02 +0000 (19:03 +0300)]
test: support both (`legacy` and `v0`) choices of mangling.

5 years agorustc_codegen_utils: don't ignore `Ctor` path components in symbols.
Eduard-Mihai Burtescu [Mon, 4 Feb 2019 07:03:31 +0000 (09:03 +0200)]
rustc_codegen_utils: don't ignore `Ctor` path components in symbols.

5 years agorustc_codegen_utils: add new mangling scheme implementation.
Eduard-Mihai Burtescu [Tue, 29 Jan 2019 05:24:32 +0000 (07:24 +0200)]
rustc_codegen_utils: add new mangling scheme implementation.

5 years agorustc_codegen_utils: test demangler output, not just symbol names.
Eduard-Mihai Burtescu [Wed, 29 May 2019 20:58:55 +0000 (23:58 +0300)]
rustc_codegen_utils: test demangler output, not just symbol names.

5 years agoUpdate rustc-demangle version.
Eduard-Mihai Burtescu [Thu, 30 May 2019 19:58:49 +0000 (22:58 +0300)]
Update rustc-demangle version.

5 years agoAuto merge of #61298 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Fri, 31 May 2019 14:06:17 +0000 (14:06 +0000)]
Auto merge of #61298 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from fb33fad0 to d2f51228

Changes:
````
Rustup to https://github.com/rust-lang/rust/pull/61203
rustup https://github.com/rust-lang/rust/pull/60928
rustup https://github.com/rust-lang/rust/pull/61164 (which is included in https://github.com/rust-lang/rust/pull/61274)
````

Fixes #61287

r? @oli-obk

5 years agoRollup merge of #61382 - OptimisticPeach:patch-1, r=Centril
Pietro Albini [Fri, 31 May 2019 11:34:08 +0000 (13:34 +0200)]
Rollup merge of #61382 - OptimisticPeach:patch-1, r=Centril

Fixed a typo in core::convert::AsMut

Just missing a space, and added a comma to make more idiomatic.

5 years agoRollup merge of #61374 - VirrageS:master, r=Centril
Pietro Albini [Fri, 31 May 2019 11:34:07 +0000 (13:34 +0200)]
Rollup merge of #61374 - VirrageS:master, r=Centril

Explicitly suggest 'type_ascription' feature

Closes: #61325
r? @estebank

5 years agoRollup merge of #61372 - mati865:books, r=Centril,GuillaumeGomez
Pietro Albini [Fri, 31 May 2019 11:34:06 +0000 (13:34 +0200)]
Rollup merge of #61372 - mati865:books, r=Centril,GuillaumeGomez

Migrate some books to mdbook version 0.2

There are 3 books still using old version but they need more effort so I hope to do them in subsequent PR if I find the time.

5 years agoRollup merge of #61369 - Vallentin:patch-1, r=varkor
Pietro Albini [Fri, 31 May 2019 11:34:03 +0000 (13:34 +0200)]
Rollup merge of #61369 - Vallentin:patch-1, r=varkor

Fixed lifetime misspelling

5 years agoRollup merge of #61363 - lzutao:stabilize-iter_nth_back, r=Centril
Pietro Albini [Fri, 31 May 2019 11:34:02 +0000 (13:34 +0200)]
Rollup merge of #61363 - lzutao:stabilize-iter_nth_back, r=Centril

Stabilize iter_nth_back feature

FCP done in https://github.com/rust-lang/rust/issues/56995#issuecomment-491145691

Closes #56995

r? @Centril

5 years agoRollup merge of #61359 - GuillaumeGomez:fix-deref-doc-links, r=Manishearth
Pietro Albini [Fri, 31 May 2019 11:34:00 +0000 (13:34 +0200)]
Rollup merge of #61359 - GuillaumeGomez:fix-deref-doc-links, r=Manishearth

Fix links in Deref documentation

Fixes #61358.

In commonmark, the "link alias" has to be right after the link. Screenshot:

<img width="970" alt="Screenshot 2019-05-30 at 19 01 58" src="https://user-images.githubusercontent.com/3050060/58650155-3b594e00-830e-11e9-956c-4dadefa40ff0.png">

r? @Manishearth

5 years agoRollup merge of #61344 - varkor:const-failed-to-life-ice, r=Centril
Pietro Albini [Fri, 31 May 2019 11:33:58 +0000 (13:33 +0200)]
Rollup merge of #61344 - varkor:const-failed-to-life-ice, r=Centril

Add regression test for const generics ICE

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

5 years agoRollup merge of #61342 - memoryruins:ellipsis_inclusive_range_patterns, r=Centril
Pietro Albini [Fri, 31 May 2019 11:33:57 +0000 (13:33 +0200)]
Rollup merge of #61342 - memoryruins:ellipsis_inclusive_range_patterns, r=Centril

Set ellipsis_inclusive_range_patterns lint to warn

Continuing #54910, the `ellipsis_inclusive_range_patterns` lint is set to warn.

r? @Centril

5 years agoRollup merge of #61319 - Centril:async-unsafe-fn-order, r=cramertj
Pietro Albini [Fri, 31 May 2019 11:33:55 +0000 (13:33 +0200)]
Rollup merge of #61319 - Centril:async-unsafe-fn-order, r=cramertj

Swap order of `unsafe async fn` to `async unsafe fn`

Change the order of `unsafe async fn` to `async unsafe fn`.

I had intended to do this a while back but didn't get around to it...

This should be done because:
- It is the order used by `const unsafe fn` so therefore it is consistent.
- This keeps all the "effect/restriction" modifiers to the left of `unsafe` (which according to some is not an effect) instead of mixing them such that we are more forward compatible with some sort of effect system.

r? @cramertj

5 years agoRollup merge of #61304 - lzybkr:iwr_progress, r=alexcrichton
Pietro Albini [Fri, 31 May 2019 11:33:54 +0000 (13:33 +0200)]
Rollup merge of #61304 - lzybkr:iwr_progress, r=alexcrichton

Speed up Azure CI installing Windows dependencies

There is known issue where PowerShell is unreasonably slow downloading
files due to an issue with rendering the progress bar, see this [issue](https://github.com/PowerShell/PowerShell/issues/2138)

That issue is fixed in PowerShell Core (available in Azure Pipelines as
pwsh.exe) but it can also be worked around by setting:

    $ProgressPreference = 'SilentlyContinue'

I measured downloading LLVM and it took about 220s before, 5s after, so the improvement is significant.

5 years agoRollup merge of #60897 - seanmonstar:patch-4, r=sfackler
Pietro Albini [Fri, 31 May 2019 11:33:51 +0000 (13:33 +0200)]
Rollup merge of #60897 - seanmonstar:patch-4, r=sfackler

error: remove StringError from Debug output

Seeing `StringError("something something")` in debug output can cause
 someone to think there was an error dealing with `String`s, not that the
error type is just a string. So, remove that noise.

For example:

```
io error: Custom { kind: InvalidData, error: StringError("corrupt data") }
```

With this change:

```
io error: Custom { kind: InvalidData, error: "corrupt data" }
```

5 years agoAuto merge of #60166 - oli-obk:type_name, r=eddyb
bors [Fri, 31 May 2019 10:42:31 +0000 (10:42 +0000)]
Auto merge of #60166 - oli-obk:type_name, r=eddyb

Make the `type_name` intrinsic deterministic

cc @eddyb for the printing infrastructure
cc @Centril for the deterministic (coherent?) output

r? @sfackler

5 years agoStabilize reverse_bits feature
Lzu Tao [Thu, 30 May 2019 18:51:47 +0000 (18:51 +0000)]
Stabilize reverse_bits feature

5 years agoFixed some typos.
OptimisticPeach [Thu, 30 May 2019 23:37:23 +0000 (19:37 -0400)]
Fixed some typos.

5 years agoParse 'async unsafe fn' instead of 'unsafe async fn'.
Mazdak Farrokhzad [Wed, 29 May 2019 14:53:48 +0000 (16:53 +0200)]
Parse 'async unsafe fn' instead of 'unsafe async fn'.

5 years agoExplicitly suggest 'type_ascription' feature
Janusz Marcinkiewicz [Thu, 30 May 2019 20:41:09 +0000 (22:41 +0200)]
Explicitly suggest 'type_ascription' feature

5 years agoAuto merge of #61353 - alexcrichton:less-tools, r=pietroalbini
bors [Thu, 30 May 2019 19:52:11 +0000 (19:52 +0000)]
Auto merge of #61353 - alexcrichton:less-tools, r=pietroalbini

ci: Favor SCRIPT instead of RUST_CHECK_TARGET

Since #61212 we've been timing out on OSX, and this looks to be because
we're building tools like Cargo and the RLS twice instead of once. This
turns out to be a slight bug in our configuration. CI builders using the
`RUST_CHECK_TARGET` directive actually execute `make all` just before
their acual target. In `make all` we're building a stage2 cargo, and
then in `make dist` we're building a stage1 cargo.

Other builders use `SCRIPT` which provides explicit control over what
`x.py` script, for example, is used to execute the build. This moves
almost all targets to using `SCRIPT` to ensure that we're explicitly
specifying what's being built where. Additionally this updates the logic
of `RUST_CHECK_TARGET` to remove the pre-flight tidy as well as the
pre-flight `make all`. The system LLVM builder (run on PRs) now
explicitly runs tidy first and then runs the rest of the test suite.

5 years agoFixed lifetime misspelling
Christian Vallentin [Thu, 30 May 2019 19:29:32 +0000 (21:29 +0200)]
Fixed lifetime misspelling

5 years agoExpand dynamic drop tests for cases in #47949
Matthew Jasper [Sat, 11 May 2019 10:16:26 +0000 (11:16 +0100)]
Expand dynamic drop tests for cases in #47949

5 years agoAdd regression test for const generics ICE
varkor [Thu, 30 May 2019 18:55:43 +0000 (19:55 +0100)]
Add regression test for const generics ICE

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
5 years agoMerge branch 'master' into iwr_progress
Jason Shirk [Thu, 30 May 2019 18:00:21 +0000 (11:00 -0700)]
Merge branch 'master' into iwr_progress

5 years agoStabilize iter_nth_back feature
Lzu Tao [Thu, 30 May 2019 18:00:17 +0000 (18:00 +0000)]
Stabilize iter_nth_back feature

5 years agoFix links in Deref documentation
Guillaume Gomez [Thu, 30 May 2019 17:06:23 +0000 (19:06 +0200)]
Fix links in Deref documentation

5 years agoAuto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkov
bors [Thu, 30 May 2019 16:54:13 +0000 (16:54 +0000)]
Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkov

Avoid `hygiene_data` lookups

These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined.

r? @petrochenkov

5 years agoci: Favor SCRIPT instead of RUST_CHECK_TARGET
Alex Crichton [Thu, 30 May 2019 14:22:53 +0000 (07:22 -0700)]
ci: Favor SCRIPT instead of RUST_CHECK_TARGET

Since #61212 we've been timing out on OSX, and this looks to be because
we're building tools like Cargo and the RLS twice instead of once. This
turns out to be a slight bug in our configuration. CI builders using the
`RUST_CHECK_TARGET` directive actually execute `make all` just before
their acual target. In `make all` we're building a stage2 cargo, and
then in `make dist` we're building a stage1 cargo.

Other builders use `SCRIPT` which provides explicit control over what
`x.py` script, for example, is used to execute the build. This moves
almost all targets to using `SCRIPT` to ensure that we're explicitly
specifying what's being built where. Additionally this updates the logic
of `RUST_CHECK_TARGET` to remove the pre-flight tidy as well as the
pre-flight `make all`. The system LLVM builder (run on PRs) now
explicitly runs tidy first and then runs the rest of the test suite.

5 years agoMigrate nomicon book to MdBook2
Mateusz Mikuła [Thu, 30 May 2019 12:30:59 +0000 (14:30 +0200)]
Migrate nomicon book to MdBook2

5 years agoMigrate rustdoc book to MdBook2
Mateusz Mikuła [Thu, 30 May 2019 12:22:33 +0000 (14:22 +0200)]
Migrate rustdoc book to MdBook2

5 years agoMigrate unstable-book to MdBook2
Mateusz Mikuła [Thu, 30 May 2019 11:59:12 +0000 (13:59 +0200)]
Migrate unstable-book to MdBook2

5 years agoAuto merge of #61343 - Centril:rollup-dzsuo01, r=Centril
bors [Thu, 30 May 2019 11:56:32 +0000 (11:56 +0000)]
Auto merge of #61343 - Centril:rollup-dzsuo01, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #60802 (upgrade rustdoc's `pulldown-cmark` to 0.5.2)
 - #60839 (Fix ICE with struct ctors and const generics.)
 - #60850 (Stabilize RefCell::try_borrow_unguarded)
 - #61231 (Fix linkage diagnostic so it doesn't ICE for external crates)
 - #61244 (Box::into_vec: use Box::into_raw instead of mem::forget)
 - #61279 (implicit `Option`-returning doctests)
 - #61280 (Revert "Disable solaris target since toolchain no longer builds")
 - #61284 (Update all s3 URLs used on CI with subdomains)
 - #61321 (libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.)
 - #61322 (ci: display more debug information in the init_repo script)
 - #61333 (Fix ICE with APIT in a function with a const parameter)

Failed merges:

 - #61304 (Speed up Azure CI installing Windows dependencies)

r? @ghost

5 years agoUpdate ui and run-pass for ellipsis_inclusive_range_patterns lint
memoryruins [Thu, 30 May 2019 10:20:30 +0000 (06:20 -0400)]
Update ui and run-pass for ellipsis_inclusive_range_patterns lint

5 years agosubmodules: update clippy from fb33fad0 to d2f51228
Matthias Krüger [Thu, 30 May 2019 09:55:29 +0000 (11:55 +0200)]
submodules: update clippy from fb33fad0 to d2f51228

Changes:
````
Rustup to https://github.com/rust-lang/rust/pull/61203
rustup https://github.com/rust-lang/rust/pull/60928
rustup https://github.com/rust-lang/rust/pull/61164 (which is included in https://github.com/rust-lang/rust/pull/61274)
````

5 years agoMake the `type_name` intrinsic's output deterministic
Oliver Scherer [Mon, 22 Apr 2019 11:53:52 +0000 (13:53 +0200)]
Make the `type_name` intrinsic's output deterministic

5 years agoRollup merge of #61333 - varkor:apit-const-param-ice, r=estebank
Mazdak Farrokhzad [Thu, 30 May 2019 08:53:07 +0000 (10:53 +0200)]
Rollup merge of #61333 - varkor:apit-const-param-ice, r=estebank

Fix ICE with APIT in a function with a const parameter

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

5 years agoRollup merge of #61322 - pietroalbini:debug-windows-submodule-cloning, r=alexcrichton
Mazdak Farrokhzad [Thu, 30 May 2019 08:53:05 +0000 (10:53 +0200)]
Rollup merge of #61322 - pietroalbini:debug-windows-submodule-cloning, r=alexcrichton

ci: display more debug information in the init_repo script

I'm *really* confused about the error message [while cloning submodules on Windows on Azure](https://dev.azure.com/rust-lang/e71b0ddf-dd27-435a-873c-e30f86eea377/_apis/build/builds/295/logs/506):

```
/usr/bin/tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try '/usr/bin/tar --help' or '/usr/bin/tar --usage' for more information.
```

It doesn't make sense for it to execute a command without any of those flags since they're clearly added:

https://github.com/rust-lang/rust/blob/81970852e172c04322cbf8ba23effabeb491c83c/src/ci/init_repo.sh#L45

So this adds `set -x` to the script to hopefully catch what command it's executing.

r? @alexcrichton
cc https://github.com/rust-lang/rust/issues/61301

5 years agoRollup merge of #61321 - Centril:is_keyword_ahead, r=petrochenkov
Mazdak Farrokhzad [Thu, 30 May 2019 08:53:03 +0000 (10:53 +0200)]
Rollup merge of #61321 - Centril:is_keyword_ahead, r=petrochenkov

libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.

Introduces:
```rust
    /// Returns whether any of the given keywords are `dist` tokens ahead of the current one.
    fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool {
        self.look_ahead(dist, |t| kws.iter().any(|&kw| t.is_keyword(kw)))
    }
```

r? @oli-obk

5 years agoRollup merge of #61284 - alexcrichton:less-s3, r=pietroalbini
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:59 +0000 (10:52 +0200)]
Rollup merge of #61284 - alexcrichton:less-s3, r=pietroalbini

Update all s3 URLs used on CI with subdomains

Ensure that they're all forwards-compatible with AWS updates happening
next year by ensuring the bucket name shows up in the domain name.

Closes #61168

5 years agoRollup merge of #61280 - bgermann:master, r=alexcrichton
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:58 +0000 (10:52 +0200)]
Rollup merge of #61280 - bgermann:master, r=alexcrichton

Revert "Disable solaris target since toolchain no longer builds"

This reverts commit e764f475ca7fffd6167ea991afc7d1b2b3f642dc.
Fixes #61174.

5 years agoRollup merge of #61279 - llogiq:implicit-option-main-doctests, r=GuillaumeGomez
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:56 +0000 (10:52 +0200)]
Rollup merge of #61279 - llogiq:implicit-option-main-doctests, r=GuillaumeGomez

implicit `Option`-returning doctests

This distinguishes `Option` and `Result`-returning doctests with implicit `main` method, where the former tests must end with `Some(())`.

Open question: Does this need a feature gate?

r? @GuillaumeGomez

5 years agoRollup merge of #61244 - RalfJung:box, r=rkruppe
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:55 +0000 (10:52 +0200)]
Rollup merge of #61244 - RalfJung:box, r=rkruppe

Box::into_vec: use Box::into_raw instead of mem::forget

`Box::into_raw` does, in one step, turn the `Box` into a raw ptr and avoid deallocation.  Seems cleaner than separating the two.

Also, `mem::forget` gets the `Box` with a `noalias` argument, but it is not actually correct that this is an exclusive pointer. So a stricter version of Stacked Borrows would complain here. (I can't actually make Stacked Borrows that strict yet though due to other issues.)

5 years agoRollup merge of #61231 - pnkfelix:issue-59548-linkage-diagnostic, r=petrochenkov
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:53 +0000 (10:52 +0200)]
Rollup merge of #61231 - pnkfelix:issue-59548-linkage-diagnostic, r=petrochenkov

Fix linkage diagnostic so it doesn't ICE for external crates

Fix linkage diagnostic so it doesn't ICE for external crates

(As a drive-by improvement, improved the diagnostic to indicate *why* `*const T` or `*mut T` is required.)

Fix #59548
Fix #61232

5 years agoRollup merge of #60850 - SimonSapin:unguarded, r=alexcrichton
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:51 +0000 (10:52 +0200)]
Rollup merge of #60850 - SimonSapin:unguarded, r=alexcrichton

Stabilize RefCell::try_borrow_unguarded

Servo has been using this since https://github.com/servo/servo/pull/23196 to add a runtime check to some unsafe code, as discussed in PR https://github.com/rust-lang/rust/pull/59211. Stabilizing would help do more of the same in libraries that also have users on Stable.

5 years agoRollup merge of #60839 - davidtwco:const-generics-struct-ctor, r=varkor
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:49 +0000 (10:52 +0200)]
Rollup merge of #60839 - davidtwco:const-generics-struct-ctor, r=varkor

Fix ICE with struct ctors and const generics.

Fixes #60818.

r? @varkor

5 years agoRollup merge of #60802 - euclio:pulldown-cmark-panic, r=GuillaumeGomez
Mazdak Farrokhzad [Thu, 30 May 2019 08:52:48 +0000 (10:52 +0200)]
Rollup merge of #60802 - euclio:pulldown-cmark-panic, r=GuillaumeGomez

upgrade rustdoc's `pulldown-cmark` to 0.5.2

Fixes #60482.

5 years agoSymbol name predicate list printed `+` excessively
Oliver Scherer [Mon, 22 Apr 2019 11:29:23 +0000 (13:29 +0200)]
Symbol name predicate list printed `+` excessively

5 years agoSet ellipsis_inclusive_range_patterns lint to warn
memoryruins [Thu, 30 May 2019 08:13:55 +0000 (04:13 -0400)]
Set ellipsis_inclusive_range_patterns lint to warn

5 years agoAuto merge of #61005 - michaelwoerister:error-pgo-windows-unwind, r=zackmdavis
bors [Thu, 30 May 2019 03:37:37 +0000 (03:37 +0000)]
Auto merge of #61005 - michaelwoerister:error-pgo-windows-unwind, r=zackmdavis

Emit error when trying to use PGO in conjunction with unwinding on Windows.

This PR makes `rustc` emit an error when trying use PGO in conjunction with `-Cpanic=unwind` on Windows, isn't supported by LLVM yet. The error messages points to https://github.com/rust-lang/rust/issues/61002, which documents this known limitation.

5 years agoAuto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbini
bors [Thu, 30 May 2019 00:38:51 +0000 (00:38 +0000)]
Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbini

ci: Attempt to skip a full rustc compile on dist*

Currently when we're preparing cross-compiled compilers it can take
quite some time because we have to build the compiler itself three
different times. The first is the normal bootstrap, the second is a
second build for the build platform, and the third is the actual target
architecture compiler. The second compiler was historically built
exclusively for procedural macros, and long ago we didn't actually need
it.

This commit tries out avoiding that second compiled compiler, meaning we
only compile rustc for the build platform only once. Some local testing
shows that this is promising, but bors is of course the ultimate test!

5 years agoAdd a regression test for const parameters with impl Trait
varkor [Wed, 29 May 2019 23:21:04 +0000 (00:21 +0100)]
Add a regression test for const parameters with impl Trait

5 years agoSort in-band generic parameter definitions from APIT
varkor [Wed, 29 May 2019 23:20:52 +0000 (00:20 +0100)]
Sort in-band generic parameter definitions from APIT

5 years agoAdd `HygieneData::{outer,expn_info,is_descendant_of}` methods.
Nicholas Nethercote [Wed, 29 May 2019 22:59:22 +0000 (08:59 +1000)]
Add `HygieneData::{outer,expn_info,is_descendant_of}` methods.

This commit factors out some repeated code.

5 years agoOptimize `TyCtxt::adjust_ident`.
Nicholas Nethercote [Mon, 27 May 2019 21:43:05 +0000 (07:43 +1000)]
Optimize `TyCtxt::adjust_ident`.

It's a hot function that returns a 2-tuple, but the hottest call site
(`hygienic_eq`) discards the second element.

This commit renames `adjust_ident` as `adjust_ident_and_get_scope`, and
then introduces a new `adjust_ident` that only computes the first
element. This change also avoids the need to pass in an unused
`DUMMY_HIR_ID` argument in a couple of places, which is nice.

5 years agoAuto merge of #61203 - memoryruins:bare_trait_objects, r=Centril
bors [Wed, 29 May 2019 21:55:59 +0000 (21:55 +0000)]
Auto merge of #61203 - memoryruins:bare_trait_objects, r=Centril

Warn on bare_trait_objects by default

The `bare_trait_objects` lint is set to `warn` by default.
Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files.

r? @Centril

cc #54910

5 years agoAuto merge of #61317 - oli-obk:rollup-tm5qivq, r=oli-obk
bors [Wed, 29 May 2019 19:10:33 +0000 (19:10 +0000)]
Auto merge of #61317 - oli-obk:rollup-tm5qivq, r=oli-obk

Rollup of 7 pull requests

Successful merges:

 - #60549 (do not print panic message on doctest failures)
 - #60885 (strip synstructure consts from compiler docs)
 - #61217 (Account for short-hand init structs when suggesting conversion)
 - #61261 (is_union returns ty to avoid computing it twice)
 - #61293 (Print const generics properly in rustdoc)
 - #61310 (split libcore::mem into multiple files)
 - #61313 (Simplify Set1::insert)

Failed merges:

r? @ghost

5 years agolibsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.
Mazdak Farrokhzad [Wed, 29 May 2019 15:58:44 +0000 (17:58 +0200)]
libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.

5 years agoci: display more debug information in the init_repo script
Pietro Albini [Wed, 29 May 2019 15:57:28 +0000 (17:57 +0200)]
ci: display more debug information in the init_repo script

5 years agoupgrade rustdoc's `pulldown-cmark` to 0.5.2
Andy Russell [Mon, 13 May 2019 21:18:21 +0000 (17:18 -0400)]
upgrade rustdoc's `pulldown-cmark` to 0.5.2

Fixes #60482.

5 years agoDon't generate div inside header (h4/h3/h...) elements
Guillaume Gomez [Tue, 28 May 2019 13:45:28 +0000 (15:45 +0200)]
Don't generate div inside header (h4/h3/h...) elements

5 years agoUpdate all s3 URLs used on CI with subdomains
Alex Crichton [Tue, 28 May 2019 20:20:43 +0000 (13:20 -0700)]
Update all s3 URLs used on CI with subdomains

Ensure that they're all forwards-compatible with AWS updates happening
next year by ensuring the bucket name shows up in the domain name.

Closes #61168

5 years agoRollup merge of #61313 - Centril:simplify-set1-insert, r=varkor
Oliver Scherer [Wed, 29 May 2019 12:41:13 +0000 (14:41 +0200)]
Rollup merge of #61313 - Centril:simplify-set1-insert, r=varkor

Simplify Set1::insert

r? @varkor

5 years agoRollup merge of #61310 - RalfJung:mem, r=Centril
Oliver Scherer [Wed, 29 May 2019 12:41:09 +0000 (14:41 +0200)]
Rollup merge of #61310 - RalfJung:mem, r=Centril

split libcore::mem into multiple files

r? @Centril

5 years agoRollup merge of #61293 - varkor:rustdoc-print-const-generic, r=GuillaumeGomez
Oliver Scherer [Wed, 29 May 2019 12:41:08 +0000 (14:41 +0200)]
Rollup merge of #61293 - varkor:rustdoc-print-const-generic, r=GuillaumeGomez

Print const generics properly in rustdoc

Now that https://github.com/rust-lang/rust/pull/59276 is merged, we can print consts properly in rustdoc.

Fixes https://github.com/rust-lang/rust/issues/60737.
Fixes https://github.com/rust-lang/rust/issues/61257.

r? @GuillaumeGomez

5 years agoRollup merge of #61261 - spastorino:is-union-return-ty, r=oli-obk
Oliver Scherer [Wed, 29 May 2019 12:41:06 +0000 (14:41 +0200)]
Rollup merge of #61261 - spastorino:is-union-return-ty, r=oli-obk

is_union returns ty to avoid computing it twice

r? @oli-obk

5 years agoRollup merge of #61217 - estebank:issue-52820, r=Centril
Oliver Scherer [Wed, 29 May 2019 12:41:05 +0000 (14:41 +0200)]
Rollup merge of #61217 - estebank:issue-52820, r=Centril

Account for short-hand init structs when suggesting conversion

Fix #52820.

5 years agoRollup merge of #60885 - euclio:strip-synstructure-consts, r=GuillaumeGomez
Oliver Scherer [Wed, 29 May 2019 12:41:03 +0000 (14:41 +0200)]
Rollup merge of #60885 - euclio:strip-synstructure-consts, r=GuillaumeGomez

strip synstructure consts from compiler docs

Fixes #60150.

Unfortunately this PR depends on the use of the deprecated `--passes` flag in bootstrap to keep the `--strip-hidden` pass while still documenting private items. I've opened #60884 to track stabilization of a new flag that encapsulates this behavior.

r? @QuietMisdreavus

5 years agoRollup merge of #60549 - euclio:doctest-panic-messages, r=GuillaumeGomez
Oliver Scherer [Wed, 29 May 2019 12:41:01 +0000 (14:41 +0200)]
Rollup merge of #60549 - euclio:doctest-panic-messages, r=GuillaumeGomez

do not print panic message on doctest failures

This PR cleans up rustdoc test output by silently unwinding on failure instead of using `panic!`. It also improves the clarity and consistency of the output on test failure, and adds test cases for failure modes that were previously untested.

5 years agoMake run-make PGO tests work on MSVC.
Michael Woerister [Wed, 29 May 2019 12:32:38 +0000 (14:32 +0200)]
Make run-make PGO tests work on MSVC.

5 years agobless you
Ralf Jung [Wed, 29 May 2019 10:28:45 +0000 (12:28 +0200)]
bless you

5 years agoSimplify Set1::insert.
Mazdak Farrokhzad [Wed, 29 May 2019 10:12:09 +0000 (12:12 +0200)]
Simplify Set1::insert.

5 years agosplit libcore::mem into multiple files
Ralf Jung [Wed, 29 May 2019 08:00:13 +0000 (10:00 +0200)]
split libcore::mem into multiple files

5 years agoAuto merge of #61305 - Centril:rollup-t39m00m, r=Centril
bors [Wed, 29 May 2019 07:50:16 +0000 (07:50 +0000)]
Auto merge of #61305 - Centril:rollup-t39m00m, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #58975 (Implement `iter::Sum` and `iter::Product` for `Option`)
 - #60542 (Add Step::sub_usize)
 - #60555 (Implement nth_back for RChunks(Exact)(Mut))
 - #60766 (Weak::into_raw)
 - #61048 (Feature/nth back chunks)
 - #61191 (librustc_errors: Move annotation collection to own impl)
 - #61235 (Stabilize bufreader_buffer feature)
 - #61249 (Rename Place::local to Place::local_or_deref_local)
 - #61291 (Avoid unneeded bug!() call)
 - #61294 (Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.)
 - #61297 (Remove LLVM instruction stats and other (obsolete) codegen stats.)

Failed merges:

r? @ghost

5 years agoFix ICE with struct ctors and const generics.
David Wood [Tue, 14 May 2019 20:34:43 +0000 (21:34 +0100)]
Fix ICE with struct ctors and const generics.

This commit fixes a ICE where struct constructors were resulting in an
ICE with const generics. Previously, a `match` in `type_of` did not have
an arm for the `DefKind::Ctor` resolutions and therefore would assume
that the type did not have generics.

5 years agoRollup merge of #61297 - eddyb:forsaken-stats, r=nagisa
Mazdak Farrokhzad [Wed, 29 May 2019 06:16:06 +0000 (08:16 +0200)]
Rollup merge of #61297 - eddyb:forsaken-stats, r=nagisa

Remove LLVM instruction stats and other (obsolete) codegen stats.

Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen.

Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway.

r? @nagisa cc @rust-lang/compiler

5 years agoRollup merge of #61294 - eddyb:no-trait-nor-impl, r=varkor
Mazdak Farrokhzad [Wed, 29 May 2019 06:16:04 +0000 (08:16 +0200)]
Rollup merge of #61294 - eddyb:no-trait-nor-impl, r=varkor

Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.

5 years agoRollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebank
Mazdak Farrokhzad [Wed, 29 May 2019 06:16:02 +0000 (08:16 +0200)]
Rollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebank

Avoid unneeded bug!() call

r? @oli-obk

5 years agoRollup merge of #61249 - spastorino:local-or-deref-local, r=oli-obk,Centril
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:59 +0000 (08:15 +0200)]
Rollup merge of #61249 - spastorino:local-or-deref-local, r=oli-obk,Centril

Rename Place::local to Place::local_or_deref_local

r? @oli-obk

5 years agoRollup merge of #61235 - lzutao:stabilize-bufreader_buffer, r=Centril
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:58 +0000 (08:15 +0200)]
Rollup merge of #61235 - lzutao:stabilize-bufreader_buffer, r=Centril

Stabilize bufreader_buffer feature

FCP done in https://github.com/rust-lang/rust/issues/45323#issuecomment-495937047

Closes #45323

r? @SimonSapin

5 years agoRollup merge of #61191 - phansch:annotate_snippet_refactorings1, r=estebank
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:56 +0000 (08:15 +0200)]
Rollup merge of #61191 - phansch:annotate_snippet_refactorings1, r=estebank

librustc_errors: Move annotation collection to own impl

Extracted from work on #59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow easier re-use in a separate
EmitterWriter. Even without that new EmitterWriter present, I think it makes
sense to have this as an associated function.

5 years agoRollup merge of #61048 - wizAmit:feature/nth_back_chunks, r=scottmcm
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:55 +0000 (08:15 +0200)]
Rollup merge of #61048 - wizAmit:feature/nth_back_chunks, r=scottmcm

Feature/nth back chunks

A succinct implementation for nth_back on chunks. Thank you @timvermeulen for the guidance.

r? @timvermeulen

5 years agoRollup merge of #60766 - vorner:weak-into-raw, r=sfackler
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:53 +0000 (08:15 +0200)]
Rollup merge of #60766 - vorner:weak-into-raw, r=sfackler

Weak::into_raw

Hello

This is my first shot at #60728. I'd like to consult it a bit before moving further.

The biggest question I have is if this API makes sense. My motivation for it is to be able to store the `Weak` in `AtomicPtr`. For that I don't actually need for the pointer to point to the `T`, any pointer (maybe casted to `usize`) would be good enough, but this mirrors what `Arc` does and could be useful for other things too (like comparing if Arc and Weak point to the same thing without playing with the counts), while some opaque pointer wouldn't.

Some secondary questions, if this is deemed desirable are:
* The weak pointer may be dangling if it is created by `Weak::new()`. It would make sense to treat this as NULL, but that is incompatible with `T: ?Sized` ‒ both `new()` and `ptr::null()` are available only for sized types. The current implementation is therefore also available only for sized `T`s. It would be possible to allow `?Sized` if the API would be `fn into_raw(self) -> Option<NonNull<T>>` and `fn from_raw(NonNull<T>)`, but that's different API than `Arc` has. What would be preferred?
* There's a FIXME in my code about what I suspect could be UB. Is it really UB & how to get the pointer correctly? Is manual offsetting of the pointer the only way?
* Am I missing some other necessary thing around the feature gates and such?
* Is the documentation understandable? I know writing docs is not my strongest skill :-|.

Thinks I'd like to do as part of the PR, but are not yet done:
* Turn the referenced issue into tracking issue for the feature flag.
* Once the `sync::Weak` is considered reasonable, I'd do the equivalent for `rc::Weak`.
* This might call for few more tests than what is currently part of the documentation.

5 years agoRollup merge of #60555 - timvermeulen:rchunks_nth_back, r=scottmcm
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:51 +0000 (08:15 +0200)]
Rollup merge of #60555 - timvermeulen:rchunks_nth_back, r=scottmcm

Implement nth_back for RChunks(Exact)(Mut)

Part of #54054.

These implementations may not be optimal because of the use of `self.len()`, but it's quite cheap and simplifies the code a lot.

There's quite some duplication going on here, I wouldn't mind cleaning this up later. A good next step would probably be to add private `split_off_up_to`/`split_off_from` helper methods for slices since their behavior is commonly useful throughout the `Chunks` types.

r? @scottmcm

5 years agoRollup merge of #60542 - timvermeulen:step_sub_usize, r=scottmcm
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:49 +0000 (08:15 +0200)]
Rollup merge of #60542 - timvermeulen:step_sub_usize, r=scottmcm

Add Step::sub_usize

Required for #54054.

I'm aware that the `Step` trait needs a rework, but this still seems like a reasonable addition?

This currently doesn't compile because Chalk contains a type that implement this trait, and this is a breaking change. How can that be fixed?

5 years agoRollup merge of #58975 - jtdowney:iter_arith_traits_option, r=dtolnay
Mazdak Farrokhzad [Wed, 29 May 2019 06:15:48 +0000 (08:15 +0200)]
Rollup merge of #58975 - jtdowney:iter_arith_traits_option, r=dtolnay

Implement `iter::Sum` and `iter::Product` for `Option`

This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned.

I based a lot of this on #38580. From that discussion it didn't seem like this addition would be too controversial or difficult. One thing I still don't understand is picking the values for the `stable` attribute. This is my first non-documentation PR for rust so I am open to any feedback on improvements.

5 years agoSpeed up Azure CI installing Windows dependencies
Jason Shirk [Wed, 29 May 2019 05:57:12 +0000 (22:57 -0700)]
Speed up Azure CI installing Windows dependencies

There is known issue where PowerShell is unreasonably slow downloading
files due to an issue with rendering the progress bar, see:

https://github.com/PowerShell/PowerShell/issues/2138

That issue is fixed in PowerShell Core (available in Azure Pipelines as
pwsh.exe) but it can also be worked around by setting:

    $ProgressPreference = 'SilentlyContinue'