]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:32 +0000 (13:29 +0100)]
Rollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum

rustc: Move jemalloc from rustc_driver to rustc

This commit moves jemalloc to just the rustc binary rather than the
rustc_driver shared library, enusring that it's only used for binaries
that opt-in to it like rustc rather than other binaries using
librustc_driver like rustdoc/rls/etc. This will hopefully address #56980

5 years agoRollup merge of #56985 - oli-obk:const_check_bounds, r=RalfJung
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:31 +0000 (13:29 +0100)]
Rollup merge of #56985 - oli-obk:const_check_bounds, r=RalfJung

Allow testing pointers for inboundedness while forbidding dangling pointers

r? @RalfJung

5 years agoRollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplett
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:30 +0000 (13:29 +0100)]
Rollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplett

Add `std::os::fortanix_sgx` module

This PR adds the `std::os::sgx` module to expose platform-specific APIs behind the `sgx_platform` feature gate.

Depends on https://github.com/rust-lang/rust/pull/56972 to be able to meaningfully build `std::os` documentation for non-standard targets.

Tracking issue: https://github.com/rust-lang/rust/issues/56975

5 years agoRollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:28 +0000 (13:29 +0100)]
Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister

bootstrap: Link LLVM as a dylib with ThinLTO

When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334

5 years agoRollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=Centril
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:27 +0000 (13:29 +0100)]
Rollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=Centril

Add missing link in docs

r? @steveklabnik

5 years agoRollup merge of #55470 - daniellimws:box-from-docs, r=Centril
Mazdak Farrokhzad [Mon, 24 Dec 2018 12:29:26 +0000 (13:29 +0100)]
Rollup merge of #55470 - daniellimws:box-from-docs, r=Centril

box: Add documentation for `From` impls

This is a part of #51430. A brief description of the behaviour and examples are added to the documentation.

I am not sure what sort of examples to put for the `From` for `Pin` as my [code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=97c908f44e41c9faeffec5b61d72a03e) doesn't even manage to compile using the nightly build.

Somehow I feel that I missed out something so do let me know if more information is needed in the documentation or any of the examples require change.

5 years agoAuto merge of #57087 - Centril:rollup, r=Centril
bors [Mon, 24 Dec 2018 07:26:19 +0000 (07:26 +0000)]
Auto merge of #57087 - Centril:rollup, r=Centril

Rollup of 14 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56342 (Improve docs for collecting into `Option`s)
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56939 (Pin stabilization)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57062 (Fix a comment)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)
 - #57078 (Ignore two tests on s390x)

Failed merges:

r? @ghost

5 years agoAuto merge of #57079 - matthiaskrgr:clippy, r=oli-obk
bors [Mon, 24 Dec 2018 03:41:25 +0000 (03:41 +0000)]
Auto merge of #57079 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from a416c5e0 to fc24fce7

Fixes clippy tool state

Changes:
````
FIXME > TODO
rustup https://github.com/rust-lang/rust/pull/56992
Document map_clone known problems #498
Remove header link
test: panic at map_unit_fn.rs:202 for map() without args
rm unused file map_unit_fn.stderr
panic at map_unit_fn.rs:202 for map() without args
Change contrib.md hierarchy, link to it from readme
Workaround rust-lang/rust#43081
Teach `suspicious_else_formatting` about `if .. {..} {..}`
Link to `rustc_driver` crate in plugin
mutex_atomic: Correct location of AtomicBool and friends
Update README local run command to specify syspath
Do not mark as_ref as useless if it's followed by a method call
Changes lint sugg to bitwise and operator `&`
Run update_lints after renaming
Rename lint to MODULE_NAME_REPETITIONS
Add renaming tests
Move renaming to the right place
Implements lint for order comparisons against bool
fix(module_name_repeat): Try to register renamed lint, not valid yet
Fix an endless loop in the tests.
Fix `implicit_return` false positives.
chore(moduel_name_repeat): Rename stutter lint to module_name_repeat to avoid ableist language
Make integration tests fail on 'E0463'
base tests: make sure cargo-clippy binary can be called directly
Revert "Merge pull request #3257 from o01eg/remove-sysroot"
````

r? @oli-obk

5 years agoRollup merge of #57078 - glaubitz:ignore-tests, r=nikic
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:15 +0000 (23:09 +0100)]
Rollup merge of #57078 - glaubitz:ignore-tests, r=nikic

Ignore two tests on s390x

Ignore two tests on s390x which don't make sense on s390x as they are x86-specific.

5 years agoRollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obk
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:14 +0000 (23:09 +0100)]
Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obk

Stabilize min_const_unsafe_fn in 1.33

Fixes #55607

r? @oli-obk

5 years agoRollup merge of #57062 - bjorn3:patch-1, r=varkor
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:13 +0000 (23:09 +0100)]
Rollup merge of #57062 - bjorn3:patch-1, r=varkor

Fix a comment

5 years agoRollup merge of #57053 - nikic:fix-gep-align, r=nagisa
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:12 +0000 (23:09 +0100)]
Rollup merge of #57053 - nikic:fix-gep-align, r=nagisa

Fix alignment for array indexing

We need to reduce the alignment with the used offset. If the offset isn't known, use the element size, as this will yield the minimum possible alignment.

This handles both direct array indexing, and array repeat expressions.

Fixes #56927.

r? @nagisa

5 years agoRollup merge of #57032 - RalfJung:alloc-bench-deprecations, r=Centril
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:10 +0000 (23:09 +0100)]
Rollup merge of #57032 - RalfJung:alloc-bench-deprecations, r=Centril

fix deprecation warnings in liballoc benches

5 years agoRollup merge of #57020 - estebank:return-span, r=zackmdavis
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:09 +0000 (23:09 +0100)]
Rollup merge of #57020 - estebank:return-span, r=zackmdavis

Point to cause of `fn` expected return type

Fix #48136.

5 years agoRollup merge of #56966 - varkor:raw-pointer-deref-parens, r=zackmdavis
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:08 +0000 (23:09 +0100)]
Rollup merge of #56966 - varkor:raw-pointer-deref-parens, r=zackmdavis

Correct strings for raw pointer deref and array access suggestions

Fixes https://github.com/rust-lang/rust/issues/56714.
Fixes https://github.com/rust-lang/rust/issues/56963.

r? @zackmdavis

5 years agoRollup merge of #56964 - nnethercote:TokenStream-IsJoint, r=petrochenkov
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:07 +0000 (23:09 +0100)]
Rollup merge of #56964 - nnethercote:TokenStream-IsJoint, r=petrochenkov

Remove `TokenStream::JointTree`.

This is done by adding a new `IsJoint` field to `TokenStream::Tree`,
which simplifies a lot of `match` statements. And likewise for
`CursorKind`.

The commit also adds a new method `TokenTree:stream()` which can replace
a choice between `.into()` and `.joint()`.

5 years agoRollup merge of #56953 - oli-obk:dead_const, r=petrochenkov
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:05 +0000 (23:09 +0100)]
Rollup merge of #56953 - oli-obk:dead_const, r=petrochenkov

Mark tuple structs as live if their constructors are used

fixes https://github.com/rust-lang/rust/issues/56281

5 years agoRollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:04 +0000 (23:09 +0100)]
Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton

Pin stabilization

This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items":
>  In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above).

Let's settle these last bits here and get this thing stabilized! :)

r? @alexcrichton
cc @withoutboats

5 years agoRollup merge of #56917 - sinkuu:mir_build_logicop, r=davidtwco
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:03 +0000 (23:09 +0100)]
Rollup merge of #56917 - sinkuu:mir_build_logicop, r=davidtwco

Simplify MIR generation for logical operations

Reduces one block and one branch from MIR generated for a logical operator.

5 years agoRollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwco
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:02 +0000 (23:09 +0100)]
Rollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwco

Fix mutable references in `static mut`

fixes #56903

5 years agoRollup merge of #56342 - killercup:collect-into-option-docs, r=bluss
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:09:00 +0000 (23:09 +0100)]
Rollup merge of #56342 - killercup:collect-into-option-docs, r=bluss

Improve docs for collecting into `Option`s

Changes the original example to use more idiomatic formatting as well
as `.checked_add`. Also adds a second example to show a case where the
`.collect` returns `None`.

5 years agoRollup merge of #56188 - zackmdavis:if_i_may_suggest, r=davidtwco
Mazdak Farrokhzad [Sun, 23 Dec 2018 22:08:59 +0000 (23:08 +0100)]
Rollup merge of #56188 - zackmdavis:if_i_may_suggest, r=davidtwco

enum type instead of variant suggestion unification

Fixes #56028.

Weirdly, we were deciding between a help note and a structured suggestion based on whether the import candidate span was a dummy—but we weren't using that span in any case! The dummy-ness of the span (which appears to be a matter of this-crate vs. other-crate definition) isn't the right criterion by which we should decide whether it's germane to mention that "there is an enum variant"; instead, let's use the someness of `def` (which is used as the `has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to stop returning the span and rename the function. By using `span_suggestions_`, we leverage the max-suggestions output limit already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps too informal); prefer the imperative.

In a second commit, we do some unprincipled special-casing to correct and beautify suggestions for `Option` and `Result` (where the existing code was being confused by their being reexported in the prelude).

r? @davidtwco

5 years agoImprove docs for collecting into `Option`s
Pascal Hertleif [Thu, 29 Nov 2018 13:12:40 +0000 (14:12 +0100)]
Improve docs for collecting into `Option`s

Changes the original example to use more idiomatic formatting as well
as `.checked_add`. Also adds a second example to show a case where the
`.collect` returns `None`.

5 years agosubmodules: update clippy from a416c5e0 to fc24fce7
Matthias Krüger [Sun, 23 Dec 2018 12:55:20 +0000 (13:55 +0100)]
submodules: update clippy from a416c5e0 to fc24fce7

Fixes clippy tool state

Changes:
````
FIXME > TODO
rustup https://github.com/rust-lang/rust/pull/56992
Document map_clone known problems #498
Remove header link
test: panic at map_unit_fn.rs:202 for map() without args
rm unused file map_unit_fn.stderr
panic at map_unit_fn.rs:202 for map() without args
Change contrib.md hierarchy, link to it from readme
Workaround rust-lang/rust#43081
Teach `suspicious_else_formatting` about `if .. {..} {..}`
Link to `rustc_driver` crate in plugin
mutex_atomic: Correct location of AtomicBool and friends
Update README local run command to specify syspath
Do not mark as_ref as useless if it's followed by a method call
Changes lint sugg to bitwise and operator `&`
Run update_lints after renaming
Rename lint to MODULE_NAME_REPETITIONS
Add renaming tests
Move renaming to the right place
Implements lint for order comparisons against bool
fix(module_name_repeat): Try to register renamed lint, not valid yet
Fix an endless loop in the tests.
Fix `implicit_return` false positives.
chore(moduel_name_repeat): Rename stutter lint to module_name_repeat to avoid ableist language
Make integration tests fail on 'E0463'
base tests: make sure cargo-clippy binary can be called directly
Revert "Merge pull request #3257 from o01eg/remove-sysroot"
````

5 years agotest: Ignore codegen/x86_mmx.rs on s390x
John Paul Adrian Glaubitz [Sun, 23 Dec 2018 12:32:03 +0000 (13:32 +0100)]
test: Ignore codegen/x86_mmx.rs on s390x

5 years agotest: Ignore ui/target-feature-gate on s390x
John Paul Adrian Glaubitz [Sun, 23 Dec 2018 12:29:40 +0000 (13:29 +0100)]
test: Ignore ui/target-feature-gate on s390x

5 years agostabilize min_const_unsafe_fn -- revert const-size_of-cycle changes
Mazdak Farrokhzad [Sat, 22 Dec 2018 20:06:32 +0000 (21:06 +0100)]
stabilize min_const_unsafe_fn -- revert const-size_of-cycle changes

5 years agostabilize min_const_unsafe_fn --bless tests.
Mazdak Farrokhzad [Sat, 22 Dec 2018 17:58:06 +0000 (18:58 +0100)]
stabilize min_const_unsafe_fn --bless tests.

5 years agostabilize min_const_unsafe_fn in 1.33.
Mazdak Farrokhzad [Sat, 22 Dec 2018 17:06:20 +0000 (18:06 +0100)]
stabilize min_const_unsafe_fn in 1.33.

5 years agoAuto merge of #56892 - alexcrichton:new-llvm, r=michaelwoerister
bors [Sun, 23 Dec 2018 06:56:10 +0000 (06:56 +0000)]
Auto merge of #56892 - alexcrichton:new-llvm, r=michaelwoerister

rustc: Update Clang used to build LLVM on Linux

This commit updates from LLVM 7.0.0 to git revisions of clang/llvm/lld
to build LLVM on our dist builders for Linux. The goal of this is to
fix #56849 by picking up a fix [1] in LLD.

Closes #56849

[1]: https://github.com/llvm-mirror/lld/commit/3be4e82db78b46a8ca349b2b799dec620a6f159f

5 years agoRemove dead code
Esteban Küber [Sun, 23 Dec 2018 03:20:13 +0000 (19:20 -0800)]
Remove dead code

5 years agoadjust enum type instead of variant suggestions for prelude enums
Zack M. Davis [Fri, 23 Nov 2018 20:57:03 +0000 (12:57 -0800)]
adjust enum type instead of variant suggestions for prelude enums

The present author regrets not thinking of a more eloquent way to do
this.

5 years agoenum type instead of variant suggestion unification
Zack M. Davis [Mon, 19 Nov 2018 06:21:38 +0000 (22:21 -0800)]
enum type instead of variant suggestion unification

Weirdly, we were deciding between a help note and a structured
suggestion based on whether the import candidate span was a dummy—but
we weren't using that span in any case! The dummy-ness of the span
(which appears to be a matter of this-crate vs. other-crate
definition) isn't the right criterion by which we should decide
whether it's germane to mention that "there is an enum variant";
instead, let's use the someness of `def` (which is used as the
`has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to
stop returning the span and rename the function. By using
`span_suggestions_`, we leverage the max-suggestions output limit
already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps
too informal); prefer the imperative.

5 years agoAuto merge of #57063 - kennytm:rollup, r=kennytm
bors [Sat, 22 Dec 2018 23:12:23 +0000 (23:12 +0000)]
Auto merge of #57063 - kennytm:rollup, r=kennytm

Rollup of 25 pull requests

Successful merges:

 - #56802 (Add DoubleEndedIterator::nth_back)
 - #56909 (static eval: Do not ICE on layout size overflow)
 - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)
 - #56919 (Remove a wrong multiplier on relocation offset computation)
 - #56933 (Add --progress to git submodule commands in x.py)
 - #56936 (rename div_euc -> div_euclid, and mod_euc -> rem_euclid)
 - #56941 (deny intra-doc link resolution failures in libstd)
 - #56945 (Fix rustdoc-js tests)
 - #56967 (Replace current crate's searchIndex when regenerating)
 - #56970 (Mem uninit doc ptr drop)
 - #56973 (make basic CTFE tracing available on release builds)
 - #56979 (Adding unwinding support for x86_64_fortanix_unknown_sgx target.)
 - #56981 (miri: allocation is infallible)
 - #56984 (A few tweaks to dropck_outlives)
 - #56989 (Fix compiletest `trim` deprecation warnings)
 - #56992 (suggest similar lint names for unknown lints)
 - #57002 (Stabilize Vec(Deque)::resize_with)
 - #57011 (rustdoc: add new CLI flag to load static files from a different location)
 - #57027 (Optimize away a move)
 - #57034 (Inline tweaks)
 - #57039 (Update migrate warning wording.)
 - #57040 (Fix feature gate to point to 1.32.0 for `path_from_str`)
 - #57049 (Stabilize #[repr(packed(N))])
 - #57050 (Fixed typo in HashMap documentation)
 - #57052 (Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher))

5 years agoAuto merge of #56887 - emilio:enum-field-reordering, r=eddyb
bors [Sat, 22 Dec 2018 20:35:30 +0000 (20:35 +0000)]
Auto merge of #56887 - emilio:enum-field-reordering, r=eddyb

Disable field reordering for repr(int).

This fixes the problem that the test in #56619 uncovers.

Closes #56619.

5 years agoRollup merge of #56945 - JohnHeitmann:rustdoc-js-tester-fix, r=GuillaumeGomez
kennytm [Sat, 22 Dec 2018 18:04:44 +0000 (02:04 +0800)]
Rollup merge of #56945 - JohnHeitmann:rustdoc-js-tester-fix, r=GuillaumeGomez

Fix rustdoc-js tests

Fixes rustdoc-js tests by teaching tester.js how to handle single-line js comments.

Also, added speculative support for template strings, and warnings for future debuggers.

5 years agoRollup merge of #57039 - davidtwco:migrate-warning-wording, r=pnkfelix
kennytm [Sat, 22 Dec 2018 18:04:13 +0000 (02:04 +0800)]
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.

5 years agoRollup merge of #57052 - Centril:fix-eip-stable-version, r=varkor
kennytm [Sat, 22 Dec 2018 16:08:03 +0000 (00:08 +0800)]
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

5 years agoRollup merge of #57050 - RyanMarcus:master, r=zackmdavis
kennytm [Sat, 22 Dec 2018 16:08:02 +0000 (00:08 +0800)]
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"

5 years agoRollup merge of #57049 - cramertj:repr-packed, r=Centril
kennytm [Sat, 22 Dec 2018 16:08:01 +0000 (00:08 +0800)]
Rollup merge of #57049 - cramertj:repr-packed, r=Centril

Stabilize #[repr(packed(N))]

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

5 years agoRollup merge of #57040 - otavio:topic/adjust-path_from_str-feature-gate, r=Centril
kennytm [Sat, 22 Dec 2018 16:08:00 +0000 (00:08 +0800)]
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>
5 years agoRollup merge of #57034 - Zoxc:query-perf8, r=michaelwoerister
kennytm [Sat, 22 Dec 2018 16:07:57 +0000 (00:07 +0800)]
Rollup merge of #57034 - Zoxc:query-perf8, r=michaelwoerister

Inline tweaks

r? @michaelwoerister

5 years agoRollup merge of #57027 - Zoxc:query-perf5, r=michaelwoerister
kennytm [Sat, 22 Dec 2018 16:07:56 +0000 (00:07 +0800)]
Rollup merge of #57027 - Zoxc:query-perf5, r=michaelwoerister

Optimize away a move

r? @michaelwoerister

5 years agoRollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomez
kennytm [Sat, 22 Dec 2018 16:07:55 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #57002 - scottmcm:stabilize-resize_with, r=rkruppe
kennytm [Sat, 22 Dec 2018 16:07:54 +0000 (00:07 +0800)]
Rollup merge of #57002 - scottmcm:stabilize-resize_with, r=rkruppe

Stabilize Vec(Deque)::resize_with

Closes #41758

5 years agoRollup merge of #56992 - euclio:unknown-lint-suggestion, r=oli-obk
kennytm [Sat, 22 Dec 2018 16:07:52 +0000 (00:07 +0800)]
Rollup merge of #56992 - euclio:unknown-lint-suggestion, r=oli-obk

suggest similar lint names for unknown lints

Fixes #54737.

5 years agoRollup merge of #56989 - phansch:fix_compiletest_trim_deprecations, r=Mark-Simulacrum
kennytm [Sat, 22 Dec 2018 16:07:50 +0000 (00:07 +0800)]
Rollup merge of #56989 - phansch:fix_compiletest_trim_deprecations, r=Mark-Simulacrum

Fix compiletest `trim` deprecation warnings

None

5 years agoRollup merge of #56984 - ljedrz:dropck_outlives_tweaks, r=oli-obk
kennytm [Sat, 22 Dec 2018 16:07:49 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #56981 - RalfJung:miri-infallible-alloc, r=oli-obk
kennytm [Sat, 22 Dec 2018 16:07:48 +0000 (00:07 +0800)]
Rollup merge of #56981 - RalfJung:miri-infallible-alloc, r=oli-obk

miri: allocation is infallible

5 years agoRollup merge of #56979 - VardhanThigle:Vardhan/rust-sgx-unwind-support, r=alexcrichton
kennytm [Sat, 22 Dec 2018 16:07:47 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #56973 - RalfJung:miri-trace, r=oli-obk
kennytm [Sat, 22 Dec 2018 16:07:46 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #56970 - Firstyear:mem_uninit_doc_ptr_drop, r=Manishearth
kennytm [Sat, 22 Dec 2018 16:07:44 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #56967 - GuillaumeGomez:regen-search-index, r=QuietMisdreavus
kennytm [Sat, 22 Dec 2018 16:07:43 +0000 (00:07 +0800)]
Rollup merge of #56967 - GuillaumeGomez:regen-search-index, r=QuietMisdreavus

Replace current crate's searchIndex when regenerating

Fixes #56921.

r? @QuietMisdreavus

5 years agoRollup merge of #56941 - euclio:deny-libstd-resolution-failures, r=QuietMisdreavus
kennytm [Sat, 22 Dec 2018 16:07:41 +0000 (00:07 +0800)]
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.

5 years agoRollup merge of #56936 - ubsan:euclidean_div_rem, r=dtolnay
kennytm [Sat, 22 Dec 2018 16:07:39 +0000 (00:07 +0800)]
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

5 years agoRollup merge of #56933 - clarcharr:xpy_progress, r=Mark-Simulacrum
kennytm [Sat, 22 Dec 2018 16:07:38 +0000 (00:07 +0800)]
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.

5 years agoRollup merge of #56919 - oli-obk:null_ref_array_tuple, r=RalfJung
kennytm [Sat, 22 Dec 2018 16:07:37 +0000 (00:07 +0800)]
Rollup merge of #56919 - oli-obk:null_ref_array_tuple, r=RalfJung

Remove a wrong multiplier on relocation offset computation

r? @RalfJung

fixes #56800

5 years agoRollup merge of #56914 - glaubitz:ignore-tests, r=alexcrichton
kennytm [Sat, 22 Dec 2018 16:07:35 +0000 (00:07 +0800)]
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.

5 years agoRollup merge of #56909 - dlrobertson:fix_56762, r=estebank
kennytm [Sat, 22 Dec 2018 16:07:34 +0000 (00:07 +0800)]
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
5 years agoRollup merge of #56802 - clarcharr:nth_back, r=alexcrichton
kennytm [Sat, 22 Dec 2018 16:07:30 +0000 (00:07 +0800)]
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. :)

5 years agoAuto merge of #56680 - vakaras:issue56280, r=nagisa
bors [Sat, 22 Dec 2018 17:46:11 +0000 (17:46 +0000)]
Auto merge of #56680 - vakaras:issue56280, r=nagisa

Use compiletest timestamp to check if the tests should be rerun.

An attempt to fix  #56280 by checking if timestamps of compile test files are older than the timestamp of the stamp file.

?r nagisa

5 years agoReintroduce the original `check_bounds_ptr` checks
Oliver Scherer [Thu, 20 Dec 2018 14:14:25 +0000 (15:14 +0100)]
Reintroduce the original `check_bounds_ptr` checks

5 years agoUpdate migrate warning wording.
David Wood [Fri, 21 Dec 2018 13:33:15 +0000 (14:33 +0100)]
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.

5 years agoAuto merge of #57060 - nikic:inhabit-perf-2, r=varkor
bors [Sat, 22 Dec 2018 13:49:10 +0000 (13:49 +0000)]
Auto merge of #57060 - nikic:inhabit-perf-2, r=varkor

Short-circuit DefIdForest::intersection()

If the forest is already empty, there is no point in intersecting further.

Also handle the first element separately, so we don't compute an unnecessary intersection between the full forest and the first element, which is always equal to the first element.

This is the second try at fixing #57028, as the previous attempt only recovered part of the regression. I checked locally that this drops time spent in ty::inhabitedness for syn-check a lot, though not to zero.

r? @varkor

5 years agoFix a comment
bjorn3 [Sat, 22 Dec 2018 13:39:45 +0000 (14:39 +0100)]
Fix a comment

5 years agoShort-circuit DefIdForest::intersection()
Nikita Popov [Sat, 22 Dec 2018 11:41:17 +0000 (12:41 +0100)]
Short-circuit DefIdForest::intersection()

If the forest is already empty, there is no point in intersecting
further.

Also handle the first element separately, so we don't compute an
unnecessary intersection between the full forest and the first
element, which is always equal to the first element.

5 years agoAuto merge of #56862 - arielb1:fundamentally-clean, r=nikomatsakis
bors [Sat, 22 Dec 2018 11:06:16 +0000 (11:06 +0000)]
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

5 years agoAuto merge of #56842 - scottmcm:vecdeque-rotate, r=alexcrichton
bors [Sat, 22 Dec 2018 07:16:11 +0000 (07:16 +0000)]
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

~~:bomb: 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 :bomb:~~ I think I proved that this code meets the requirement of the unsafe code it's calling; please double-check, of course.

5 years agoFix Unpin docs link
Taylor Cramer [Tue, 18 Dec 2018 22:23:24 +0000 (14:23 -0800)]
Fix Unpin docs link

5 years agoRename Box/Arc/Rc::pinned to ::pin
Taylor Cramer [Tue, 18 Dec 2018 18:25:02 +0000 (10:25 -0800)]
Rename Box/Arc/Rc::pinned to ::pin

5 years agoPin stabilization: fix doctests
Taylor Cramer [Tue, 18 Dec 2018 18:20:53 +0000 (10:20 -0800)]
Pin stabilization: fix doctests

5 years agoStabilize Pin
Taylor Cramer [Tue, 18 Dec 2018 02:14:07 +0000 (18:14 -0800)]
Stabilize Pin

5 years agoUpdate Pin API to match the one proposed for stabilization
Taylor Cramer [Tue, 18 Dec 2018 01:19:32 +0000 (17:19 -0800)]
Update Pin API to match the one proposed for stabilization

Remove pin::Unpin reexport and add Unpin to the prelude.
Change Pin associated functions to methods.
Rename get_mut_unchecked_ to get_unchecked_mut
Remove impl Unpin for Pin
Mark Pin repr(transparent)

5 years agoAuto merge of #56824 - euclio:internal-apis, r=QuietMisdreavus
bors [Sat, 22 Dec 2018 04:21:30 +0000 (04:21 +0000)]
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)

5 years agoAuto merge of #56805 - mikeyhew:stabilize-pin-as-receiver, r=nikomatsakis
bors [Sat, 22 Dec 2018 01:42:25 +0000 (01:42 +0000)]
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.

5 years agoAuto merge of #57033 - nikic:inhabitedness-perf, r=varkor
bors [Fri, 21 Dec 2018 23:00:55 +0000 (23:00 +0000)]
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

5 years agoFix alignment for array indexing
Nikita Popov [Fri, 21 Dec 2018 22:12:15 +0000 (23:12 +0100)]
Fix alignment for array indexing

We need to reduce the alignment with the used offset. If the offset
isn't known, we need to reduce with the element size to support
arbitrary offsets.

5 years agoexhaustive_integer_patterns slipped 1.32; stabilized in 1.33.
Mazdak Farrokhzad [Fri, 21 Dec 2018 20:27:04 +0000 (21:27 +0100)]
exhaustive_integer_patterns slipped 1.32; stabilized in 1.33.

5 years agomacro_literal_matcher was stabilized in 1.32; not 1.32.
Mazdak Farrokhzad [Fri, 21 Dec 2018 20:25:32 +0000 (21:25 +0100)]
macro_literal_matcher was stabilized in 1.32; not 1.32.

5 years agoAuto merge of #56779 - adrian-budau:master, r=alexcrichton
bors [Fri, 21 Dec 2018 20:08:11 +0000 (20:08 +0000)]
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!

5 years agoFixed typo in HashMap documentation
Ryan Marcus [Fri, 21 Dec 2018 19:50:25 +0000 (14:50 -0500)]
Fixed typo in HashMap documentation

Previously "with a custom type as key", now "with a custom key type"

5 years agoRemove unstable-book repr-packed entry
Taylor Cramer [Fri, 21 Dec 2018 18:37:55 +0000 (10:37 -0800)]
Remove unstable-book repr-packed entry

5 years agoStabilize #[repr(packed(N))]
Taylor Cramer [Fri, 21 Dec 2018 18:18:38 +0000 (10:18 -0800)]
Stabilize #[repr(packed(N))]

5 years agoProperly report ENOSYS by modifying errno
Adrian Budau [Fri, 21 Dec 2018 13:53:37 +0000 (15:53 +0200)]
Properly report ENOSYS by modifying errno

5 years agoFix feature gate to point to 1.32.0 for `path_from_str`
Otavio Salvador [Fri, 21 Dec 2018 13:33:59 +0000 (11:33 -0200)]
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>
5 years agoUpdate tests to changes on master
Oliver Scherer [Fri, 21 Dec 2018 12:39:45 +0000 (13:39 +0100)]
Update tests to changes on master

5 years agoInline tweaks
John Kåre Alsaker [Wed, 5 Dec 2018 17:59:48 +0000 (18:59 +0100)]
Inline tweaks

5 years agoAuto merge of #56813 - oli-obk:main_🧶, r=pnkfelix
bors [Fri, 21 Dec 2018 10:46:11 +0000 (10:46 +0000)]
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.

5 years agoRemove "visited" set from inhabitedness checking
Nikita Popov [Fri, 21 Dec 2018 10:44:05 +0000 (11:44 +0100)]
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.

5 years agofix deprecation warnings in liballoc benches
Ralf Jung [Fri, 21 Dec 2018 10:33:29 +0000 (11:33 +0100)]
fix deprecation warnings in liballoc benches

5 years agoAlso test projections
Oliver Scherer [Mon, 17 Dec 2018 13:36:10 +0000 (14:36 +0100)]
Also test projections

5 years agoFix a recently introduces regression
Oliver Scherer [Mon, 17 Dec 2018 13:20:42 +0000 (14:20 +0100)]
Fix a recently introduces regression

5 years agoOptimize away a move
John Kåre Alsaker [Thu, 6 Dec 2018 23:56:19 +0000 (00:56 +0100)]
Optimize away a move

5 years agoAuto merge of #55798 - GuillaumeGomez:version-display-associated-const, r=QuietMisdreavus
bors [Fri, 21 Dec 2018 01:58:16 +0000 (01:58 +0000)]
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

5 years agoPoint at coercion source on type errors for fn returning `impl Trait`
Esteban Küber [Fri, 21 Dec 2018 00:52:52 +0000 (16:52 -0800)]
Point at coercion source on type errors for fn returning `impl Trait`

5 years agoAuto merge of #54125 - varkor:less-conservative-uninhabitedness-check, r=nikomatsakis
bors [Thu, 20 Dec 2018 22:04:21 +0000 (22:04 +0000)]
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

5 years agoPoint to return span when writing `return;` on non-() fn
Esteban Küber [Thu, 20 Dec 2018 22:00:30 +0000 (14:00 -0800)]
Point to return span when writing `return;` on non-() fn

5 years agoAuto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk
bors [Thu, 20 Dec 2018 19:26:12 +0000 (19:26 +0000)]
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

5 years agoRemove nil-enum test
varkor [Thu, 20 Dec 2018 19:24:16 +0000 (19:24 +0000)]
Remove nil-enum test

5 years agodisplay rustc_private APIs as "Internal"
Andy Russell [Thu, 13 Dec 2018 03:51:04 +0000 (22:51 -0500)]
display rustc_private APIs as "Internal"