]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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

4 years agoci: ensure all tool maintainers are assignable on issues
Pietro Albini [Tue, 3 Sep 2019 09:33:29 +0000 (11:33 +0200)]
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.

4 years agoAuto merge of #64381 - mati865:rand, r=alexcrichton
bors [Mon, 16 Sep 2019 11:47:11 +0000 (11:47 +0000)]
Auto merge of #64381 - mati865:rand, r=alexcrichton

Upgrade parking_lot and tempfile rustc dependencies

This should be last piece to unbreak `rustc` in https://github.com/rust-lang/rust/issues/63848

4 years agoAuto merge of #64383 - pcpthm:btreeset-size-hint, r=dtolnay
bors [Mon, 16 Sep 2019 05:16:19 +0000 (05:16 +0000)]
Auto merge of #64383 - pcpthm:btreeset-size-hint, r=dtolnay

Improve BTreeSet::Intersection::size_hint

A comment on `IntersectionInner` mentions `small_iter` should be smaller than `other_iter` but this condition is broken while iterating because those two iterators can be consumed at a different rate. I added a test to demonstrate this situation.
<del>I made `small_iter.len() < other_iter.len()` always true by swapping two iterators when that condition became false. This change affects the return value of `size_hint`. The previous result was also correct but this new version always returns smaller upper bound than the previous version.</del>
I changed `size_hint` to taking minimum of both lengths of iterators and renamed fields to `a` and `b` to match `Union` iterator.

4 years agoUse `Symbol` in two more functions.
Nicholas Nethercote [Mon, 16 Sep 2019 05:00:28 +0000 (15:00 +1000)]
Use `Symbol` in two more functions.

4 years agoImprove BTreeSet::Intersection::size_hint
pcpthm [Mon, 16 Sep 2019 04:37:52 +0000 (04:37 +0000)]
Improve BTreeSet::Intersection::size_hint
The commented invariant that an iterator is smaller than other iterator
was violated after next is called and two iterators are consumed at
different rates.

4 years agoDon't print the "total" `-Ztime-passes` output if `--prints=...` is also given.
Nicholas Nethercote [Mon, 16 Sep 2019 03:27:38 +0000 (13:27 +1000)]
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given.

Fixes #64339.

4 years agoMove `impl Node` just after `struct Node`.
Nicholas Nethercote [Mon, 16 Sep 2019 02:47:46 +0000 (12:47 +1000)]
Move `impl Node` just after `struct Node`.

4 years agoMinor comment tweaks.
Nicholas Nethercote [Mon, 16 Sep 2019 02:47:04 +0000 (12:47 +1000)]
Minor comment tweaks.

4 years agoUse `retain` for `waiting_cache` in `apply_rewrites()`.
Nicholas Nethercote [Mon, 16 Sep 2019 02:43:48 +0000 (12:43 +1000)]
Use `retain` for `waiting_cache` in `apply_rewrites()`.

It's more concise, more idiomatic, and measurably faster.

4 years agoUse iterators in `error_at` and `process_cycle`.
Nicholas Nethercote [Mon, 16 Sep 2019 02:43:16 +0000 (12:43 +1000)]
Use iterators in `error_at` and `process_cycle`.

This makes the code a little faster, presumably because bounds checks
aren't needed on `nodes` accesses. It requires making `scratch` a
`RefCell`, which is not unreasonable.

4 years agoAdd comments about `waiting_cache`.
Nicholas Nethercote [Mon, 16 Sep 2019 02:41:36 +0000 (12:41 +1000)]
Add comments about `waiting_cache`.

4 years agoFix incorrect comment about contents of a `Node`.
Nicholas Nethercote [Mon, 16 Sep 2019 02:40:31 +0000 (12:40 +1000)]
Fix incorrect comment about contents of a `Node`.

4 years agoFix some out-of-date names of things in comments.
Nicholas Nethercote [Mon, 16 Sep 2019 02:39:21 +0000 (12:39 +1000)]
Fix some out-of-date names of things in comments.

4 years agoRemove out-of-date comments.
Nicholas Nethercote [Mon, 16 Sep 2019 02:38:24 +0000 (12:38 +1000)]
Remove out-of-date comments.

These refer to code that no longer exists.

4 years agoFactor out repeated `self.nodes[i]` expressions.
Nicholas Nethercote [Mon, 16 Sep 2019 01:56:17 +0000 (11:56 +1000)]
Factor out repeated `self.nodes[i]` expressions.

4 years agoRedefine `NodeIndex` as a `newtype_index!`.
Nicholas Nethercote [Mon, 16 Sep 2019 01:53:12 +0000 (11:53 +1000)]
Redefine `NodeIndex` as a `newtype_index!`.

This commit removes the custom index implementation of `NodeIndex`,
which probably predates `newtype_index!`.

As well as eliminating code, it improves the debugging experience,
because the custom implementation had the property of being incremented
by 1 (so it could use `NonZeroU32`), which was incredibly confusing if
you didn't expect it.

For some reason, I also had to remove an `unsafe` block marker from
`from_u32_unchecked()` that the compiler said was now unnecessary.

4 years agoName index variables consistently.
Nicholas Nethercote [Mon, 16 Sep 2019 01:49:15 +0000 (11:49 +1000)]
Name index variables consistently.

Those with type `usize` are now called `i`, those with type `NodeIndex`
are called `index`.

4 years agoAuto merge of #64487 - Xanewok:update-rls, r=jonas-schievink
bors [Mon, 16 Sep 2019 00:15:45 +0000 (00:15 +0000)]
Auto merge of #64487 - Xanewok:update-rls, r=jonas-schievink

Update RLS

Fixes the toolstate.

Closes #64480

r? @jonas-schievink

4 years agoHide diagnostics emitted during --cfg parsing
Mark Rousskov [Sat, 14 Sep 2019 20:17:57 +0000 (16:17 -0400)]
Hide diagnostics emitted during --cfg parsing

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

4 years agoAuto merge of #64491 - Centril:rollup-21wkl69, r=Centril
bors [Sun, 15 Sep 2019 20:06:49 +0000 (20:06 +0000)]
Auto merge of #64491 - Centril:rollup-21wkl69, r=Centril

Rollup of 3 pull requests

Successful merges:

 - #63872 (Document platform-specific behavior of the iterator returned by std::fs::read_dir)
 - #64250 (save-analysis: Nest typeck tables when processing functions/methods)
 - #64472 (Don't mark expression with attributes as not needing parentheses)

Failed merges:

r? @ghost

4 years agoRollup merge of #64472 - Mark-Simulacrum:unused-parens-attr, r=varkor
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:36:01 +0000 (19:36 +0200)]
Rollup merge of #64472 - Mark-Simulacrum:unused-parens-attr, r=varkor

Don't mark expression with attributes as not needing parentheses

This is not perfectly correct as `#[attr] (5)` will still not lint, but it does seem good enough, in particular as the parentheses in that case are not unambiguously incorrect; I might personally prefer to see them for clarity.

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

4 years agoRollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkor
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:35:59 +0000 (19:35 +0200)]
Rollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkor

save-analysis: Nest typeck tables when processing functions/methods

Fixes an issue where we did not nest tables correctly when resolving
associated types in formal argument/return type positions.

This was the minimized reproduction case that I tested the fix on:
```rust
pub trait Trait {
    type Assoc;
}

pub struct A;

pub fn func() {
    fn _inner1<U: Trait>(_: U::Assoc) {}
    fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() }

    impl A {
        fn _inner1<U: Trait>(self, _: U::Assoc) {}
        fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() }
    }
}
```
using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`.

Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this.

Closes #63663
Closes #50328
Closes #43982

4 years agoRollup merge of #63872 - marmistrz:readdir, r=jonas-schievink
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:35:58 +0000 (19:35 +0200)]
Rollup merge of #63872 - marmistrz:readdir, r=jonas-schievink

Document platform-specific behavior of the iterator returned by std::fs::read_dir

4 years agoAuto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasper
bors [Sun, 15 Sep 2019 16:21:34 +0000 (16:21 +0000)]
Auto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasper

Permit impls referencing errors to overlap

Fixes #43400; previously this would emit an overlapping impls error, but no longer does.

4 years agouse println!()
Guanqun Lu [Fri, 13 Sep 2019 09:36:35 +0000 (17:36 +0800)]
use println!()

4 years agoUpdate RLS
Igor Matuszewski [Sun, 15 Sep 2019 14:00:01 +0000 (16:00 +0200)]
Update RLS

4 years agoPermit impls referencing errors to overlap
Mark Rousskov [Sat, 14 Sep 2019 23:26:49 +0000 (19:26 -0400)]
Permit impls referencing errors to overlap

4 years agoupdate intern classification comment
Ralf Jung [Wed, 28 Aug 2019 07:54:30 +0000 (09:54 +0200)]
update intern classification comment

4 years agoexplain ty == None
Ralf Jung [Wed, 28 Aug 2019 07:44:48 +0000 (09:44 +0200)]
explain ty == None

4 years agoassert that nobody asks for mutable constants
Ralf Jung [Wed, 28 Aug 2019 06:31:51 +0000 (08:31 +0200)]
assert that nobody asks for mutable constants

4 years agonote a FIXME
Ralf Jung [Tue, 27 Aug 2019 19:24:30 +0000 (21:24 +0200)]
note a FIXME

4 years agorelocations -> allocations
Ralf Jung [Tue, 27 Aug 2019 19:15:55 +0000 (21:15 +0200)]
relocations -> allocations

4 years agoAuto merge of #64483 - petrochenkov:expectattr2, r=Centril
bors [Sun, 15 Sep 2019 12:24:32 +0000 (12:24 +0000)]
Auto merge of #64483 - petrochenkov:expectattr2, r=Centril

resolve: Tweak some "cannot find" wording for macros

4 years agodrop redundant ParamEnv, and avoid constructing InternVisitor without visiting
Ralf Jung [Tue, 27 Aug 2019 19:13:05 +0000 (21:13 +0200)]
drop redundant ParamEnv, and avoid constructing InternVisitor without visiting

4 years agoall memory behind a constant must be immutable
Ralf Jung [Tue, 27 Aug 2019 18:59:34 +0000 (20:59 +0200)]
all memory behind a constant must be immutable

4 years agoconst interning: move mutability computation into intern_shallow, and always intern...
Ralf Jung [Tue, 27 Aug 2019 17:54:54 +0000 (19:54 +0200)]
const interning: move mutability computation into intern_shallow, and always intern constants as immutable

4 years agoresolve: Remove `!` from "cannot find" diagnostics for macros
Vadim Petrochenkov [Sun, 15 Sep 2019 10:12:14 +0000 (13:12 +0300)]
resolve: Remove `!` from "cannot find" diagnostics for macros

4 years agoresolve: Tweak "cannot find" wording for attributes
Vadim Petrochenkov [Sun, 15 Sep 2019 09:55:18 +0000 (12:55 +0300)]
resolve: Tweak "cannot find" wording for attributes

4 years agoAuto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov
bors [Sun, 15 Sep 2019 08:17:57 +0000 (08:17 +0000)]
Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov

Cleanup handling of hygiene for built-in macros

This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms.

* `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}`
* Remove `Span::with_legacy_ctxt`
    * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically.
    * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene.
    * everything else is moved to def-site hygiene

r? @petrochenkov

4 years agoRemove `with_legacy_ctxt`
Matthew Jasper [Sat, 14 Sep 2019 20:17:11 +0000 (21:17 +0100)]
Remove `with_legacy_ctxt`

4 years agoGive more `Idents` spans
Matthew Jasper [Sat, 14 Sep 2019 20:16:51 +0000 (21:16 +0100)]
Give more `Idents` spans

4 years agoAvoid some unnecessary `&str` to `Ident` conversions
Matthew Jasper [Sat, 14 Sep 2019 20:14:03 +0000 (21:14 +0100)]
Avoid some unnecessary `&str` to `Ident` conversions

4 years agoPrefer `Symbol` to `Ident` when there's no sensible `Span`
Matthew Jasper [Sat, 14 Sep 2019 20:10:12 +0000 (21:10 +0100)]
Prefer `Symbol` to `Ident` when there's no sensible `Span`

4 years agoAuto merge of #64478 - Centril:rollup-bnt51w1, r=Centril
bors [Sun, 15 Sep 2019 03:59:08 +0000 (03:59 +0000)]
Auto merge of #64478 - Centril:rollup-bnt51w1, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #64457 (def_collector: Do not ICE on attributes on unnamed fields)
 - #64463 (resolve: Tweak some expected/found wording)
 - #64471 (Warn on no_start, crate_id attribute use)
 - #64473 (Use try_fold instead of manually carrying an accumulator)
 - #64475 (simplify the initialization)

Failed merges:

r? @ghost

4 years agoRollup merge of #64475 - guanqun:use-same-name, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:49 +0000 (02:29 +0200)]
Rollup merge of #64475 - guanqun:use-same-name, r=Centril

simplify the initialization

4 years agoRollup merge of #64473 - spastorino:use-try-fold, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:47 +0000 (02:29 +0200)]
Rollup merge of #64473 - spastorino:use-try-fold, r=Centril

Use try_fold instead of manually carrying an accumulator

r? @RalfJung

4 years agoRollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:46 +0000 (02:29 +0200)]
Rollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=Centril

Warn on no_start, crate_id attribute use

These attributes are now deprecated; they don't have any use anymore.

`no_start` stopped being applicable in 3ee916e50bd86768cb2a9141f9b2c52d2601b412 as part of #18967. Ideally we would've removed it pre-1.0, but since that didn't happen let's at least mark it deprecated.

`crate_id` was renamed to `crate_name` in 50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac as part of #15319. Ideally we would've followed that up with a removal of crate_id itself as well, but that didn't happen; this PR finally marks it as deprecated at least.

Fixes https://github.com/rust-lang/rust/issues/43142 and resolves https://github.com/rust-lang/rust/issues/43144.

4 years agoRollup merge of #64463 - petrochenkov:expectattr, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:44 +0000 (02:29 +0200)]
Rollup merge of #64463 - petrochenkov:expectattr, r=Centril

resolve: Tweak some expected/found wording

4 years agoRollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:43 +0000 (02:29 +0200)]
Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper

def_collector: Do not ICE on attributes on unnamed fields

The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`).

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