]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoIntroduce Diverges::always constructor
Aaron Hill [Thu, 19 Sep 2019 00:04:01 +0000 (20:04 -0400)]
Introduce Diverges::always constructor

Rename the existing Diverges.always method to Diverges.is_always

4 years agoApply formatting fixes
Aaron Hill [Wed, 18 Sep 2019 23:48:37 +0000 (19:48 -0400)]
Apply formatting fixes

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoSome formatting cleanup
Aaron Hill [Wed, 18 Sep 2019 23:31:38 +0000 (19:31 -0400)]
Some formatting cleanup

4 years agoMake note better when all arms in a `match` diverge
Aaron Hill [Wed, 18 Sep 2019 23:07:39 +0000 (19:07 -0400)]
Make note better when all arms in a `match` diverge

4 years agoPoint at original span when emitting unreachable lint
Aaron Hill [Wed, 18 Sep 2019 22:22:13 +0000 (18:22 -0400)]
Point at original span when emitting unreachable lint

Fixes #64590

When we emit an 'unreachable' lint, we now add a note pointing at the
expression that actually causes the code to be unreachable (e.g.
`return`, `break`, `panic`).

This is especially useful when macros are involved, since a diverging
expression might be hidden inside of a macro invocation.

4 years agoAuto merge of #64583 - tmandry:rollup-b793x81, r=tmandry
bors [Wed, 18 Sep 2019 17:58:45 +0000 (17:58 +0000)]
Auto merge of #64583 - tmandry:rollup-b793x81, r=tmandry

Rollup of 5 pull requests

Successful merges:

 - #64207 (Make rustc_mir::dataflow module pub (for clippy))
 - #64348 (PR: documentation spin loop hint)
 - #64532 (Replace `state_for_location` with `DataflowResultsCursor`)
 - #64578 (Fix issue22656 with LLDB 8)
 - #64580 (Update books)

Failed merges:

r? @ghost

4 years agoRollup merge of #64580 - ehuss:update-books, r=ehuss
Tyler Mandry [Wed, 18 Sep 2019 17:58:09 +0000 (10:58 -0700)]
Rollup merge of #64580 - ehuss:update-books, r=ehuss

Update books

## book

24 commits in 7ddc46460f09a5cd9bd2a620565bdc20b3315ea9..871416b85c1a73717d65d6f4a9ea29e5aef3db0e
2019-06-27 09:50:36 -0400 to 2019-09-16 09:46:20 -0400
- Ch16-2 add missing Ferris (rust-lang/book#2033)
- Update version mentioned on the front page
- Update error messages (rust-lang/book#1737)
- Update version of Rust used to 1.37
- Replace Cargo docs link with a more specific link (rust-lang/book#2066)
- Added missing await reserved keyword (rust-lang/book#2064)
- add does_not_compile for a snippet (rust-lang/book#2056)
- Added second missing dyn (rust-lang/book#2046)
- Removed unnecessary & in function call (rust-lang/book#2038)
- Printing non-Display structs is a *compile* error (rust-lang/book#2031)
- Update Readme mdBook version to match linked file (rust-lang/book#2012)
- Update loose mdbook version reference (rust-lang/book#2003)
- Added a bullet point to have list of things unsafe allows for match u… (rust-lang/book#1993)
- Rewrote a confusing sentence (rust-lang/book#1986)
- Replace deprecated `...` range syntax with `..=` (rust-lang/book#1977)
- correct wording for integration test doc (rust-lang/book#1971)
- Mark the dangle function as does_not_compile (rust-lang/book#1965)
- Add more words to the quote from the actual Go documentation (rust-lang/book#1960)
- Remove unused import in lfp (rust-lang/book#1944)
- A small typo? (rust-lang/book#1931)
- Make the code not compile to match the text (rust-lang/book#1926)
- Ferris does-not-compile added (ch9.2) (rust-lang/book#1925)
- ch07 - remove note regarding use and relative path (rust-lang/book#1820)
- tweak opening paragraph of deref coercions (rust-lang/book#1749)

## rust-by-example

9 commits in e76be6b2dc84c6a992e186157efe29d625e29b94..67cfbf31df880728dcf7cb35b15b028ec92caf31
2019-09-03 07:42:26 -0300 to 2019-09-18 09:36:40 -0300
- Fix rust-lang/rust-by-example#90: Add supertraits and Fully Qualified syntax (rust-lang/rust-by-example#1259)
- Fix some broken links. (rust-lang/rust-by-example#1258)
- Fix rust-lang/rust-by-example#1253: Document enum type aliases (rust-lang/rust-by-example#1255)
- Inline code in some new/changed chapters (rust-lang/rust-by-example#1254)
- fix rust-lang/rust-by-example#1067: explain that unit tests can return Result&lt;()&gt; (rust-lang/rust-by-example#1252)
- Fix rust-lang/rust-by-example#1060: add page on Impl Trait (rust-lang/rust-by-example#1251)
- Fix rust-lang/rust-by-example#1053: Added a page about the dyn keyword (rust-lang/rust-by-example#1249)
- Fix rust-lang/rust-by-example#1110: add examples of ? and Option (rust-lang/rust-by-example#1250)
- fix 1037: add the TryFrom chapter back in (rust-lang/rust-by-example#1247)

4 years agoRollup merge of #64578 - max-sixty:22656-lldb-8, r=alexcrichton
Tyler Mandry [Wed, 18 Sep 2019 17:58:07 +0000 (10:58 -0700)]
Rollup merge of #64578 - max-sixty:22656-lldb-8, r=alexcrichton

Fix issue22656 with LLDB 8

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

4 years agoRollup merge of #64532 - ecstatic-morse:dataflow-cursor-get, r=tmandry
Tyler Mandry [Wed, 18 Sep 2019 17:58:06 +0000 (10:58 -0700)]
Rollup merge of #64532 - ecstatic-morse:dataflow-cursor-get, r=tmandry

Replace `state_for_location` with `DataflowResultsCursor`

These are two different ways of getting the same data from the result of a dataflow analysis. However, `state_for_location` goes quadratic if you try to call it for every statement in the body.

4 years agoRollup merge of #64348 - arnohaase:pr_documentation_spin_loop_hint, r=alexcrichton
Tyler Mandry [Wed, 18 Sep 2019 17:58:05 +0000 (10:58 -0700)]
Rollup merge of #64348 - arnohaase:pr_documentation_spin_loop_hint, r=alexcrichton

PR: documentation spin loop hint

The documentation for 'spin loop hint' explains that yield is better if the lock holder is running on the same CPU. I suggest that 'CPU or core' would be clearer.

4 years agoRollup merge of #64207 - sinkuu:pub_dataflow, r=tmandry
Tyler Mandry [Wed, 18 Sep 2019 17:58:03 +0000 (10:58 -0700)]
Rollup merge of #64207 - sinkuu:pub_dataflow, r=tmandry

Make rustc_mir::dataflow module pub (for clippy)

I'm working on fixing false-positives of a MIR-based clippy lint (https://github.com/rust-lang/rust-clippy/pull/4509), and in need of the dataflow infrastructure.

4 years agoUpdate books
Eric Huss [Wed, 18 Sep 2019 15:54:06 +0000 (08:54 -0700)]
Update books

4 years agofix debuginfo/issue22656 with LLDB 8
Maximilian Roos [Wed, 18 Sep 2019 14:42:55 +0000 (10:42 -0400)]
fix debuginfo/issue22656 with LLDB 8

4 years agoAuto merge of #64575 - lzutao:fmt-primitives-doc, r=jonas-schievink
bors [Wed, 18 Sep 2019 12:31:00 +0000 (12:31 +0000)]
Auto merge of #64575 - lzutao:fmt-primitives-doc, r=jonas-schievink

doc: Format some primitives examples

r? @jonas-schievink

4 years agobroken hyperlinks in documentation
Arno Haase [Wed, 18 Sep 2019 10:31:34 +0000 (12:31 +0200)]
broken hyperlinks in documentation

4 years agodoc: Format some primitives examples
Lzu Tao [Wed, 18 Sep 2019 08:24:24 +0000 (08:24 +0000)]
doc: Format some primitives examples

4 years agoAuto merge of #64570 - tmandry:rollup-3pg02lj, r=tmandry
bors [Wed, 18 Sep 2019 04:29:01 +0000 (04:29 +0000)]
Auto merge of #64570 - tmandry:rollup-3pg02lj, r=tmandry

Rollup of 4 pull requests

Successful merges:

 - #64486 (Print out more information for `-Zunpretty=expanded,hygiene`)
 - #64503 (rename Allocation::retag -> with_tags_and_extra)
 - #64516 (update Nomicon and Reference)
 - #64528 (Load proc macro metadata in the correct order.)

Failed merges:

r? @ghost

4 years agoRollup merge of #64528 - Aaron1011:fix/proc-macro-type, r=alexcrichton
Tyler Mandry [Wed, 18 Sep 2019 04:27:26 +0000 (21:27 -0700)]
Rollup merge of #64528 - Aaron1011:fix/proc-macro-type, r=alexcrichton

Load proc macro metadata in the correct order.

Serialized proc macro metadata is assumed to have a one-to-one
correspondence with the entries in static array generated by proc_macro_harness.
However, we were previously serializing proc macro metadata in a
different order than proc macros were laied out in the static array.
This lead to us associating the wrong data with a proc macro when
generating documentation, causing Rustdoc to generate incorrect docs for
proc macros.

This commit keeps track of the order in which we insert proc macros into
the generated static array. We use this same order when serializing proc
macro metadata, ensuring that we can later associate the metadata for a
proc macro with its entry in the static array.

Fixes #64251

4 years agoRollup merge of #64516 - RalfJung:nomicon, r=Centril
Tyler Mandry [Wed, 18 Sep 2019 04:27:25 +0000 (21:27 -0700)]
Rollup merge of #64516 - RalfJung:nomicon, r=Centril

update Nomicon and Reference

Cc @Centril

4 years agoRollup merge of #64503 - RalfJung:miri-retag, r=oli-obk
Tyler Mandry [Wed, 18 Sep 2019 04:27:23 +0000 (21:27 -0700)]
Rollup merge of #64503 - RalfJung:miri-retag, r=oli-obk

rename Allocation::retag -> with_tags_and_extra

This is more consistent with `Pointer::with_tag`. Also, "retag" is a [term from Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md#retagging) with a [corresponding Machine hook](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/interpret/machine/trait.Machine.html#method.retag), and this function has nothing to do with that other use of the term.

r? @oli-obk

4 years agoRollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkov
Tyler Mandry [Wed, 18 Sep 2019 04:27:22 +0000 (21:27 -0700)]
Rollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkov

Print out more information for `-Zunpretty=expanded,hygiene`

I've found this helpful when trying to understand how hygiene works.

Closes #16420

4 years agoGenerate proc macro harness in AST order.
Aaron Hill [Tue, 17 Sep 2019 23:07:35 +0000 (19:07 -0400)]
Generate proc macro harness in AST order.

This ensures that we match the order used by proc macro metadata
serialization.

Fixes #64251

4 years agoAuto merge of #64562 - tmandry:rollup-kfk0nuo, r=tmandry
bors [Tue, 17 Sep 2019 22:21:10 +0000 (22:21 +0000)]
Auto merge of #64562 - tmandry:rollup-kfk0nuo, r=tmandry

Rollup of 10 pull requests

Successful merges:

 - #61626 (Get rid of special const intrinsic query in favour of `const_eval`)
 - #64283 (Updated RELEASES.md for 1.38.0)
 - #64394 (Shrink `SubregionOrigin`.)
 - #64429 (Fix failure note `to_str` implementation)
 - #64436 (improve Vec example soundness in mem::transmute docs)
 - #64502 (avoid duplicate issues for Miri build failures)
 - #64505 (Fix inconsistent link formatting)
 - #64529 (Add an example to Pin::as_mut)
 - #64541 (document Miri error categories)
 - #64544 (build-manifest: re-add some comments)

Failed merges:

r? @ghost

4 years agoRollup merge of #64544 - RalfJung:build-manifest, r=pietroalbini
Tyler Mandry [Tue, 17 Sep 2019 21:10:56 +0000 (14:10 -0700)]
Rollup merge of #64544 - RalfJung:build-manifest, r=pietroalbini

build-manifest: re-add some comments

https://github.com/rust-lang/rust/pull/64543 also reverted the comments I added. This adds them back.
Includes https://github.com/rust-lang/rust/pull/64543.

r? @pietroalbini

4 years agoRollup merge of #64541 - RalfJung:miri-errors, r=oli-obk
Tyler Mandry [Tue, 17 Sep 2019 21:10:55 +0000 (14:10 -0700)]
Rollup merge of #64541 - RalfJung:miri-errors, r=oli-obk

document Miri error categories

r? @oli-obk

4 years agoRollup merge of #64529 - taiki-e:docs-pin-as-mut, r=RalfJung
Tyler Mandry [Tue, 17 Sep 2019 21:10:54 +0000 (14:10 -0700)]
Rollup merge of #64529 - taiki-e:docs-pin-as-mut, r=RalfJung

Add an example to Pin::as_mut

https://github.com/taiki-e/pin-project/issues/89#issuecomment-531701172

r? @RalfJung

4 years agoRollup merge of #64505 - pickfire:patch-1, r=Mark-Simulacrum
Tyler Mandry [Tue, 17 Sep 2019 21:10:52 +0000 (14:10 -0700)]
Rollup merge of #64505 - pickfire:patch-1, r=Mark-Simulacrum

Fix inconsistent link formatting

4 years agoRollup merge of #64502 - RalfJung:miri-toolstate, r=pietroalbini
Tyler Mandry [Tue, 17 Sep 2019 21:10:51 +0000 (14:10 -0700)]
Rollup merge of #64502 - RalfJung:miri-toolstate, r=pietroalbini

avoid duplicate issues for Miri build failures

Currently, when Miri regressed from test-pass to test-fail, we pen an issue -- and then when it regresses further from test-fail to build-fail, we open a *second* issue.

This changes the logic to avoid the redundant second issue for Miri.

r? @pietroalbini @kennytm

4 years agoRollup merge of #64436 - llogiq:transmute-docs, r=RalfJung
Tyler Mandry [Tue, 17 Sep 2019 21:10:50 +0000 (14:10 -0700)]
Rollup merge of #64436 - llogiq:transmute-docs, r=RalfJung

improve Vec example soundness in mem::transmute docs

The previous version of the `Vec` example had a case of questionable soundness, because at one point `v_orig` was aliased.

r? @RalfJung

4 years agoRollup merge of #64429 - afnanenayet:afnan/fix-failure-note-json-level, r=Mark-Simulacrum
Tyler Mandry [Tue, 17 Sep 2019 21:10:48 +0000 (14:10 -0700)]
Rollup merge of #64429 - afnanenayet:afnan/fix-failure-note-json-level, r=Mark-Simulacrum

Fix failure note `to_str` implementation

Serialize the level to something a little more useful for a failure note struct. This fixes #60425.

4 years agoRollup merge of #64394 - nnethercote:shrink-SubregionOrigin, r=Mark-Simulacrum
Tyler Mandry [Tue, 17 Sep 2019 21:10:47 +0000 (14:10 -0700)]
Rollup merge of #64394 - nnethercote:shrink-SubregionOrigin, r=Mark-Simulacrum

Shrink `SubregionOrigin`.

It's currently 120 bytes on x86-64, due to one oversized variant
(`Subtype`). This commit boxes `Subtype`'s contents, reducing the size
of `SubregionOrigin` to 32 bytes.

The change speeds things up by avoiding lots of `memcpy` calls, mostly
relating to `RegionConstraintData::constraints`, which is a `BTreeMap`
with `SubregionOrigin` values.

4 years agoRollup merge of #64283 - XAMPPRocky:master, r=Mark-Simulacrum
Tyler Mandry [Tue, 17 Sep 2019 21:10:45 +0000 (14:10 -0700)]
Rollup merge of #64283 - XAMPPRocky:master, r=Mark-Simulacrum

Updated RELEASES.md for 1.38.0

### [Rendered](https://github.com/XAMPPRocky/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release

4 years agoRollup merge of #61626 - oli-obk:const_eval_intrinsics, r=eddyb
Tyler Mandry [Tue, 17 Sep 2019 21:10:44 +0000 (14:10 -0700)]
Rollup merge of #61626 - oli-obk:const_eval_intrinsics, r=eddyb

Get rid of special const intrinsic query in favour of `const_eval`

r? @eddyb

4 years agoupdate Nomicon and Reference
Ralf Jung [Tue, 17 Sep 2019 20:28:49 +0000 (22:28 +0200)]
update Nomicon and Reference

4 years agoPrint syntax contexts and marks when printing hygiene information
Matthew Jasper [Sun, 14 Jul 2019 20:17:37 +0000 (21:17 +0100)]
Print syntax contexts and marks when printing hygiene information

4 years agoAuto merge of #64525 - nikomatsakis:issue-64512-drop-order-tail-temp, r=davidtwco
bors [Tue, 17 Sep 2019 18:23:30 +0000 (18:23 +0000)]
Auto merge of #64525 - nikomatsakis:issue-64512-drop-order-tail-temp, r=davidtwco

adjust desugaring for async fn to correct drop order

Old desugaring, given a user function body `{ $stmts; $expr }`

```
{
    let $param_pattern0 = $raw_param0;
    ...
    let $param_patternN = $raw_paramN;
    $stmts;
    $expr
}
```

New desugaring:

```
{
    let $param_pattern0 = $raw_param0;
    ...
    let $param_patternN = $raw_paramN;
    drop-temps {
        $stmts;
        $expr
    }
}
```

The drop-temps is an internal bit of HIR that drops temporaries from the resulting expression, but it should be equivalent to `return { $stmts; $expr }`.

Fixes #64512
Fixes #64391

4 years agoimprove Vec example soundness in mem::transmute docs
Andre Bogus [Fri, 13 Sep 2019 16:42:09 +0000 (18:42 +0200)]
improve Vec example soundness in mem::transmute docs

4 years agobuild-manifest: add some comments
Ralf Jung [Tue, 17 Sep 2019 08:39:26 +0000 (10:39 +0200)]
build-manifest: add some comments

4 years agoAuto merge of #64517 - alexcrichton:less-assertions, r=pietroalbini
bors [Tue, 17 Sep 2019 14:43:44 +0000 (14:43 +0000)]
Auto merge of #64517 - alexcrichton:less-assertions, r=pietroalbini

azure: Disable more LLVM/debug assertions in

This commit disables LLVM/debug assertions in our 5 slowest builders:

* i686-gnu
* i686-gnu-nopt
* i686-msvc-1
* i686-msvc-2
* x86_64-msvc-cargo

This is reducing the amount of test coverage for LLVM/debug assertions,
but we're just unfortunately running out of time on CI too many times.
Some test builds have shown that i686-gnu drops nearly an hour of CI
time by disabling these two assertions. Perhaps when we eventually get
4-core machines we can reenable these, but for now turn them off and
hook them up to the tracking issue at #59637 which will ideally be
repurposes to tracking all of these.

4 years agoGet rid of special const intrinsic query in favour of `const_eval`
Oliver Scherer [Fri, 7 Jun 2019 17:22:42 +0000 (19:22 +0200)]
Get rid of special const intrinsic query in favour of `const_eval`

4 years agoUpdate src/libcore/pin.rs
Taiki Endo [Tue, 17 Sep 2019 11:02:48 +0000 (20:02 +0900)]
Update src/libcore/pin.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoAdd an example to Pin::as_mut
Taiki Endo [Tue, 17 Sep 2019 10:41:12 +0000 (19:41 +0900)]
Add an example to Pin::as_mut

4 years agoAuto merge of #64543 - pietroalbini:revert-miri-manifest, r=pietroalbini
bors [Tue, 17 Sep 2019 10:37:01 +0000 (10:37 +0000)]
Auto merge of #64543 - pietroalbini:revert-miri-manifest, r=pietroalbini

Revert #64451

#64451 is making the release process panic, causing today's missing nightly (see https://github.com/rust-lang/rust/issues/64540). This reverts that PR, but I'm happy to review a fixed version of it.

cc @RalfJung
r? @ghost

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

4 years agoupdate miri
Ralf Jung [Tue, 17 Sep 2019 10:31:49 +0000 (12:31 +0200)]
update miri

4 years agonewly phrased documentation for spin loop hints
Arno Haase [Tue, 17 Sep 2019 10:09:07 +0000 (12:09 +0200)]
newly phrased documentation for spin loop hints

4 years agoadjust larger comment to include the body
Niko Matsakis [Tue, 17 Sep 2019 08:47:54 +0000 (04:47 -0400)]
adjust larger comment to include the body

4 years agouse drop-temps { .. } pseudo-notation
Niko Matsakis [Tue, 17 Sep 2019 08:44:35 +0000 (04:44 -0400)]
use drop-temps { .. } pseudo-notation

DropTemps(...) looks like a function, this looks like wacko special stuff

4 years agointroduce `lower_block_expr` convenience function, and use it
Niko Matsakis [Tue, 17 Sep 2019 08:39:21 +0000 (04:39 -0400)]
introduce `lower_block_expr` convenience function, and use it

4 years agoapply nits from centril
Niko Matsakis [Tue, 17 Sep 2019 08:50:40 +0000 (04:50 -0400)]
apply nits from centril

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoRevert "Rollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini"
Pietro Albini [Tue, 17 Sep 2019 07:58:55 +0000 (09:58 +0200)]
Revert "Rollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini"

This reverts commit 7975973e2b806a7ee8e54b40f9e774528a777e31, reversing
changes made to f0320e54c7c2c923e2e05996ac1d74f781115bbc.

4 years agorename Allocation::retag -> with_tags_and_extra
Ralf Jung [Mon, 16 Sep 2019 09:34:27 +0000 (11:34 +0200)]
rename Allocation::retag -> with_tags_and_extra

4 years agodocument Miri error categories
Ralf Jung [Tue, 17 Sep 2019 06:58:51 +0000 (08:58 +0200)]
document Miri error categories

4 years agoFix failure note `to_str` implementation
Afnan Enayet [Fri, 13 Sep 2019 13:48:47 +0000 (06:48 -0700)]
Fix failure note `to_str` implementation

* Serialize the level to something a little more useful for a failure note
  struct
* Update tests accordingly

4 years agoAuto merge of #64535 - Centril:rollup-wiyxagi, r=Centril
bors [Tue, 17 Sep 2019 01:09:07 +0000 (01:09 +0000)]
Auto merge of #64535 - Centril:rollup-wiyxagi, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #64085 (Tweak unsatisfied HRTB errors)
 - #64380 (Update bundled OpenSSL to 1.1.1d)
 - #64416 (Various refactorings to clean up nll diagnostics)
 - #64500 (Various `ObligationForest` improvements)
 - #64530 (Elide lifetimes in `Pin<&(mut) Self>`)
 - #64531 (Use shorthand syntax in the self parameter of methods of Pin)

Failed merges:

r? @ghost

4 years agoRollup merge of #64531 - taiki-e:pin-self, r=Centril
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:41 +0000 (03:08 +0200)]
Rollup merge of #64531 - taiki-e:pin-self, r=Centril

Use shorthand syntax in the self parameter of methods of Pin

4 years agoRollup merge of #64530 - taiki-e:docs-pin-lifetimes, r=Centril
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:39 +0000 (03:08 +0200)]
Rollup merge of #64530 - taiki-e:docs-pin-lifetimes, r=Centril

Elide lifetimes in `Pin<&(mut) Self>`

4 years agoRollup merge of #64500 - nnethercote:ObligForest-fixups, r=nikomatsakis
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:38 +0000 (03:08 +0200)]
Rollup merge of #64500 - nnethercote:ObligForest-fixups, r=nikomatsakis

Various `ObligationForest` improvements

These commits make the code both nicer and faster.

r? @nikomatsakis

4 years agoRollup merge of #64416 - mark-i-m:region-naming-ctx, r=estebank
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:36 +0000 (03:08 +0200)]
Rollup merge of #64416 - mark-i-m:region-naming-ctx, r=estebank

Various refactorings to clean up nll diagnostics

- Create ErrorReportingCtx and ErrorConstraintInfo, vasting reducing the
  number of arguments passed around everywhere in the error reporting code
- Create RegionErrorNamingCtx, making a given lifetime have consistent
  numbering thoughout all error messages for that MIR def.
- Make the error reporting code return the DiagnosticBuilder rather than
  directly buffer the Diagnostic. This makes it easier to modify the
  diagnostic later, e.g. to add suggestions.

r? @estebank

Split out from https://github.com/rust-lang/rust/pull/58281

4 years agoRollup merge of #64380 - alexcrichton:update-openssl, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:35 +0000 (03:08 +0200)]
Rollup merge of #64380 - alexcrichton:update-openssl, r=Mark-Simulacrum

Update bundled OpenSSL to 1.1.1d

Brings in a few minor security fixes to the distributed Cargo/etc.

4 years agoRollup merge of #64085 - estebank:hrtb-errors, r=oli-obk
Mazdak Farrokhzad [Tue, 17 Sep 2019 01:08:34 +0000 (03:08 +0200)]
Rollup merge of #64085 - estebank:hrtb-errors, r=oli-obk

Tweak unsatisfied HRTB errors

r? @oli-obk

Close #35180.

4 years agoRemove `dataflow::state_for_location`
Dylan MacKenzie [Tue, 17 Sep 2019 00:53:02 +0000 (17:53 -0700)]
Remove `dataflow::state_for_location`

4 years agoReplace all uses of `dataflow::state_for_location`
Dylan MacKenzie [Tue, 17 Sep 2019 00:52:15 +0000 (17:52 -0700)]
Replace all uses of `dataflow::state_for_location`

Use the new dataflow cursor.

4 years agoAdd a getter for the current state to `DataflowResultsCursor`
Dylan MacKenzie [Fri, 30 Aug 2019 03:47:45 +0000 (20:47 -0700)]
Add a getter for the current state to `DataflowResultsCursor`

4 years agoUse shorthand syntax in the self parameter of methods of Pin
Taiki Endo [Mon, 16 Sep 2019 23:54:30 +0000 (08:54 +0900)]
Use shorthand syntax in the self parameter of methods of Pin

4 years agoElide lifetimes in `Pin<&(mut) Self>`
Taiki Endo [Mon, 16 Sep 2019 23:39:34 +0000 (08:39 +0900)]
Elide lifetimes in `Pin<&(mut) Self>`

4 years agoTweak unsatisfied HRTB errors
Esteban Küber [Mon, 2 Sep 2019 04:51:16 +0000 (21:51 -0700)]
Tweak unsatisfied HRTB errors

4 years agoAuto merge of #64526 - Centril:rollup-k4cz2xn, r=Centril
bors [Mon, 16 Sep 2019 21:22:54 +0000 (21:22 +0000)]
Auto merge of #64526 - Centril:rollup-k4cz2xn, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #64357 (`AdtDef` is an algebraic data type, not abstract data type)
 - #64485 (update Miri)
 - #64509 (Make some adjustments to the documentation for `std::convert::identity`)
 - #64518 (Use while let slice_pattern instead of carrying an index around)

Failed merges:

r? @ghost

4 years agoRollup merge of #64518 - spastorino:while-let-to-iterate-over-proj-slice, r=oli-obk
Mazdak Farrokhzad [Mon, 16 Sep 2019 21:21:52 +0000 (23:21 +0200)]
Rollup merge of #64518 - spastorino:while-let-to-iterate-over-proj-slice, r=oli-obk

Use while let slice_pattern instead of carrying an index around

r? @oli-obk

4 years agoRollup merge of #64509 - varkor:convert-identity-doc-fixes, r=Centril
Mazdak Farrokhzad [Mon, 16 Sep 2019 21:21:50 +0000 (23:21 +0200)]
Rollup merge of #64509 - varkor:convert-identity-doc-fixes, r=Centril

Make some adjustments to the documentation for `std::convert::identity`

Fixes some extra blank lines and makes some minor tweaks to the wording.

4 years agoRollup merge of #64485 - RalfJung:miri, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 21:21:49 +0000 (23:21 +0200)]
Rollup merge of #64485 - RalfJung:miri, r=alexcrichton

update Miri

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

r? @alexcrichton for the Cargo.toml changes: with byteorder 1.3, the `i128` feature is a NOP, so we can remove it everywhere and then get rid of this crate in the workspace-hack.

4 years agoRollup merge of #64357 - rust-lang:adt-docs-fix, r=varkor
Mazdak Farrokhzad [Mon, 16 Sep 2019 21:21:48 +0000 (23:21 +0200)]
Rollup merge of #64357 - rust-lang:adt-docs-fix, r=varkor

`AdtDef` is an algebraic data type, not abstract data type

r? @varkor

4 years agoadjust desugaring for async fn to correct drop order
Niko Matsakis [Mon, 16 Sep 2019 20:15:20 +0000 (16:15 -0400)]
adjust desugaring for async fn to correct drop order

Old desugaring, given a user function body { $stmts; $expr }

```
{
    let $param_pattern0 = $raw_param0;
    ...
    let $param_patternN = $raw_paramN;
    $stmts;
    $expr
}
```

New desugaring:

```
{
    let $param_pattern0 = $raw_param0;
    ...
    let $param_patternN = $raw_paramN;
    drop-temps {
        $stmts;
        $expr
    }
}
```

The drop-temps is an internal bit of HIR that drops temporaries from
the resulting expression, but it should be equivalent to `return {
$stmts; $expr }`.

4 years agoadd regression test for issue-64391
Niko Matsakis [Mon, 16 Sep 2019 19:25:39 +0000 (15:25 -0400)]
add regression test for issue-64391

4 years agoavoid duplicate issues for Miri build failures
Ralf Jung [Mon, 16 Sep 2019 09:29:10 +0000 (11:29 +0200)]
avoid duplicate issues for Miri build failures

4 years agoadd test for drop order of temporary in tail return expression
Niko Matsakis [Mon, 16 Sep 2019 17:06:07 +0000 (13:06 -0400)]
add test for drop order of temporary in tail return expression

4 years agoUse while let slice_pattern instead of carrying an index around
Santiago Pastorino [Mon, 16 Sep 2019 18:53:08 +0000 (15:53 -0300)]
Use while let slice_pattern instead of carrying an index around

4 years agoazure: Disable more LLVM/debug assertions in
Alex Crichton [Mon, 16 Sep 2019 18:43:23 +0000 (11:43 -0700)]
azure: Disable more LLVM/debug assertions in

This commit disables LLVM/debug assertions in our 5 slowest builders:

* i686-gnu
* i686-gnu-nopt
* i686-msvc-1
* i686-msvc-2
* x86_64-msvc-cargo

This is reducing the amount of test coverage for LLVM/debug assertions,
but we're just unfortunately running out of time on CI too many times.
Some test builds have shown that i686-gnu drops nearly an hour of CI
time by disabling these two assertions. Perhaps when we eventually get
4-core machines we can reenable these, but for now turn them off and
hook them up to the tracking issue at #59637 which will ideally be
repurposes to tracking all of these.

4 years agoupdate miri for latest breakage
Ralf Jung [Mon, 16 Sep 2019 08:06:11 +0000 (10:06 +0200)]
update miri for latest breakage

4 years agowith byteorder 1.3, the i128 feature is a NOP
Ralf Jung [Sun, 15 Sep 2019 11:54:04 +0000 (13:54 +0200)]
with byteorder 1.3, the i128 feature is a NOP

4 years agoupdate miri
Ralf Jung [Sun, 15 Sep 2019 11:53:04 +0000 (13:53 +0200)]
update miri

4 years ago`AdtDef` is an algebraic data type, not abstract data type.
Mazdak Farrokhzad [Tue, 10 Sep 2019 16:59:14 +0000 (18:59 +0200)]
`AdtDef` is an algebraic data type, not abstract data type.

4 years agoAuto merge of #64510 - Centril:rollup-m03zsq8, r=Centril
bors [Mon, 16 Sep 2019 15:35:48 +0000 (15:35 +0000)]
Auto merge of #64510 - Centril:rollup-m03zsq8, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #63955 (Make sure interned constants are immutable)
 - #64028 (Stabilize `Vec::new` and `String::new` as `const fn`s)
 - #64119 (ci: ensure all tool maintainers are assignable on issues)
 - #64444 (fix building libstd without backtrace feature)
 - #64446 (Fix build script sanitizer check.)
 - #64451 (when Miri tests are not passing, do not add Miri component)
 - #64467 (Hide diagnostics emitted during --cfg parsing)
 - #64497 (Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given)
 - #64499 (Use `Symbol` in two more functions.)
 - #64504 (use println!() instead of println!(""))

Failed merges:

r? @ghost

4 years agoRollup merge of #64504 - guanqun:use-println-without-empty-str, r=jonas-schievink
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:46 +0000 (17:09 +0200)]
Rollup merge of #64504 - guanqun:use-println-without-empty-str, r=jonas-schievink

use println!() instead of println!("")

The empty string is unnecessary.

4 years agoRollup merge of #64499 - nnethercote:use-Symbol-in-two-more-functions, r=petrochenkov
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:44 +0000 (17:09 +0200)]
Rollup merge of #64499 - nnethercote:use-Symbol-in-two-more-functions, r=petrochenkov

Use `Symbol` in two more functions.

r? @petrochenkov

4 years agoRollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:43 +0000 (17:09 +0200)]
Rollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov

Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given

Fixes #64339.

4 years agoRollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebank
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:41 +0000 (17:09 +0200)]
Rollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebank

Hide diagnostics emitted during --cfg parsing

The early error is more than sufficient for fixing the problem.

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

4 years agoRollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:40 +0000 (17:09 +0200)]
Rollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini

when Miri tests are not passing, do not add Miri component

This makes build-manifest query the toolstate repo at https://github.com/rust-lang-nursery/rust-toolstate to figure out if the tests of the Miri component are passing. If they are not, we remove the component from the manifest, to avoid shipping a broken Miri.

I tested this locally by running build-manifest and making sure that it correctly detects the toolstate of 02785dabad07d19b8c76a7f86763801d5d3497ff as broken.

r? @pietroalbini
Cc @kennytm @alexcrichton

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

4 years agoRollup merge of #64446 - ehuss:fix-sanitizer-build, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:38 +0000 (17:09 +0200)]
Rollup merge of #64446 - ehuss:fix-sanitizer-build, r=alexcrichton

Fix build script sanitizer check.

#64166 changed the way the sanitizer build scripts work. However, they were changed so that they switch between new-style to old-style cargo fingerprints. This trips up on https://github.com/rust-lang/cargo/issues/6779.

It also causes rustbuild to panic.  If you build stage1 std (with sanitizers off), and then enable sanitizers, it panics.  (This is because the build scripts don't declare that they need to re-run.)

This PR will trip https://github.com/rust-lang/cargo/issues/6779 again, unfortunately. I've been having way too many unexplained rebuilds in rust-lang/rust recently, but at least I'll know why this time.

This doesn't fix all problems with the build scripts, but arguably they should be fixed in cargo. For example, the build scripts change which rerun-if statements they declare between runs which triggers https://github.com/rust-lang/cargo/issues/7362.

The test for this is:
1. Turn off sanitizers (which is the default)
2. `./x.py build --stage=1 src/libstd`
3. `./x.py build --stage=1 src/libstd` again should be a null build.
4. Enable sanitizers.
5. `./x.py build --stage=1 src/libstd` should rebuild with sanitizers enabled.
6. `./x.py build --stage=1 src/libstd` again should be a null build. This actually rebuilds due to https://github.com/rust-lang/cargo/issues/7362 because the rerun-if directives changed between step 3 and 5. A 3rd attempt should be a null build.

4 years agoRollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:37 +0000 (17:09 +0200)]
Rollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton

fix building libstd without backtrace feature

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

r? @alexcrichton

4 years agoRollup merge of #64119 - pietroalbini:validate-toolstate-maintainers, r=kennytm
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:35 +0000 (17:09 +0200)]
Rollup merge of #64119 - pietroalbini:validate-toolstate-maintainers, r=kennytm

ci: ensure all tool maintainers are assignable on issues

GitHub only allows people explicitly listed as collaborators on the repository or who commented on the issue/PR to be assignees, failing to create the issue if non-assignable people are assigned.

This adds an extra check on CI to make sure all the people listed as tool maintainers can be assigned to toolstate issues. The check won't be executed on PR builds due to the lack of a valid token.

r? @kennytm

4 years agoRollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:34 +0000 (17:09 +0200)]
Rollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton

Stabilize `Vec::new` and `String::new` as `const fn`s

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

r? @oli-obk

4 years agoRollup merge of #63955 - RalfJung:intern, r=oli-obk
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:33 +0000 (17:09 +0200)]
Rollup merge of #63955 - RalfJung:intern, r=oli-obk

Make sure interned constants are immutable

This makes sure that interning for constants (not statics) creates only immutable allocations.

Previously, the "main" allocation of `const FOO: Cell<i32> = Cell::new(0);` was marked as mutable, but I don't think we want that. It can be only copied, not written to.

Also, "leftover" allocations (behind raw pointers etc) were left mutable. I don't think we want to support that. I tried asserting that these are all already immutable (to double-check our static checks), but that failed in this one:
```rust
const NON_NULL_PTR2: NonNull<u8> = unsafe { mem::transmute(&0) };
```
Seems like maybe we want more precise mutability annotation inside Miri for locals (like `&0` here) so that this would actually become immutable to begin with?

I also factored `intern_shallow` out of the visitor so that we don't have to construct a visitor when we do not plan to visit anything. That confused me at first.

4 years agoConst-stabilize `String::new`.
Mazdak Farrokhzad [Thu, 29 Aug 2019 10:36:07 +0000 (12:36 +0200)]
Const-stabilize `String::new`.

4 years agoConst-stabilize `Vec::new`.
Mazdak Farrokhzad [Thu, 29 Aug 2019 09:32:38 +0000 (11:32 +0200)]
Const-stabilize `Vec::new`.

4 years agoMake some adjustments to the documentation for `std::convert::identity`
varkor [Mon, 16 Sep 2019 14:43:46 +0000 (15:43 +0100)]
Make some adjustments to the documentation for `std::convert::identity`

Fixes some extra blank lines and makes some minor tweaks to the wording.

4 years agoavoid #[cfg] in favor of cfg!
Ralf Jung [Mon, 16 Sep 2019 14:37:44 +0000 (16:37 +0200)]
avoid #[cfg] in favor of cfg!

4 years agoci: remove projektir from toolstate notifications
Pietro Albini [Mon, 9 Sep 2019 14:03:57 +0000 (16:03 +0200)]
ci: remove projektir from toolstate notifications

They don't contribute to rust-by-example anymore.

4 years agoci: convert maintainer list in publish_toolstate to a set
Pietro Albini [Wed, 4 Sep 2019 08:21:23 +0000 (10:21 +0200)]
ci: convert maintainer list in publish_toolstate to a set

4 years agoci: address publish_toolstate review comments
Pietro Albini [Wed, 4 Sep 2019 08:08:54 +0000 (10:08 +0200)]
ci: address publish_toolstate review comments

4 years agoci: rename Gankro to Gankra in toolstate
Pietro Albini [Tue, 3 Sep 2019 10:04:22 +0000 (12:04 +0200)]
ci: rename Gankro to Gankra in toolstate