Commit Graph

85756 Commits

Author SHA1 Message Date
Alex Crichton
f3428a7dc4 rustc: Delete grouping logic from the musl target
This commit deletes the injection of `-(` and `-)` options to the linker
for the musl targets. This actually causes problems today on nightly if
you execute:

    $ echo 'fn main() {}' >> foo.rs
    $ rustc --target x86_64-unknown-linux-musl -C panic=abort

you get a linker error about "cannot nest groups". This comes about
because rustc injects its own `--start-group` and `--end-group`
variables which clash with the outer `-(` and `-)` variables. It's not
entirely clear to me why this doesn't affect the musl target by default
(in `-C panic=unwind` mode).

The compiler's own injection of `--start-group` and `--end-group` should
solve the issues mentioned in the comment for injecting `-(` and `-)` as
well.
2018-11-03 10:23:51 -07:00
bors
3d28ee3e34 Auto merge of #55646 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #54162 (Hide default impls items)
 - #55555 (Make `-Z ls` list the actual filename of external dependencies)
 - #55567 (add test for deriving Debug on uninhabited enum)
 - #55568 (test that rustdoc doesn't overflow on a big enum)
 - #55598 (publish-toolstate: ping maintainers when a tool builds again)

Failed merges:

r? @ghost
2018-11-03 14:51:05 +00:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
9e479c2818
Update src/librustc_mir/monomorphize/partitioning.rs
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2018-11-03 14:45:50 +01:00
bjorn3
c8599191e8 Remove rustc_metadata_utils, which contains only one function 2018-11-03 14:31:09 +01:00
bjorn3
d46246b14a Move collect_and_partition_mono_items to rustc_mir 2018-11-03 14:31:09 +01:00
Guillaume Gomez
723edf7793
Rollup merge of #55598 - nrc:tool-bot, r=kennytm
publish-toolstate: ping maintainers when a tool builds again

And add @Xanewok as an RLS maintainer

r? @kennytm

Motivation is that I see when the RLS gets broken, but have to poll the website to see when it is fixed, I'd prefer to get pinged.
2018-11-03 13:40:39 +01:00
Guillaume Gomez
c674335ba3
Rollup merge of #55568 - durka:rustdoc-big-enum, r=nikomatsakis
test that rustdoc doesn't overflow on a big enum

Adds a test to close #25295. The test case depended on `enum_primitive` so I just basically pulled its source into an auxiliary file, is that the right way to do it?
2018-11-03 13:40:37 +01:00
Guillaume Gomez
c5c6e4239f
Rollup merge of #55567 - durka:derive-debug-uninhabited, r=nikomatsakis
add test for deriving Debug on uninhabited enum

Adds a test to close #38885.
2018-11-03 13:40:35 +01:00
Guillaume Gomez
8ab8f5342d
Rollup merge of #55555 - aidanhs:aphs-better-z-ls, r=alexcrichton
Make `-Z ls` list the actual filename of external dependencies

The hash is pointless for external consumers - extra_filename is the thing that actually gets used, per https://github.com/rust-lang/rust/blob/ca2639e/src/librustc_metadata/locator.rs#L312-L313
2018-11-03 13:40:34 +01:00
Guillaume Gomez
336b02347f
Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, r=QuietMisdreavus
Hide default impls items

Follow up of #51885.
Fixes #54025.

cc @Mark-Simulacrum

r? @QuietMisdreavus

And screenshots of course:

<img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png">

<img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-03 13:40:32 +01:00
bjorn3
942864a000 Move cg_llvm:🔙:linker to cg_utils 2018-11-03 13:35:09 +01:00
bors
2ad8c7b350 Auto merge of #55330 - scalexm:bound-ty, r=nikomatsakis
Add support for bound types

This PR may have some slight performance impacts, I don't know how hot is the code I touched.

Also, this breaks clippy and miri.

r? @nikomatsakis
2018-11-03 12:11:23 +00:00
scalexm
c5ed72fbfe Substitute binders directly 2018-11-03 11:41:55 +01:00
scalexm
0751997530 Rename as_bound_var to assert_bound_var 2018-11-03 11:41:55 +01:00
scalexm
af8196b9d3 Fix doc comment 2018-11-03 11:41:55 +01:00
scalexm
142359c220 Extend ty::fold::RegionReplacer to ty::fold::BoundVarReplacer
Use the new `BoundVarReplacer` to perform canonical substitutions.
2018-11-03 11:41:55 +01:00
scalexm
d99195ad8f Rename Binder::no_late_bound_regions to Binder::no_bound_vars 2018-11-03 11:41:55 +01:00
scalexm
45be1ac0fc Remove ReCanonical in favor of ReLateBound 2018-11-03 11:41:55 +01:00
scalexm
1f8de94f3b Adjust bound tys indices in canonicalization 2018-11-03 11:41:55 +01:00
scalexm
ee569c796d Rename BoundTy field level -> index 2018-11-03 11:41:55 +01:00
scalexm
3dd303aa89 Rename BoundTyIndex to BoundVar 2018-11-03 11:41:55 +01:00
scalexm
d0447550da Shift both late bound regions and bound types 2018-11-03 11:41:51 +01:00
John Paul Adrian Glaubitz
e04e5faa3f ci: Add Dockerfile for dist-powerpcspe-linux 2018-11-03 11:41:35 +01:00
scalexm
1003b7f85e Move BoundTy to ty::TyKind 2018-11-03 11:33:14 +01:00
bors
b6e8f9dbdc Auto merge of #55238 - alexcrichton:rm-jemalloc, r=estebank
Remove the `alloc_jemalloc` crate

This commit removes the `alloc_jemalloc` crate from the standard library and all related configuration. We will no longer be shipping this unstable crate. Rationale for this is provided on https://github.com/rust-lang/rust/issues/36963 and the many linked issues, but I can inline rationale here if desired!

We currently rely on jemalloc for increased perf in the Rust compiler, however. [This perf run shows](https://perf.rust-lang.org/compare.html?start=74ff7dcb1388e60a613cd6050bcd372a3cc4998b&end=7e7928dc0340d79b404e93f0c79eb4b946c1d669&stat=wall-time) that if we switch to glibc 2.23's allocator that it's slower than jemalloc across many benchmarks. [This perf run, however](https://perf.rust-lang.org/compare.html?start=22cc2ae8057d14e980b7c784e1eb2eee26b59e7d&end=10c95ccfa7a7adc12f4e608621ca29f9b98eed29), shows that if we use `jemalloc-sys` from crates.io then rustc actually gets faster across all benchmarks! (presumably because it has a more recent version of jemalloc than our submodule).

As a result, it's expected that this doesn't regress any code (as it's just removing an unstable crate) and it should actually improve rustc performance because it updates jemalloc.

Closes #36963
2018-11-03 09:33:10 +00:00
bors
757d6cc91a Auto merge of #55363 - pietroalbini:update-cargo-vendor, r=Mark-Simulacrum
Bump cargo-vendor version

Currently we pin `cargo-vendor` to 0.1.4, which doesn't set the `User-Agent` HTTP header. crates.io is going to require that header in the near future, so this PR bumps the pinned version of the crate to the latest one (which correctly sets the header).

r? @Mark-Simulacrum
cc @sgrif
2018-11-03 06:50:19 +00:00
Alex Burka
706a1cc0f2 fix test fallout 2018-11-03 05:03:30 +00:00
Alexander Regueiro
417168587b Fixed bug with Self type param coming before lifetimes. 2018-11-03 04:28:29 +00:00
Alexander Regueiro
c04559fe9e Added WF checking for trait alias definitions. 2018-11-03 04:09:35 +00:00
Alexander Regueiro
a62d0785a6 Fixed unsoundness hole. 2018-11-03 04:09:35 +00:00
Alexander Regueiro
469c3bf75b Resolve nits brought up in review. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
4bdc3d833a Extended elaboration for trait aliases to include arbitrary bounds. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
a8fcfcef30 Add more tests. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
1cda3c3b49 Added section to Unstable Book. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
4751953d5f Added tests. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
90041d638b Added support for trait aliases as object types. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
34792d9f6a Added support for trait aliases as bounds. 2018-11-03 04:09:33 +00:00
bors
3fc70e8d46 Auto merge of #54383 - mikeyhew:custom-receivers-object-safety, r=nikomatsakis
Take 2: Implement object-safety and dynamic dispatch for arbitrary_self_types

This replaces #50173. Over the months that that PR was open, we made a lot of changes to the way this was going to be implemented, and the long, meandering comment thread and commit history would have been confusing to people reading it in the future. So I decided to package everything up with new, straighforward commits and open a new PR.

Here are the main points. Please read the commit messages for details.

- To simplify codegen, we only support receivers that have the ABI of a pointer. That means they are builtin pointer types, or newtypes thereof.
- We introduce a new trait: `DispatchFromDyn<T>`, similar to `CoerceUnsized<T>`. `DispatchFromDyn` has extra requirements that `CoerceUnsized` does not: when you implement `DispatchFromDyn` for a struct, there cannot be any extra fields besides the field being coerced and `PhantomData` fields. This ensures that the struct's ABI is the same as a pointer.
- For a method's receiver (e.g. `self: Rc<Self>`) to be object-safe, it needs to have the following property:
    - let `DynReceiver` be the receiver when `Self = dyn Trait`
    - let `ConcreteReceiver` be the receiver when `Self = T`, where `T` is some unknown `Sized` type that implements `Trait`, and is the erased type of the trait object.
    - `ConcreteReceiver` must implement `DispatchFromDyn<DynReceiver>`

In the case of `Rc<Self>`, this requires `Rc<T>: DispatchFromDyn<Rc<dyn Trait>>`

These rules are explained more thoroughly in the doc comment on `receiver_is_dispatchable` in object_safety.rs.

r? @nikomatsakis and @eddyb

cc @arielb1 @cramertj @withoutboats

Special thanks to @nikomatsakis for getting me un-stuck when implementing the object-safety checks, and @eddyb for helping with the codegen parts.

EDIT 2018-11-01: updated because CoerceSized has been replaced with DispatchFromDyn
2018-11-03 02:37:29 +00:00
Felix S. Klock II
cc33aecb68 Regression test for issue 55608. 2018-11-03 02:32:43 +01:00
Felix S. Klock II
5aeb6c756e Sidestep an ICE by providing *some* description for ReEmpty when it arises. 2018-11-03 02:24:50 +01:00
QuietMisdreavus
297cfea0ce update rustdoc-ui/failed-doctest-output test 2018-11-02 17:17:02 -05:00
QuietMisdreavus
1260ad2138 pass the Options struct instead of individual args 2018-11-02 17:17:02 -05:00
Guillaume Gomez
ca65b4304e Don't show associated const items by default 2018-11-02 23:10:27 +01:00
QuietMisdreavus
014c8c4c38 implement existing parser fns in terms of fallible fns 2018-11-02 17:07:28 -05:00
QuietMisdreavus
4d6c2765e6 split off a separate RenderOptions struct 2018-11-02 16:41:33 -05:00
QuietMisdreavus
157833c588 swap uses of Matches with pre-parsed args 2018-11-02 16:24:58 -05:00
QuietMisdreavus
f5f496efd0 parse command-line into a central Options struct 2018-11-02 14:25:34 -05:00
bors
8b096314a6 Auto merge of #55087 - levex:e0669-improve-span, r=nagisa
rustc: improve E0669 span

E0669 refers to an operand that cannot be coerced into a single LLVM
value, unfortunately right now this uses the Span for the entire inline
assembly statement, which is less than ideal.

This commit preserves the Span from HIR, which lets us emit the error
using the Span for the operand itself in MIR.

r? @nagisa
cc/ @parched
2018-11-02 18:28:51 +00:00
Oliver Scherer
400f997de3 Rebase fallout 2018-11-02 16:56:59 +01:00
Ralf Jung
475139997a Rename Value to Immediate in docs
Co-Authored-By: oli-obk <github35764891676564198441@oli-obk.de>
2018-11-02 16:56:59 +01:00