]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoFix of bug introduced by #53762
flip1995 [Sat, 1 Sep 2018 15:43:14 +0000 (17:43 +0200)]
Fix of bug introduced by #53762

5 years agoAuto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor
bors [Sat, 1 Sep 2018 11:26:24 +0000 (11:26 +0000)]
Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor

Implement the `min_const_fn` feature gate

cc @RalfJung @eddyb

r? @Centril

implements the feature gate for #53555

I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all.

The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.

5 years agoAuto merge of #53822 - dvc94ch:riscv, r=japaric
bors [Sat, 1 Sep 2018 06:58:16 +0000 (06:58 +0000)]
Auto merge of #53822 - dvc94ch:riscv, r=japaric

[RISCV] Use lld as the default linker; Enable C extension; Add riscv32imc-unknown-none-elf target

The riscv32imc-unknown-none-elf target is intended for soft cores.

The riscv32imc target is supported by the following popular soft cores:

picorv32: https://github.com/cliffordwolf/picorv32
vexriscv: https://github.com/SpinalHDL/VexRiscv
pulp riscy: https://github.com/pulp-platform/riscv
pulp zero-riscy: https://github.com/pulp-platform/zero-riscy

5 years agoAuto merge of #53762 - flip1995:tool_lints, r=Manishearth
bors [Sat, 1 Sep 2018 03:27:42 +0000 (03:27 +0000)]
Auto merge of #53762 - flip1995:tool_lints, r=Manishearth

Backwards compatibility for tool/clippy lints

cc #44690
cc https://github.com/rust-lang-nursery/rust-clippy/pull/2977#issuecomment-409706557

This is the next step towards `tool_lints`.

This makes Clippy lints still work without scoping, but will warn and suggest the new scoped name. This warning will only appear if the code is checked with Clippy itself.

There is still an issue with using the old lint name in inner attributes. For inner attributes the warning gets emitted twice. I'm currently not really sure why this happens, but will try to fix this ASAP.

r? @Manishearth

5 years agoAuto merge of #53611 - alexcrichton:update-llvm, r=nikomatsakis
bors [Sat, 1 Sep 2018 01:07:31 +0000 (01:07 +0000)]
Auto merge of #53611 - alexcrichton:update-llvm, r=nikomatsakis

Update LLVM submodule

This commit updates the LLVM submodule to the current trunk of LLVM itself. This
brings a few notable improvements for the wasm target:

* Support for wasm atomic instructions is greatly improved
* Renamed memory wasm intrinsics are fully supported
* LLD has fixed a quadratic execution bug with large numbers of relocations in
  wasm files.

The compiler-rt submodule has been updated in tandem as well.

5 years agoUpdate LLVM submodule
Alex Crichton [Wed, 22 Aug 2018 18:17:36 +0000 (11:17 -0700)]
Update LLVM submodule

This commit updates the LLVM submodule to the current trunk of LLVM itself. This
brings a few notable improvements for the wasm target:

* Support for wasm atomic instructions is greatly improved
* Renamed memory wasm intrinsics are fully supported
* LLD has fixed a quadratic execution bug with large numbers of relocations in
  wasm files.

The compiler-rt submodule has been updated in tandem as well.

5 years agoAuto merge of #53755 - llogiq:fix-unsound-16bit-range, r=nagisa
bors [Fri, 31 Aug 2018 22:44:17 +0000 (22:44 +0000)]
Auto merge of #53755 - llogiq:fix-unsound-16bit-range, r=nagisa

fix u32 steps_between for 16-bit systems

This fixes #48006.

5 years agoAuto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomez
bors [Fri, 31 Aug 2018 17:39:28 +0000 (17:39 +0000)]
Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomez

rustdoc: add flag to control the html_root_url of dependencies

The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows:

Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired.

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

5 years agoAuto merge of #53699 - oli-obk:promotion_stability_hole, r=nikomatsakis
bors [Fri, 31 Aug 2018 14:06:14 +0000 (14:06 +0000)]
Auto merge of #53699 - oli-obk:promotion_stability_hole, r=nikomatsakis

Fix promotion stability hole in old borrowck

r? @nikomatsakis

I screwed up the promotion stability checks. Big time. They were basically nonexistant. We had tests for it. I also screwed up said tests. This is in stable already :(

Basically stability checks of promotion only worked if you tried to use a const fn defined in the same crate.

cc @eddyb

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 agoGet rid of token passing
Oliver Schneider [Fri, 31 Aug 2018 09:47:45 +0000 (11:47 +0200)]
Get rid of token passing

5 years agoFix typo and small mistake
flip1995 [Thu, 30 Aug 2018 08:28:18 +0000 (10:28 +0200)]
Fix typo and small mistake

5 years agoUpdate tests
flip1995 [Thu, 30 Aug 2018 08:27:35 +0000 (10:27 +0200)]
Update tests

5 years agoAdd hint for cfg_attr and fix test
flip1995 [Wed, 29 Aug 2018 22:12:47 +0000 (00:12 +0200)]
Add hint for cfg_attr and fix test

5 years agoImplement backwards compatibility for tool_lints
flip1995 [Mon, 27 Aug 2018 21:25:31 +0000 (23:25 +0200)]
Implement backwards compatibility for tool_lints

5 years agoAdd deprecated_name argument to the register lint group functions
flip1995 [Mon, 27 Aug 2018 21:24:42 +0000 (23:24 +0200)]
Add deprecated_name argument to the register lint group functions

5 years agoAdd tests for backward compat
flip1995 [Mon, 27 Aug 2018 21:22:47 +0000 (23:22 +0200)]
Add tests for backward compat

5 years agoMake `Condvar::new` and `RWLock::new` min const fn for cloudabi
Oliver Schneider [Thu, 30 Aug 2018 08:45:05 +0000 (10:45 +0200)]
Make `Condvar::new` and `RWLock::new` min const fn for cloudabi

5 years agoAdd test that min const fns can't call unstable min const fns even with the feature...
Oliver Schneider [Thu, 30 Aug 2018 08:39:41 +0000 (10:39 +0200)]
Add test that min const fns can't call unstable min const fns even with the feature gate active

5 years agoRestrict most uses of `const_fn` to `min_const_fn`
Oliver Schneider [Wed, 29 Aug 2018 11:20:43 +0000 (13:20 +0200)]
Restrict most uses of `const_fn` to `min_const_fn`

5 years agoLibstd only has `min_const_fn` const fns
Oliver Schneider [Wed, 29 Aug 2018 11:00:14 +0000 (13:00 +0200)]
Libstd only has `min_const_fn` const fns

5 years agoImplement the `min_const_fn` feature gate
Oliver Schneider [Wed, 22 Aug 2018 13:56:37 +0000 (15:56 +0200)]
Implement the `min_const_fn` feature gate

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 ago[RISCV] Disable atomics for riscv32imc-unknown-none-elf.
David Craven [Thu, 30 Aug 2018 18:35:36 +0000 (20:35 +0200)]
[RISCV] Disable atomics for riscv32imc-unknown-none-elf.

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 ago[RISCV] Add riscv32imc-unknown-none-elf target.
David Craven [Thu, 30 Aug 2018 12:19:48 +0000 (14:19 +0200)]
[RISCV] Add riscv32imc-unknown-none-elf target.

5 years ago[RISCV] Enable C extension.
David Craven [Thu, 30 Aug 2018 12:19:02 +0000 (14:19 +0200)]
[RISCV] Enable C extension.

5 years ago[RISCV] Use lld as the default linker.
David Craven [Thu, 30 Aug 2018 12:14:07 +0000 (14:14 +0200)]
[RISCV] Use lld as the default linker.

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 agofix u32 steps_between for 16-bit systems
Andre Bogus [Tue, 28 Aug 2018 10:47:46 +0000 (12:47 +0200)]
fix u32 steps_between for 16-bit systems

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