]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #53403 - spastorino:move-out-lazily, r=nikomatsakis
bors [Fri, 31 Aug 2018 11:25:53 +0000 (11:25 +0000)]
Auto merge of #53403 - spastorino:move-out-lazily, r=nikomatsakis

Do not used Move data flow analysis, make it lazy instead

Close #53394

5 years agoAuto merge of #53832 - pietroalbini:rollup, r=pietroalbini
bors [Fri, 31 Aug 2018 03:35:33 +0000 (03:35 +0000)]
Auto merge of #53832 - pietroalbini:rollup, r=pietroalbini

Rollup of 20 pull requests

Successful merges:

 - #51760 (Add another PartialEq example)
 - #53113 (Add example for Cow)
 - #53129 (remove `let x = baz` which was obscuring the real error)
 - #53389 (document effect of join on memory ordering)
 - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
 - #53476 (Add partialeq implementation for TryFromIntError type)
 - #53513 (Force-inline `shallow_resolve` at its hottest call site.)
 - #53655 (set applicability)
 - #53702 (Fix stabilisation version for macro_vis_matcher.)
 - #53727 (Do not suggest dereferencing in macro)
 - #53732 (save-analysis: Differentiate foreign functions and statics.)
 - #53740 (add llvm-readobj to llvm-tools-preview)
 - #53743 (fix a typo: taget_env -> target_env)
 - #53747 (Rustdoc fixes)
 - #53753 (expand keep-stage --help text)
 - #53756 (Fix typo in comment)
 - #53768 (move file-extension based .gitignore down to src/)
 - #53785 (Fix a comment in src/libcore/slice/mod.rs)
 - #53786 (Replace usages of 'bad_style' with 'nonstandard_style'.)
 - #53806 (Fix UI issues on Implementations on Foreign types)

Failed merges:

r? @ghost

5 years agoAuto merge of #53779 - RalfJung:miri-refactor, r=oli-obk
bors [Fri, 31 Aug 2018 01:18:42 +0000 (01:18 +0000)]
Auto merge of #53779 - RalfJung:miri-refactor, r=oli-obk

Miri refactor: Final round

Tying up some loose ends that I noticed in the previous PRs -- and finally getting argument passing into a shape where @eddyb says it is "okay", which is a big improvement over the previous verdict that I cannot quote in public. ;)

Also move a bunch of useful helpers to construct `Scalar` from miri to here.

Cc @eddyb
r? @oli-obk

5 years agoAuto merge of #53828 - alexcrichton:dist-llvm-shared, r=japaric
bors [Thu, 30 Aug 2018 22:54:34 +0000 (22:54 +0000)]
Auto merge of #53828 - alexcrichton:dist-llvm-shared, r=japaric

rustbuild: Distribute libLLVM.so with rustc

A recent change (#53245) started to build LLVM with ThinLTO enabled and to
ensure that compile times are kept down it builds LLVM dynamically by default to
ensure that all the various LLVM tools aren't redoing all that optimization
work. This means, however, that all LLVM tools depend on LLVM's dynamic library
by default.

While the LLVM tools and LLDB components were updated to include the shared
library we accidentally forgot about LLD, included with the main rustc
component. LLD also links dynamically to LLVM and ships a non-working binary
right now because of this!

This commit updates our distribution to ship the LLVM dynamic library with the
compiler libraries.  While not technically needed for rustc itself to operate
(right now) it may be needed for LLD, and otherwise it serves as a good basis
for the other LLVM tools components to work with as well.

This should...

Closes #53813

5 years agoRun rustfmt
Santiago Pastorino [Thu, 30 Aug 2018 18:06:27 +0000 (15:06 -0300)]
Run rustfmt

5 years agoMake move out computation lazy
Santiago Pastorino [Thu, 30 Aug 2018 21:54:32 +0000 (18:54 -0300)]
Make move out computation lazy

5 years agoRollup merge of #53806 - GuillaumeGomez:fix-ui-issues-foreign-type-impls, r=QuietMisd...
Pietro Albini [Thu, 30 Aug 2018 18:15:48 +0000 (20:15 +0200)]
Rollup merge of #53806 - GuillaumeGomez:fix-ui-issues-foreign-type-impls, r=QuietMisdreavus

Fix UI issues on Implementations on Foreign types

Fixes #53800.

<img width="1440" alt="screen shot 2018-08-29 at 22 06 35" src="https://user-images.githubusercontent.com/3050060/44814733-e9986180-abdd-11e8-97e0-0e3c1816ca04.png">

r? @QuietMisdreavus

5 years agoRollup merge of #53786 - frewsxcv:frewsxcv-bad-style, r=Manishearth
Pietro Albini [Thu, 30 Aug 2018 18:15:47 +0000 (20:15 +0200)]
Rollup merge of #53786 - frewsxcv:frewsxcv-bad-style, r=Manishearth

Replace usages of 'bad_style' with 'nonstandard_style'.

`bad_style` is being deprecated in favor of `nonstandard_style`:

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

5 years agoRollup merge of #53785 - tbu-:pr_comment, r=Mark-Simulacrum
Pietro Albini [Thu, 30 Aug 2018 18:15:46 +0000 (20:15 +0200)]
Rollup merge of #53785 - tbu-:pr_comment, r=Mark-Simulacrum

Fix a comment in src/libcore/slice/mod.rs

5 years agoRollup merge of #53768 - RalfJung:gitignore, r=nikomatsakis
Pietro Albini [Thu, 30 Aug 2018 18:15:44 +0000 (20:15 +0200)]
Rollup merge of #53768 - RalfJung:gitignore, r=nikomatsakis

move file-extension based .gitignore down to src/

Currently, it for example ignores `*.rlib` files in the repository root -- which I think is wrong; I sometimes get these files when I call rustc directly and I do want them cleaned up, not ignored. No such files are created during the normal build process.

5 years agoRollup merge of #53756 - dmerejkowsky:fix-comment, r=KodrAus
Pietro Albini [Thu, 30 Aug 2018 18:15:43 +0000 (20:15 +0200)]
Rollup merge of #53756 - dmerejkowsky:fix-comment, r=KodrAus

Fix typo in comment

5 years agoRollup merge of #53753 - RalfJung:keep-stage, r=nikomatsakis
Pietro Albini [Thu, 30 Aug 2018 18:15:42 +0000 (20:15 +0200)]
Rollup merge of #53753 - RalfJung:keep-stage, r=nikomatsakis

expand keep-stage --help text

5 years agoRollup merge of #53747 - GuillaumeGomez:rustdoc-fixes, r=QuietMisdreavus
Pietro Albini [Thu, 30 Aug 2018 18:15:40 +0000 (20:15 +0200)]
Rollup merge of #53747 - GuillaumeGomez:rustdoc-fixes, r=QuietMisdreavus

Rustdoc fixes

Fixes rustdoc not scrolling to given lines and invalid unstable display:

<img width="1440" alt="screen shot 2018-08-27 at 23 28 47" src="https://user-images.githubusercontent.com/3050060/44687252-06535e80-aa51-11e8-8512-d7d34d1cb963.png">

r? @QuietMisdreavus

5 years agoRollup merge of #53743 - oconnor663:target_env, r=kennytm
Pietro Albini [Thu, 30 Aug 2018 18:15:39 +0000 (20:15 +0200)]
Rollup merge of #53743 - oconnor663:target_env, r=kennytm

fix a typo: taget_env -> target_env

This typo was introduced in https://github.com/rust-lang/rust/pull/47334. A couple tests bitrotted as a result, so we fix those too, and move them to a more sensible place.

Is there some lint we could turn on that would've caught this? It's a drag that cfg typos can silently pass through the compiler.

5 years agoRollup merge of #53740 - japaric:readobj, r=alexcrichton
Pietro Albini [Thu, 30 Aug 2018 18:15:38 +0000 (20:15 +0200)]
Rollup merge of #53740 - japaric:readobj, r=alexcrichton

add llvm-readobj to llvm-tools-preview

Similar to readelf but supports more object formats (it seems). Particularly useful to inspect in detail sections (e.g. their flags) and symbols (e.g. their types).

r? @alexcrichton
cc @dvc94ch

5 years agoRollup merge of #53732 - emilio:foreign-fn, r=nrc
Pietro Albini [Thu, 30 Aug 2018 18:15:37 +0000 (20:15 +0200)]
Rollup merge of #53732 - emilio:foreign-fn, r=nrc

save-analysis: Differentiate foreign functions and statics.

5 years agoRollup merge of #53727 - estebank:incorrect-deref-suggestion, r=nikomatsakis
Pietro Albini [Thu, 30 Aug 2018 18:15:35 +0000 (20:15 +0200)]
Rollup merge of #53727 - estebank:incorrect-deref-suggestion, r=nikomatsakis

Do not suggest dereferencing in macro

Fix #52783.

5 years agoRollup merge of #53702 - jkozlowski:correct_version_for_macro_vis_matcher, r=cramertj
Pietro Albini [Thu, 30 Aug 2018 18:15:34 +0000 (20:15 +0200)]
Rollup merge of #53702 - jkozlowski:correct_version_for_macro_vis_matcher, r=cramertj

Fix stabilisation version for macro_vis_matcher.

r? @cramertj

5 years agoRollup merge of #53655 - jcpst:with_applicability, r=estebank
Pietro Albini [Thu, 30 Aug 2018 18:15:33 +0000 (20:15 +0200)]
Rollup merge of #53655 - jcpst:with_applicability, r=estebank

set applicability

Update a few more calls as described in #50723

r? @estebank

5 years agoRollup merge of #53513 - nnethercote:inline-shallow_resolve, r=varkor
Pietro Albini [Thu, 30 Aug 2018 18:15:31 +0000 (20:15 +0200)]
Rollup merge of #53513 - nnethercote:inline-shallow_resolve, r=varkor

Force-inline `shallow_resolve` at its hottest call site.

It's a ~1% win on `keccak` and `inflate`.

5 years agoRollup merge of #53476 - GuillaumeGomez:try-from-int-error-partial-eq, r=KodrAus
Pietro Albini [Thu, 30 Aug 2018 18:15:30 +0000 (20:15 +0200)]
Rollup merge of #53476 - GuillaumeGomez:try-from-int-error-partial-eq, r=KodrAus

Add partialeq implementation for TryFromIntError type

Fixes #53458.

5 years agoRollup merge of #53472 - eddyb:fx-pls, r=pnkfelix
Pietro Albini [Thu, 30 Aug 2018 18:15:29 +0000 (20:15 +0200)]
Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelix

Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.

Most of the compiler uses the `Fx` hasher but some places ended up with the default one.

5 years agoRollup merge of #53389 - RalfJung:thread-join, r=sfackler
Pietro Albini [Thu, 30 Aug 2018 18:15:27 +0000 (20:15 +0200)]
Rollup merge of #53389 - RalfJung:thread-join, r=sfackler

document effect of join on memory ordering

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

5 years agoRollup merge of #53129 - nikomatsakis:issue-51172-tweak-test, r=pnkfelix
Pietro Albini [Thu, 30 Aug 2018 18:15:26 +0000 (20:15 +0200)]
Rollup merge of #53129 - nikomatsakis:issue-51172-tweak-test, r=pnkfelix

remove `let x = baz` which was obscuring the real error

fixes #51172

5 years agoRollup merge of #53113 - kpp:more_docs_for_cow, r=GuillaumeGomez
Pietro Albini [Thu, 30 Aug 2018 18:15:25 +0000 (20:15 +0200)]
Rollup merge of #53113 - kpp:more_docs_for_cow, r=GuillaumeGomez

Add example for Cow

Add one more example that shows how to keep `Cow` in a struct.

Link to playground: https://play.rust-lang.org/?gist=a9256bdd034b44bc3cdd0044bbcdbb7c&version=stable&mode=debug&edition=2015

Users ask this question in [ruRust](https://gitter.im/ruRust/general) chat time to time and it is not obvious to add `ToOwned<Owned=Target>` to requirements of generic params.

5 years agoRollup merge of #51760 - GuillaumeGomez:add-another-partialeq-example, r=QuietMisdreavus
Pietro Albini [Thu, 30 Aug 2018 18:15:23 +0000 (20:15 +0200)]
Rollup merge of #51760 - GuillaumeGomez:add-another-partialeq-example, r=QuietMisdreavus

Add another PartialEq example

r? @steveklabnik

5 years agoAuto merge of #53803 - pietroalbini:fix-manifest-2, r=alexcrichton
bors [Thu, 30 Aug 2018 17:29:13 +0000 (17:29 +0000)]
Auto merge of #53803 - pietroalbini:fix-manifest-2, r=alexcrichton

Fix manifests for broken tools: take 2

This is a follow up of #53715, to avoid stripping unavailable components from the extensions list. This time I also figured out how to test the changes, so the produced manifest is correct.

Along with the fix I added a README with instructions on how to test the tool, and a new `BUILD_MANIFEST_DISABLE_SIGNING` env var to avoid dealing with gpg while testing the tool. I chose an env var instead of a flag because it's more difficult to have it slip in by accident on CI, and there is also another protection that panics if that env var is set on CI, just to be sure we don't release unsigned artifacts.

r? @alexcrichton
cc https://github.com/rust-lang-nursery/rustup.rs/issues/1486

5 years agorustbuild: Distribute libLLVM.so with rustc
Alex Crichton [Thu, 30 Aug 2018 16:43:15 +0000 (09:43 -0700)]
rustbuild: Distribute libLLVM.so with rustc

A recent change (#53245) started to build LLVM with ThinLTO enabled and to
ensure that compile times are kept down it builds LLVM dynamically by default to
ensure that all the various LLVM tools aren't redoing all that optimization
work. This means, however, that all LLVM tools depend on LLVM's dynamic library
by default.

While the LLVM tools and LLDB components were updated to include the shared
library we accidentally forgot about LLD, included with the main rustc
component. LLD also links dynamically to LLVM and ships a non-working binary
right now because of this!

This commit updates our distribution to ship the LLVM dynamic library with the
compiler libraries.  While not technically needed for rustc itself to operate
(right now) it may be needed for LLD, and otherwise it serves as a good basis
for the other LLVM tools components to work with as well.

This should...

Closes #53813

5 years agoAuto merge of #53535 - TheDarkula:master, r=oli-obk
bors [Thu, 30 Aug 2018 14:18:22 +0000 (14:18 +0000)]
Auto merge of #53535 - TheDarkula:master, r=oli-obk

Made std::intrinsics::transmute() const fn.

r? @oli-obk

tracking issue: #53605

5 years agobuild-manifest: package docs only for tier 1 platforms
Pietro Albini [Thu, 30 Aug 2018 12:41:01 +0000 (14:41 +0200)]
build-manifest: package docs only for tier 1 platforms

5 years agoMade std::intrinsics::transmute() const fn.
thedarkula [Mon, 20 Aug 2018 18:51:48 +0000 (19:51 +0100)]
Made std::intrinsics::transmute() const fn.

5 years agoAuto merge of #53757 - oli-obk:validation, r=RalfJung
bors [Thu, 30 Aug 2018 10:41:41 +0000 (10:41 +0000)]
Auto merge of #53757 - oli-obk:validation, r=RalfJung

Use partial but correct vtable layout

r? @RalfJung who suggested to also do this change for nightly, not just beta

5 years agoassert sanity in memory
Ralf Jung [Thu, 30 Aug 2018 09:39:40 +0000 (11:39 +0200)]
assert sanity in memory

5 years agoAuto merge of #53733 - nnethercote:avoid-unroll_place, r=nikomatsakis
bors [Thu, 30 Aug 2018 08:20:20 +0000 (08:20 +0000)]
Auto merge of #53733 - nnethercote:avoid-unroll_place, r=nikomatsakis

Avoid calling `unroll_place()` in a common case.

This reduces the execution time for `ucd-check` by 25%.

r? @nikomatsakis

5 years agoAuto merge of #53685 - alexcrichton:more-keywords, r=varkor
bors [Thu, 30 Aug 2018 03:30:23 +0000 (03:30 +0000)]
Auto merge of #53685 - alexcrichton:more-keywords, r=varkor

Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes #53077

5 years agoAuto merge of #53479 - joshtriplett:underscore-means-unused, r=eddyb
bors [Thu, 30 Aug 2018 00:07:15 +0000 (00:07 +0000)]
Auto merge of #53479 - joshtriplett:underscore-means-unused, r=eddyb

Don't emit "unused extern crate" warnings for `extern crate foo as _;`

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).

5 years agobuild-manifest: include extensions marked as unavailable
Pietro Albini [Wed, 29 Aug 2018 20:57:40 +0000 (22:57 +0200)]
build-manifest: include extensions marked as unavailable

5 years agobuild-manifest: add instructions to test the tool locally
Pietro Albini [Wed, 29 Aug 2018 20:51:27 +0000 (22:51 +0200)]
build-manifest: add instructions to test the tool locally

5 years agoFix UI issues on Implementations on Foreign types
Guillaume Gomez [Wed, 29 Aug 2018 20:48:37 +0000 (22:48 +0200)]
Fix UI issues on Implementations on Foreign types

5 years agoAuto merge of #53564 - MaloJaffre:vecdeque, r=gnzlbg
bors [Wed, 29 Aug 2018 20:08:16 +0000 (20:08 +0000)]
Auto merge of #53564 - MaloJaffre:vecdeque, r=gnzlbg

Reoptimize VecDeque::append

~Unfortunately, I don't know if these changes fix the unsoundness mentioned in #53529, so it is stil a WIP.
This is also completely untested.
The VecDeque code contains other unsound code: one example : [reading unitialized memory](https://play.rust-lang.org/?gist=6ff47551769af61fd8adc45c44010887&version=nightly&mode=release&edition=2015) (detected by MIRI), so I think this code will need a bigger refactor to make it clearer and safer.~

Note: this is based on #53571.
r? @SimonSapin
Cc: #53529 #52553 @YorickPeterse @jonas-schievink @Pazzaz @shepmaster.
5 years agoGeneralize `async_idents` to all new keywords
Alex Crichton [Fri, 24 Aug 2018 20:48:20 +0000 (13:48 -0700)]
Generalize `async_idents` to all new keywords

This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes #53077

5 years agoDon't emit "unused extern crate" warnings for `extern crate foo as _;`
Josh Triplett [Sat, 18 Aug 2018 23:20:25 +0000 (16:20 -0700)]
Don't emit "unused extern crate" warnings for `extern crate foo as _;`

When importing a crate and renaming it to an underscore-prefixed name,
suppress "unused extern crate" warnings (but not idiom lints).

5 years agoReplace usages of 'bad_style' with 'nonstandard_style'.
Corey Farwell [Wed, 29 Aug 2018 13:21:01 +0000 (08:21 -0500)]
Replace usages of 'bad_style' with 'nonstandard_style'.

`bad_style` is being deprecated in favor of `nonstandard_style`:

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

5 years agoAuto merge of #53758 - oli-obk:clippy, r=kennytm
bors [Wed, 29 Aug 2018 13:35:25 +0000 (13:35 +0000)]
Auto merge of #53758 - oli-obk:clippy, r=kennytm

Update clippy submodule

r? @Manishearth @nrc @kennytm

5 years agoFix a comment in src/libcore/slice/mod.rs
Tobias Bucher [Wed, 29 Aug 2018 13:23:06 +0000 (15:23 +0200)]
Fix a comment in src/libcore/slice/mod.rs

5 years agoAdd another assert
MaloJaffre [Wed, 29 Aug 2018 11:39:57 +0000 (13:39 +0200)]
Add another assert

5 years agoAdd more features to the workspace so that all tools pick up on it
Oliver Schneider [Wed, 29 Aug 2018 11:17:48 +0000 (13:17 +0200)]
Add more features to the workspace so that all tools pick up on it

5 years agoUpdate clippy submodule
Oliver Schneider [Tue, 28 Aug 2018 11:19:01 +0000 (13:19 +0200)]
Update clippy submodule

5 years agoAuto merge of #53245 - michaelwoerister:thinlto-rust-llvm, r=alexcrichton
bors [Wed, 29 Aug 2018 10:55:27 +0000 (10:55 +0000)]
Auto merge of #53245 - michaelwoerister:thinlto-rust-llvm, r=alexcrichton

[experimental]: Build LLVM with ThinLTO enabled (2nd attempt)

This is https://github.com/rust-lang/rust/pull/51207 revived. This time, I'd like to run actual performance tests to see if it improves compile times.

5 years agobootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds.
Michael Woerister [Tue, 14 Aug 2018 12:31:12 +0000 (14:31 +0200)]
bootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds.

5 years agoAuto merge of #53711 - arielb1:macro-table, r=michaelwoerister
bors [Wed, 29 Aug 2018 08:42:20 +0000 (08:42 +0000)]
Auto merge of #53711 - arielb1:macro-table, r=michaelwoerister

create a valid DefIdTable for proc macro crates

At least the incremental compilation code, and a few other places in the
compiler, require the CrateMetadata for a loaded target crate to contain a
valid DefIdTable for the DefIds in the target.

Previously, the CrateMetadata for a proc macro contained the crate's
"host" DefIdTable, which is of course incompatible with the "target"
DefIdTable, causing ICEs. This creates a DefIdTable that properly refers
to the "proc macro" DefIds.

Fixes #49482.

r? @michaelwoerister

Should we beta-nominate this?

5 years agoaudit the relocations code, and clean it up a little
Ralf Jung [Wed, 29 Aug 2018 08:07:27 +0000 (10:07 +0200)]
audit the relocations code, and clean it up a little

5 years agorefactor memory access methods a bit
Ralf Jung [Tue, 28 Aug 2018 15:49:24 +0000 (17:49 +0200)]
refactor memory access methods a bit

5 years agomake ptr_op finally reponsible for all ops involving pointers; make ValTy constructor...
Ralf Jung [Mon, 27 Aug 2018 23:14:29 +0000 (01:14 +0200)]
make ptr_op finally reponsible for all ops involving pointers; make ValTy constructor private

Also remove public OpTy constructors, but a pub(crate) constructor remains

5 years agore-do argument passing one more time to finally be sane
Ralf Jung [Mon, 27 Aug 2018 11:34:35 +0000 (13:34 +0200)]
re-do argument passing one more time to finally be sane

5 years agomemory: make getting the alloc for a static an associate function for easier calling
Ralf Jung [Mon, 27 Aug 2018 11:34:12 +0000 (13:34 +0200)]
memory: make getting the alloc for a static an associate function for easier calling

5 years agomove some Scalar helpers from miri here, and use them where appropriate
Ralf Jung [Sun, 26 Aug 2018 18:42:52 +0000 (20:42 +0200)]
move some Scalar helpers from miri here, and use them where appropriate

5 years agoAuto merge of #53684 - alexcrichton:suggest-remove, r=oli-obk
bors [Wed, 29 Aug 2018 06:24:30 +0000 (06:24 +0000)]
Auto merge of #53684 - alexcrichton:suggest-remove, r=oli-obk

rustc: Suggest removing `extern crate` in 2018

This commit updates the `unused_extern_crates` lint to make automatic
suggestions about removing `extern crate` annotations in the 2018 edition. This
ended up being a little easier than originally though due to what's likely been
fixed issues in the resolver!

Closes #52829

5 years agoAuto merge of #53659 - nnethercote:rm-AccumulateVec, r=Mark-Simulacrum
bors [Wed, 29 Aug 2018 04:20:01 +0000 (04:20 +0000)]
Auto merge of #53659 - nnethercote:rm-AccumulateVec, r=Mark-Simulacrum

Remove `AccumulateVec` and its uses.

It's basically just a less capable version of `SmallVec`.

FWIW, the only use of `ArrayVec` is now within `HybridIdxSet`.

r? @Mark-Simulacrum

5 years agoAuto merge of #53642 - alexcrichton:fix-target-cpu-native, r=arielb1
bors [Wed, 29 Aug 2018 02:08:02 +0000 (02:08 +0000)]
Auto merge of #53642 - alexcrichton:fix-target-cpu-native, r=arielb1

Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322

5 years agoAuto merge of #53671 - RalfJung:miri-refactor, r=oli-obk
bors [Wed, 29 Aug 2018 00:02:37 +0000 (00:02 +0000)]
Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obk

Miri engine cleanup

* Unify the two maps in memory to store the allocation and its kind together.
* Share the handling of statics between CTFE and miri: The miri engine always
      uses "lazy" `AllocType::Static` when encountering a static.  Acessing that
      static invokes CTFE (no matter the machine).  The machine only has any
      influence when writing to a static, which CTFE outright rejects (but miri
      makes a copy-on-write).
* Add an `AllocId` to by-ref consts so miri can use them as operands without
      making copies.
* Move responsibilities around for the `eval_fn_call` machine hook: The hook
      just has to find the MIR (or entirely take care of everything); pushing the
      new stack frame is taken care of by the miri engine.
* Expose the intrinsics and lang items implemented by CTFE so miri does not
      have to reimplement them.
* Allow Machine to hook into foreign statics (used by miri to get rid of some other hacks).
* Clean up function calling.
* Switch const sanity check to work on operands, not mplaces.
* Move const_eval out of rustc_mir::interpret, to make sure that it does not access private implementation details.

In particular, we can finally make `eval_operand` take `&self`. :-)

Should be merged after https://github.com/rust-lang/rust/pull/53609, across which I will rebase.

5 years agoRemove `AccumulateVec` and its uses.
Nicholas Nethercote [Fri, 24 Aug 2018 03:51:32 +0000 (13:51 +1000)]
Remove `AccumulateVec` and its uses.

It's basically just a less capable version of `SmallVec`.

5 years agoFix warnings about the `native` target-cpu
Alex Crichton [Thu, 23 Aug 2018 18:03:22 +0000 (11:03 -0700)]
Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322

5 years agoAdd partialeq implementation for TryFromIntError type
Guillaume Gomez [Sat, 18 Aug 2018 21:24:25 +0000 (23:24 +0200)]
Add partialeq implementation for TryFromIntError type

5 years agomove file-extension based .gitignore down to src/
Ralf Jung [Tue, 28 Aug 2018 18:04:52 +0000 (20:04 +0200)]
move file-extension based .gitignore down to src/

5 years agofirst test const-ness, then hook fn call
Ralf Jung [Mon, 27 Aug 2018 15:57:30 +0000 (17:57 +0200)]
first test const-ness, then hook fn call

5 years agofix const_prop detecting unary neg underflows
Ralf Jung [Sun, 26 Aug 2018 14:36:18 +0000 (16:36 +0200)]
fix const_prop detecting unary neg underflows

5 years agorestructure unary_op to also dispatch on type first; fix promotion with unary '-...
Ralf Jung [Sun, 26 Aug 2018 13:13:01 +0000 (15:13 +0200)]
restructure unary_op to also dispatch on type first; fix promotion with unary '-' overflowing

5 years agofix unsized extern types
Ralf Jung [Sun, 26 Aug 2018 12:35:15 +0000 (14:35 +0200)]
fix unsized extern types

5 years agoaddress nits
Ralf Jung [Sun, 26 Aug 2018 12:22:59 +0000 (14:22 +0200)]
address nits

5 years agoAuto merge of #53679 - japaric:cortex-r, r=alexcrichton
bors [Tue, 28 Aug 2018 16:23:27 +0000 (16:23 +0000)]
Auto merge of #53679 - japaric:cortex-r, r=alexcrichton

add more Cortex-R targets

This expands on PR #53663 to complete the set of Cortex-R targets and builds
rust-std components for them.

r? @alexcrichton

each extra rust-std component (there's 4 of them) takes about 3 minutes to build
on my local machine. In terms of stability (LLVM codegen bugs) these new targets
should be as stable as the Cortex-M ones (e.g. `thumbv7m-none-eabi`).

If the extra build time is too much we can leave the rust-std components out for
now

closes #53663
cc @paoloteti

5 years agoUse FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
Eduard-Mihai Burtescu [Sat, 18 Aug 2018 10:55:43 +0000 (13:55 +0300)]
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.

5 years agoFix tidy
MaloJaffre [Tue, 28 Aug 2018 13:59:21 +0000 (15:59 +0200)]
Fix tidy

5 years agoAdd docs and debug asserts
MaloJaffre [Tue, 28 Aug 2018 13:38:56 +0000 (15:38 +0200)]
Add docs and debug asserts

5 years agoAuto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakis
bors [Tue, 28 Aug 2018 13:12:16 +0000 (13:12 +0000)]
Auto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakis

Use smaller span for adjustments on block expressions

When returning a mutable reference don't use the entire body of the function as the span for the adjustments at the end.

The error [in this case](https://github.com/rust-lang/rust/compare/master...matthewjasper:hair-spans?expand=1#diff-ecef8b1f15622fb48a803c9b61605c78) is worse, but neither error message is really what we want. I have some ideas on how to get a better error message that will have to wait for a future PR.

5 years agosort
Jorge Aparicio [Tue, 28 Aug 2018 12:58:52 +0000 (14:58 +0200)]
sort

5 years agoWarn about naively fixing the FIXME
Oliver Schneider [Tue, 28 Aug 2018 12:04:07 +0000 (14:04 +0200)]
Warn about naively fixing the FIXME

5 years agoUse partial but correct vtable layout
Oliver Schneider [Sun, 26 Aug 2018 20:21:20 +0000 (22:21 +0200)]
Use partial but correct vtable layout

5 years agoAuto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix
bors [Tue, 28 Aug 2018 10:58:10 +0000 (10:58 +0000)]
Auto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix

NLL: experiment with inverting liveness

I got inspired to see what would happen here.

Fixes #52460

r? @pnkfelix

5 years agoFix typo in comment
Dimitri Merejkowsky [Tue, 28 Aug 2018 09:06:40 +0000 (11:06 +0200)]
Fix typo in comment

5 years agoFix definition of `LocalUseMapBuild` so that it can build under stage0,
Felix S. Klock II [Tue, 28 Aug 2018 08:59:15 +0000 (10:59 +0200)]
Fix definition of `LocalUseMapBuild` so that it can build under stage0,
which does not have as many feature gates enabled.

5 years agosplit paragraph
Ralf Jung [Tue, 28 Aug 2018 08:49:45 +0000 (10:49 +0200)]
split paragraph

5 years agoexpand keep-stage --help text
Ralf Jung [Tue, 28 Aug 2018 08:20:24 +0000 (10:20 +0200)]
expand keep-stage --help text

5 years agoAuto merge of #53616 - varkor:hir-map-rename, r=nikomatsakis
bors [Tue, 28 Aug 2018 06:44:12 +0000 (06:44 +0000)]
Auto merge of #53616 - varkor:hir-map-rename, r=nikomatsakis

Restructure hir::map::Node and hir::map::Entry

- Moves `hir::map::Node` to `hir::Node` and removes the `Node*` prefix from its variants.
- Changes `hir::map::Entry` to a struct `hir::map::Entry`.
- Removes the `Node*` prefix from each of `AnnNode`s variants.

r? @eddyb

5 years agoAuto merge of #53404 - oconnor663:current_dir_behavior, r=alexcrichton
bors [Tue, 28 Aug 2018 03:22:21 +0000 (03:22 +0000)]
Auto merge of #53404 - oconnor663:current_dir_behavior, r=alexcrichton

document the platform-specific behavior of Command::current_dir

See also https://github.com/rust-lang/rust/issues/37868.

Here's my initial wording:

> Note that if the program path is relative (e.g. `"./script.sh"`), the interaction between that path and `current_dir` varies across platforms. Windows currently ignores `current_dir` when locating the program, but Unix-like systems interpret the program path relative to `current_dir`. These implementation details aren't considered stable, and it's recommended to call `canonicalize` to get an absolute program path instead of using relative paths and `current_dir` together.

I'd like to get feedback on:

- _Should_ we consider those details stable? It might be disruptive to change them, regardless of what I can get away with claiming in docs :)
- Is `canonicalize` an appropriate recommendation? As discussed in #37868 above, there are reasons it's not called automatically in the `Command` implementation.

5 years agoAuto merge of #53272 - mark-i-m:anon_param_error_now, r=nikomatsakis
bors [Tue, 28 Aug 2018 01:04:05 +0000 (01:04 +0000)]
Auto merge of #53272 - mark-i-m:anon_param_error_now, r=nikomatsakis

Warn on anon params in 2015 edition

cc #41686 https://github.com/rust-lang/rfcs/pull/2522
cc  @Centril @nikomatsakis

TODO:
- [x] Make sure the tests pass.
- [x] Make sure there is rustfix-able suggestion. Current plan is to just suggest `_ : Foo`
- [x] Add a rustfix ui test.

EDIT: It seems I already did the last two in #48309

5 years agoAuto merge of #53227 - nivkner:pin_move, r=RalfJung
bors [Mon, 27 Aug 2018 22:56:15 +0000 (22:56 +0000)]
Auto merge of #53227 - nivkner:pin_move, r=RalfJung

move the Pin API into its own module for centralized documentation

This implements the change proposed by @withoutboats in #49150, as suggested by @RalfJung in the review of #53104,
along with the documentation that was originally in it, that was deemed more appropriate in module-level documentation.

r? @RalfJung

5 years agoremove `let x = baz` which was obscuring the real error
Niko Matsakis [Mon, 6 Aug 2018 20:41:35 +0000 (16:41 -0400)]
remove `let x = baz` which was obscuring the real error

5 years agoRevert crate root changes
varkor [Sat, 25 Aug 2018 23:20:24 +0000 (00:20 +0100)]
Revert crate root changes

5 years agoMake small modifications
varkor [Sat, 25 Aug 2018 22:10:01 +0000 (23:10 +0100)]
Make small modifications

5 years agoRename hir::map::NodeKind to hir::Node
varkor [Sat, 25 Aug 2018 14:56:16 +0000 (15:56 +0100)]
Rename hir::map::NodeKind to hir::Node

5 years agoConvert EntryKind to a struct, Entry
varkor [Sat, 25 Aug 2018 14:48:42 +0000 (15:48 +0100)]
Convert EntryKind to a struct, Entry

5 years agoRemove path prefixes from NodeKind
varkor [Wed, 22 Aug 2018 22:05:26 +0000 (23:05 +0100)]
Remove path prefixes from NodeKind

5 years agoRemove Node* prefix from AnnNode
varkor [Wed, 22 Aug 2018 21:05:19 +0000 (22:05 +0100)]
Remove Node* prefix from AnnNode

5 years agoRename hir::map::Node to hir::map::NodeKind
varkor [Wed, 22 Aug 2018 20:55:53 +0000 (21:55 +0100)]
Rename hir::map::Node to hir::map::NodeKind

5 years agoRename MapEntry to EntryKind
varkor [Wed, 22 Aug 2018 20:35:43 +0000 (21:35 +0100)]
Rename MapEntry to EntryKind

5 years agoFix invalid display of unstable messages
Guillaume Gomez [Mon, 27 Aug 2018 19:52:10 +0000 (21:52 +0200)]
Fix invalid display of unstable messages

5 years agoFix source automatic scroll
Guillaume Gomez [Mon, 27 Aug 2018 19:51:56 +0000 (21:51 +0200)]
Fix source automatic scroll

5 years agoAuto merge of #51456 - qmx:crate-in-path, r=nikomatsakis
bors [Mon, 27 Aug 2018 19:51:01 +0000 (19:51 +0000)]
Auto merge of #51456 - qmx:crate-in-path, r=nikomatsakis

resolve suggestions should use `crate::` when enabled

I couldn't find a way to add a specific assertion for the ui test, so the expected output is living under the `crates-in-path.stderr` ui test.

- is this the right place for the test?

fixes #51212

5 years agofix a typo: taget_env -> target_env
Jack O'Connor [Mon, 27 Aug 2018 17:25:58 +0000 (13:25 -0400)]
fix a typo: taget_env -> target_env

This typo was introduced in https://github.com/rust-lang/rust/pull/47334.
A couple tests bitrotted as a result, so we fix those too, and move them
to a more sensible place.