Commit Graph

87619 Commits

Author SHA1 Message Date
kennytm
26842aeac6
Rollup merge of #57039 - davidtwco:migrate-warning-wording, r=pnkfelix
Update migrate warning wording.

This PR modifies the wording of the warning for backwards-incompatible changes in migrate mode. The warning messages are changed to be lowercase and not include line-breaks in order to be consistent with other compiler diagnostics.
2018-12-23 02:12:28 +08:00
kennytm
5ffd1a63e6
Rollup merge of #57052 - Centril:fix-eip-stable-version, r=varkor
Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher)

+ `exhaustive_integer_patterns` slipped 1.32; merged in 1.33 -- https://github.com/rust-lang/rust/pull/56362
+ `macro_literal_matcher` isn't stable on current stable (1.31) but is on beta (1.32).

r? @varkor
2018-12-23 02:12:27 +08:00
kennytm
bba398ee2c
Rollup merge of #57050 - RyanMarcus:master, r=zackmdavis
Fixed typo in HashMap documentation

Previously "with a custom type as key", now "with a custom key type"
2018-12-23 02:12:25 +08:00
kennytm
60b4ea0472
Rollup merge of #57049 - cramertj:repr-packed, r=Centril
Stabilize #[repr(packed(N))]

Fixes https://github.com/rust-lang/rust/issues/33158
2018-12-23 02:12:23 +08:00
kennytm
e4430e0340
Rollup merge of #57040 - otavio:topic/adjust-path_from_str-feature-gate, r=Centril
Fix feature gate to point to 1.32.0 for `path_from_str`

When the feature has been added back (#55148) the feature gate has not
been adjusted accordingly. We have it enabled for 1.32.0, currently in
Beta, so adjust it.

Refs: #44431.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-12-23 02:12:22 +08:00
kennytm
5e727a43cb
Rollup merge of #57034 - Zoxc:query-perf8, r=michaelwoerister
Inline tweaks

r? @michaelwoerister
2018-12-23 02:12:20 +08:00
kennytm
9b2331d2ca
Rollup merge of #57027 - Zoxc:query-perf5, r=michaelwoerister
Optimize away a move

r? @michaelwoerister
2018-12-23 02:12:19 +08:00
kennytm
4446c65d9b
Rollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomez
rustdoc: add new CLI flag to load static files from a different location

This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from.

I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links.

r? @GuillaumeGomez

cc @onur
2018-12-23 02:12:16 +08:00
kennytm
5ba6a3438b
Rollup merge of #57002 - scottmcm:stabilize-resize_with, r=rkruppe
Stabilize Vec(Deque)::resize_with

Closes #41758
2018-12-23 02:12:15 +08:00
kennytm
7bb40eb362
Rollup merge of #56992 - euclio:unknown-lint-suggestion, r=oli-obk
suggest similar lint names for unknown lints

Fixes #54737.
2018-12-23 02:12:13 +08:00
kennytm
10e43303a4
Rollup merge of #56989 - phansch:fix_compiletest_trim_deprecations, r=Mark-Simulacrum
Fix compiletest `trim` deprecation warnings

None
2018-12-23 02:12:12 +08:00
kennytm
afe572b37f
Rollup merge of #56984 - ljedrz:dropck_outlives_tweaks, r=oli-obk
A few tweaks to dropck_outlives

- remove an unnecessary call to `cloned()`
- simplify common patterns
2018-12-23 02:12:10 +08:00
kennytm
40dc787474
Rollup merge of #56981 - RalfJung:miri-infallible-alloc, r=oli-obk
miri: allocation is infallible
2018-12-23 02:12:08 +08:00
kennytm
10d949aa3e
Rollup merge of #56979 - VardhanThigle:Vardhan/rust-sgx-unwind-support, r=alexcrichton
Adding unwinding support for x86_64_fortanix_unknown_sgx target.

Unwinding support is provided by our port of LLVM's libunwind which is available from https://github.com/fortanix/libunwind/tree/release_50.

libunwind requires support for rwlock and printing to stderr, which is only provided by `std` for this target. This poses two problems: 1) how to expose the `std` functionality to C and 2) dependency inversion.

### Exposing `std`

For exposing the functionality we chose to expose the following symbols:

* __rust_rwlock_rdlock
* __rust_rwlock_wrlock
* __rust_rwlock_unlock
* __rust_print_err
* __rust_abort

Also, the following are needed from `alloc`:

* __rust_alloc
* __rust_dealloc

#### Rust RWLock in C

In `libunwind`, RWLock is initialized as a templated static variable:

```c
pthread_rwlock_t DwarfFDECache<A>::_lock = PTHREAD_RWLOCK_INITIALIZER;
```

I don't know of a good way to use the Rust sys::rwlock::RWLock type and initializer there. We could have a static global variable in Rust, but that doesn't work with the templating. The variable needs to be initialized statically, since this target doesn't support the .init section. Currently, I just used a byte array and standard C array initialization. The mapping between this C type and the Rust type needs to be manually maintained. There is a compile-time check and a unit test to make sure the Rust versions of these C definitions match the actual Rust type. If any reviewer knows of a better solution, please do tell.

### Dependency inversion issue

`std` depends on `panic_unwind` which depends on `libunwind`, and `libunwind` depends on `std`. This is not normally supported by Rust's linking system. Therefore we use raw C exports from `std` *and* `libunwind.a` is linked last in the target `post_link_objects` instead of being built as part of the Rust `libunwind`. Currently, all C exports are defined in `src/libstd/sys/sgx/rwlock.rs` to overcome LTO issues. Only the `__rust_rwlock_*` definitions *need* to live there for privacy reasons. Once again, if any reviewer knows of a better solution, please do tell.

r? @alexcrichton
2018-12-23 02:12:07 +08:00
kennytm
de2ba78dfe
Rollup merge of #56973 - RalfJung:miri-trace, r=oli-obk
make basic CTFE tracing available on release builds

Debugging things going wrong in miri is currently pretty much impossible with a nightly Rust.

r? @oli-obk
2018-12-23 02:12:05 +08:00
kennytm
22dfa2b44a
Rollup merge of #56970 - Firstyear:mem_uninit_doc_ptr_drop, r=Manishearth
Mem uninit doc ptr drop

Extend the mem::uninitialized documentation to account for partially initialized arrays and how to correctly handle these. These are used in some datastructures (trees for example) or in FFI.

r? @Manishearth
2018-12-23 02:12:03 +08:00
kennytm
1c76a2fd10
Rollup merge of #56967 - GuillaumeGomez:regen-search-index, r=QuietMisdreavus
Replace current crate's searchIndex when regenerating

Fixes #56921.

r? @QuietMisdreavus
2018-12-23 02:12:01 +08:00
kennytm
14ebca5c19
Rollup merge of #56941 - euclio:deny-libstd-resolution-failures, r=QuietMisdreavus
deny intra-doc link resolution failures in libstd

Fixes #56693.

Until we land a fix for the underlying issue (#56922), we can at least fix the failures in libstd so they don't propagate to downstream crates.
2018-12-23 02:11:59 +08:00
kennytm
314e61f37e
Rollup merge of #56936 - ubsan:euclidean_div_rem, r=dtolnay
rename div_euc -> div_euclid, and mod_euc -> rem_euclid

logic is written up in #49048

Also, update the documentation slightly.

cc @alexcrichton @clarcharr @varkor
2018-12-23 02:11:56 +08:00
kennytm
660eca64af
Rollup merge of #56933 - clarcharr:xpy_progress, r=Mark-Simulacrum
Add --progress to git submodule commands in x.py

This is a relatively new flag, but it means that git will indicate the progress of the update as it would with regular clones. This is especially helpful as some of the submodules are really big and it's difficult to tell if it's hanging or still updating.
2018-12-23 02:11:54 +08:00
kennytm
54d4e26b21
Rollup merge of #56919 - oli-obk:null_ref_array_tuple, r=RalfJung
Remove a wrong multiplier on relocation offset computation

r? @RalfJung

fixes #56800
2018-12-23 02:11:51 +08:00
kennytm
beaf071822
Rollup merge of #56914 - glaubitz:ignore-tests, r=alexcrichton
Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le

The test ui/target-feature-gate is not applicable on sparc, sparc64, powerpc, powerpc64 and powerpc64le and consequently fails there. So just ignore it on these targets.
2018-12-23 02:11:49 +08:00
kennytm
a92e21c215
Rollup merge of #56909 - dlrobertson:fix_56762, r=estebank
static eval: Do not ICE on layout size overflow

Layout size overflow and typeck eval errors are reported. Trigger a bug
only when the eval error is strictly labeled as TooGeneric.

Fixes: #56762
2018-12-23 02:11:47 +08:00
kennytm
2d6927e9ee
Rollup merge of #56802 - clarcharr:nth_back, r=alexcrichton
Add DoubleEndedIterator::nth_back

As suggested by #54054. This doesn't fix that issue, as this doesn't add enough implementations to optimise that specific use case, but it adds the method and a few (relatively) trivial overrides to work as an initial implementation.

It's probably going to be a lot of work adding `nth_back` implementations everywhere, and I don't have the time to include it all in this commit. But, it's a start. :)
2018-12-23 01:58:49 +08:00
David Wood
22b2bd8657
Update migrate warning wording.
This commit modifies the wording of the warning for
backwards-incompatible changes in migrate mode. The warning messages are
changed to be lowercase and not include line-breaks in order to be
consistent with other compiler diagnostics.
2018-12-22 14:54:30 +01:00
bors
9966590422 Auto merge of #56862 - arielb1:fundamentally-clean, r=nikomatsakis
stop treating trait objects from #[fundamental] traits as fundamental

This is a [breaking-change] to code that exploits this functionality (which should be limited to code using `#![feature(fundamental)]`.

Fixes #56503.

r? @nikomatsakis
2018-12-22 11:06:16 +00:00
bors
9689ada838 Auto merge of #56842 - scottmcm:vecdeque-rotate, r=alexcrichton
Add unstable VecDeque::rotate_{left|right}

Like the ones on slices, but more efficient because vecdeque is a circular buffer.

Issue that proposed this: https://github.com/rust-lang/rust/issues/56686

~~💣 Please someone look very carefully at the `unsafe` in this!  The `wrap_copy` seems to be exactly what this method needs, and the `len` passed to it is never more than half the length of the deque, but I haven't managed to prove to myself that it's correct 💣~~ I think I proved that this code meets the requirement of the unsafe code it's calling; please double-check, of course.
2018-12-22 07:16:11 +00:00
bors
24667aa19d Auto merge of #56824 - euclio:internal-apis, r=QuietMisdreavus
rustdoc: display rustc_private APIs as "Internal"

This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png)

After:

![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
2018-12-22 04:21:30 +00:00
bors
abaa9344d4 Auto merge of #56805 - mikeyhew:stabilize-pin-as-receiver, r=nikomatsakis
Stabilize `Rc`, `Arc` and `Pin` as method receivers

Replaces #55880
Closes  #55786
r? @nikomatsakis
cc @withoutboats @cramertj

This lets you write methods using `self: Rc<Self>`, `self: Arc<Self>`, `self: Pin<&mut Self>`, `self: Pin<Box<Self>`, and other combinations involving `Pin` and another stdlib receiver type, without needing the `arbitrary_self_types`. Other user-created receiver types can be used, but they still require the feature flag to use.

This is implemented by introducing a new trait, `Receiver`, which the method receiver's type must implement if the `arbitrary_self_types` feature is not enabled. To keep composed receiver types such as `&Arc<Self>` unstable, the receiver type is also required to implement `Deref<Target=Self>` when the feature flag is not enabled.

This lets you use `self: Rc<Self>` and `self: Arc<Self>` in stable Rust, which was not allowed previously. It was agreed that they would be stabilized in #55786. `self: Pin<&Self>` and other pinned receiver types do not require the `arbitrary_self_types` feature, but they cannot be used on stable because `Pin` still requires the `pin` feature.
2018-12-22 01:42:25 +00:00
bors
a9ff13562f Auto merge of #57033 - nikic:inhabitedness-perf, r=varkor
Remove "visited" set from inhabitedness checking (fix perf regression)

Now that references are no longer recursively checked, this should no longer be necessary, and it's a major performance bottleneck.

This should fix #57028.

r? @varkor
2018-12-21 23:00:55 +00:00
Mazdak Farrokhzad
0203a1cc31 exhaustive_integer_patterns slipped 1.32; stabilized in 1.33. 2018-12-21 21:27:04 +01:00
Mazdak Farrokhzad
34dc5c8980 macro_literal_matcher was stabilized in 1.32; not 1.32. 2018-12-21 21:25:32 +01:00
bors
e40548bc43 Auto merge of #56779 - adrian-budau:master, r=alexcrichton
On musl targets assume certain symbols exist (like pipe2 and accept4).

This fixes #56675.

I don't know if this is the best solution, or if I should also add some tests so I'm waiting for some feedback.

Thanks!
2018-12-21 20:08:11 +00:00
Ryan Marcus
51e4c1f320
Fixed typo in HashMap documentation
Previously "with a custom type as key", now "with a custom key type"
2018-12-21 14:50:25 -05:00
Taylor Cramer
e5e19d9608 Remove unstable-book repr-packed entry 2018-12-21 10:37:55 -08:00
Taylor Cramer
87c8cdd8ef Stabilize #[repr(packed(N))] 2018-12-21 10:18:38 -08:00
Adrian Budau
bf172c532a Properly report ENOSYS by modifying errno 2018-12-21 15:53:37 +02:00
Otavio Salvador
8c40aedb8f Fix feature gate to point to 1.32.0 for path_from_str
When the feature has been added back (#55148) the feature gate has not
been adjusted accordingly. We have it enabled for 1.32.0, currently in
Beta, so adjust it.

Refs: #44431.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-12-21 11:33:59 -02:00
John Kåre Alsaker
4f30a24e42 Inline tweaks 2018-12-21 12:09:43 +01:00
bors
01c6ea2f37 Auto merge of #56813 - oli-obk:main_🧶, r=pnkfelix
Always run rustc in a thread

cc @ishitatsuyuki @eddyb

r? @pnkfelix

[Previously](https://github.com/rust-lang/rust/pull/48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](https://github.com/rust-lang/rust/pull/48575#issuecomment-380635967) due to the way we use thread local storage.
2018-12-21 10:46:11 +00:00
Nikita Popov
a8babed8a3 Remove "visited" set from inhabitedness checking
Now that references are no longer recursively checked, this should
no longer be necessary, and it's a major performance bottleneck.
2018-12-21 11:44:05 +01:00
John Kåre Alsaker
edd08e020c Optimize away a move 2018-12-21 11:01:24 +01:00
bors
6d34ec18c7 Auto merge of #55798 - GuillaumeGomez:version-display-associated-const, r=QuietMisdreavus
Add version display for associated consts

Fixes #54030.

<img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png">

r? @QuietMisdreavus
2018-12-21 01:58:16 +00:00
bors
3f7c718926 Auto merge of #54125 - varkor:less-conservative-uninhabitedness-check, r=nikomatsakis
Less conservative uninhabitedness check

Extends the uninhabitedness check to structs, non-empty enums, tuples and arrays.

Pulled out of #47291 and #50262.

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

r? @nikomatsakis
2018-12-20 22:04:21 +00:00
bors
09d6ab90e5 Auto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk
Don't render const keyword on stable

Fixes #55246.

Continuation of #55327.

r? @oli-obk
2018-12-20 19:26:12 +00:00
varkor
0a8b696793 Remove nil-enum test 2018-12-20 19:24:16 +00:00
Andy Russell
8d393bf797
display rustc_private APIs as "Internal" 2018-12-20 13:47:39 -05:00
QuietMisdreavus
8dc8d7ac51 split extra_scripts to handle root_path shenanigans 2018-12-20 10:57:03 -06:00
QuietMisdreavus
0b0a00cc05 new --static-root-path flag for controlling static file locations 2018-12-20 10:18:45 -06:00
bors
9622f9dc47 Auto merge of #56647 - petrochenkov:dcrate2, r=alexcrichton
Rework treatment of `$crate` in procedural macros

Important clarification: `$crate` below means "processed `$crate`" or "output `$crate`". In the input of a decl macro `$crate` is just two separate tokens, but in the *output of a decl macro* `$crate` is a single keyword identifier (https://github.com/rust-lang/rust/issues/55640#issuecomment-435692791).

First of all, this PR removes the `eliminate_crate_var` hack.
`$crate::foo` is no longer replaced with `::foo` or `::crate_name::foo` in the input of derive proc macros, it's passed to the macro instead with its precise span and hygiene data, and can be treated as any other path segment keyword (like `crate` or `self`) after that. (Note: `eliminate_crate_var` was never used for non-derive proc macros.)

This creates an annoying problem - derive macros still may stringify their input before processing and expect `$crate` survive that stringification and refer to the same crate (the Rust 1.15-1.29 way of doing things).
Moreover, the input of proc macro attributes and derives (but not fn-like proc macros) also effectively survives stringification before being passed to the macro (also for legacy implementation reasons).

So we kind of resurrect the `eliminate_crate_var` hack in reduced form, but apply it only to AST pretty-printing.
If an AST fragment is pretty-printed, the resulting *text* will have `$crate` replaced with `crate` or `::crate_name`. This should be enough to keep all the legacy cases working.

Closes https://github.com/rust-lang/rust/issues/55640
Closes https://github.com/rust-lang/rust/issues/56622
r? @ghost
2018-12-20 12:42:54 +00:00