Commit Graph

83094 Commits

Author SHA1 Message Date
bors
f8d34596ff 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
2018-08-30 17:29:13 +00:00
Alex Crichton
b7a604ab34 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
2018-08-30 09:43:15 -07:00
bors
685fb54317 Auto merge of #53535 - TheDarkula:master, r=oli-obk
Made std::intrinsics::transmute() const fn.

r? @oli-obk

tracking issue: #53605
2018-08-30 14:18:22 +00:00
David Craven
8dfd5c39a1
[RISCV] Add riscv32imc-unknown-none-elf target. 2018-08-30 16:03:37 +02:00
David Craven
cd862a8ff3
[RISCV] Enable C extension. 2018-08-30 16:03:37 +02:00
David Craven
f00a952a3c
[RISCV] Use lld as the default linker. 2018-08-30 16:03:37 +02:00
Pietro Albini
38e2d00152
build-manifest: package docs only for tier 1 platforms 2018-08-30 14:41:01 +02:00
thedarkula
c5cae7935b Made std::intrinsics::transmute() const fn. 2018-08-30 13:06:20 +01:00
bors
0e98621e69 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
2018-08-30 10:41:41 +00:00
Andre Bogus
9dab56c4a2 fix u32 steps_between for 16-bit systems 2018-08-30 12:35:00 +02:00
Ralf Jung
97d693a19a assert sanity in memory 2018-08-30 11:39:40 +02:00
Basile Desloges
251f26298a Add regression test for issue #52060 2018-08-30 11:39:23 +02:00
Otto Rask
6020219993 Rephrase Arc documentation changes regarding clones
Make it clearer that `Arc::clone()` in fact creates a whole new
Arc with the internal pointer pointing to the same location as
the source Arc.
2018-08-30 12:20:41 +03:00
bors
03fe4c79f7 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
2018-08-30 08:20:20 +00:00
F001
7a083ca25f introduce Guard enum 2018-08-30 12:18:11 +08:00
bors
f1a5373a1b 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
2018-08-30 03:30:23 +00:00
bors
6244625cb4 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).
2018-08-30 00:07:15 +00:00
Guillaume Gomez
3b98571b32 Prevent duplicated impl on foreign types 2018-08-29 23:02:05 +02:00
Pietro Albini
729a87ede9
build-manifest: include extensions marked as unavailable 2018-08-29 23:01:47 +02:00
Pietro Albini
6732ce93da
build-manifest: add instructions to test the tool locally 2018-08-29 23:01:43 +02:00
Guillaume Gomez
e08a84a0c1 Fix UI issues on Implementations on Foreign types 2018-08-29 22:48:37 +02:00
Tobias Bucher
d6d280b7df Don't leak the file descriptor in rand 2018-08-29 22:30:29 +02:00
bors
02cb8f2a4f 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.
2018-08-29 20:08:16 +00:00
Alex Crichton
003cab25d7 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
2018-08-29 09:34:53 -07:00
Josh Triplett
7cec516ef9 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).
2018-08-29 08:53:54 -07:00
Corey Farwell
e477a13d63 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
2018-08-29 09:01:35 -05:00
bors
e6b35b0e11 Auto merge of #53758 - oli-obk:clippy, r=kennytm
Update clippy submodule

r? @Manishearth @nrc @kennytm
2018-08-29 13:35:25 +00:00
Tobias Bucher
890d04d00f Fix a comment in src/libcore/slice/mod.rs 2018-08-29 15:23:06 +02:00
MaloJaffre
21d2a6c986 Add another assert 2018-08-29 13:42:48 +02:00
Oliver Schneider
b96fef6080 Add more features to the workspace so that all tools pick up on it 2018-08-29 13:17:48 +02:00
Oliver Schneider
5983479a4d Update clippy submodule 2018-08-29 13:15:55 +02:00
bors
ba48850409 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.
2018-08-29 10:55:27 +00:00
Michael Woerister
3cf6f0db1a bootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds. 2018-08-29 12:27:20 +02:00
Otto Rask
5399616f1d Make Arc cloning mechanics clearer in module docs
Add some more wording to module documentation regarding how
`Arc::clone()` works, as some users have assumed cloning Arc's
to work via dereferencing to inner value as follows:

    use std::sync::Arc;

    let myarc = Arc::new(1);
    let myarcref = myarc.clone();

    assert!(1 == myarcref);

Instead of the actual mechanic of referencing the existing
Arc value:

    use std::sync::Arg;

    let myarc = Arc::new(1);
    let myarcref = myarc.clone();

    assert!(myarcref == &myarc); // not sure if assert could assert this
    in the real world
2018-08-29 13:20:56 +03:00
Matthias Krüger
50057ee3a3 bench: libcore: fix build failure of any.rs benchmark (use "dyn Any") 2018-08-29 12:18:05 +02:00
bors
ca0de63898 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?
2018-08-29 08:42:20 +00:00
Ralf Jung
b06a8db26e audit the relocations code, and clean it up a little 2018-08-29 10:09:53 +02:00
Ralf Jung
365b90c637 refactor memory access methods a bit 2018-08-29 08:44:37 +02:00
Ralf Jung
1d498d5a43 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
2018-08-29 08:44:37 +02:00
Ralf Jung
ec056d5188 re-do argument passing one more time to finally be sane 2018-08-29 08:44:37 +02:00
Ralf Jung
b8a40aad1b memory: make getting the alloc for a static an associate function for easier calling 2018-08-29 08:44:37 +02:00
Ralf Jung
cdeef61425 move some Scalar helpers from miri here, and use them where appropriate 2018-08-29 08:44:37 +02:00
bors
f4e981cfe4 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
2018-08-29 06:24:30 +00:00
bors
29e6aabceb 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
2018-08-29 04:20:01 +00:00
bors
9d69e81e9b 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
2018-08-29 02:08:02 +00:00
bors
f1d02c3073 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.
2018-08-29 00:02:37 +00:00
Nicholas Nethercote
8cecfa62e8 Remove AccumulateVec and its uses.
It's basically just a less capable version of `SmallVec`.
2018-08-29 08:32:11 +10:00
Philip Daniels
0902fc88db Add rust-gdbgui script.
This script invokes the gdbgui graphical GDB front-end
with the Rust pretty printers loaded. The script does not install
gdbgui, that must be done manually.
2018-08-28 22:05:04 +01:00
Alex Crichton
1fd45a13de 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
2018-08-28 13:32:11 -07:00
Philipp Krones
fa75111043
Also link Clippy repo in the CONTRIBUTING.md file 2018-08-28 20:43:10 +02:00