]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakis
bors [Sat, 1 Dec 2018 07:06:17 +0000 (07:06 +0000)]
Auto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakis

drop glue takes in mutable references, it should reflect that in its type

When drop glue begins, it should retag, like all functions taking references do. But to do that, it needs to take the reference at a proper type: `&mut T`, not `*mut T`.

Failing to retag can mean that the memory the reference points to remains frozen, and `EscapeToRaw` on a frozen location is a NOP, meaning later mutations cause a Stacked Borrows violation.

Cc @nikomatsakis @Gankro because Stacked Borrows
Cc @eddyb for the changes to miri argument passing (the intention is to allow passing `*mut [u8]` when `&mut [u8]` is expected and vice versa)

5 years agoAuto merge of #56391 - alexcrichton:less-compare-mode, r=Mark-Simulacrum
bors [Sat, 1 Dec 2018 03:04:12 +0000 (03:04 +0000)]
Auto merge of #56391 - alexcrichton:less-compare-mode, r=Mark-Simulacrum

ci: Only run compare-mode tests on one builder

The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.

5 years agoci: Only run compare-mode tests on one builder
Alex Crichton [Fri, 30 Nov 2018 22:31:04 +0000 (14:31 -0800)]
ci: Only run compare-mode tests on one builder

The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.

5 years agoAuto merge of #56381 - kennytm:rollup, r=kennytm
bors [Fri, 30 Nov 2018 19:24:17 +0000 (19:24 +0000)]
Auto merge of #56381 - kennytm:rollup, r=kennytm

Rollup of 19 pull requests

Successful merges:

 - #55011 (Add libstd Cargo feature "panic_immediate_abort")
 - #55821 (Use sort_by_cached_key when the key function is not trivial/free)
 - #56014 (add test for issue #21335)
 - #56131 (Assorted tweaks)
 - #56214 (Implement chalk unification routines)
 - #56216 (Add TryFrom<&[T]> for [T; $N] where T: Copy)
 - #56268 (Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.)
 - #56324 (Use raw_entry for more efficient interning)
 - #56336 (Clean up and streamline the pretty-printer)
 - #56337 (Fix const_fn ICE with non-const function pointer)
 - #56339 (Remove not used option)
 - #56341 (Rename conversion util; remove duplicate util in librustc_codegen_llvm.)
 - #56349 (rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker)
 - #56355 (Add inline attributes and add unit to CommonTypes)
 - #56360 (Optimize local linkchecker program)
 - #56364 (Fix panic with outlives in existential type)
 - #56365 (Stabilize self_struct_ctor feature.)
 - #56367 (Moved some feature gate tests to correct location)
 - #56373 (Update books)

5 years agoRollup merge of #56214 - scalexm:unification, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 18:31:12 +0000 (02:31 +0800)]
Rollup merge of #56214 - scalexm:unification, r=nikomatsakis

Implement chalk unification routines

`ResolventOps` and `AggregateOps` are mostly straightforwardly translated from chalk. I had caught a few bugs already in my `chalk` branch and backported fixes to this branch, but there may be other ones left. EDIT: I hope there are none left now :)

Fixes #54935.

5 years agoRollup merge of #56337 - phansch:fix_const_ice, r=oli-obk
kennytm [Fri, 30 Nov 2018 18:30:30 +0000 (02:30 +0800)]
Rollup merge of #56337 - phansch:fix_const_ice, r=oli-obk

Fix const_fn ICE with non-const function pointer

Fixes #56164

5 years agoRollup merge of #56324 - Zoxc:int-ext, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 18:29:45 +0000 (02:29 +0800)]
Rollup merge of #56324 - Zoxc:int-ext, r=nikomatsakis

Use raw_entry for more efficient interning

Fixes https://github.com/rust-lang/rust/issues/56308#issuecomment-442492744

5 years agoRollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichton
kennytm [Fri, 30 Nov 2018 18:25:46 +0000 (02:25 +0800)]
Rollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichton

Add libstd Cargo feature "panic_immediate_abort"

It stop asserts and panics from libstd to automatically
include string output and formatting code.

Use case: developing static executables smaller than 50 kilobytes,
where usual formatting code is excessive while keeping debuggability
in debug mode.

May resolve #54981.

5 years agoRollup merge of #56365 - alexreg:stabilise-self_struct_ctor, r=Centril
kennytm [Fri, 30 Nov 2018 17:57:34 +0000 (01:57 +0800)]
Rollup merge of #56365 - alexreg:stabilise-self_struct_ctor, r=Centril

Stabilize self_struct_ctor feature.

[**Tracking Issue**](https://github.com/rust-lang/rust/issues/51994)

5 years agoRollup merge of #56373 - steveklabnik:update-books, r=Mark-Simulacrum
kennytm [Fri, 30 Nov 2018 17:06:10 +0000 (01:06 +0800)]
Rollup merge of #56373 - steveklabnik:update-books, r=Mark-Simulacrum

Update books

This pulls in @Gankro 's final nomicon changes, and adds the edition guide as a submodule.

This is the final doc backport to beta for 1.31, as well.

5 years agoRollup merge of #56367 - alexreg:move-feature-gate-tests-1, r=Centril
kennytm [Fri, 30 Nov 2018 17:06:09 +0000 (01:06 +0800)]
Rollup merge of #56367 - alexreg:move-feature-gate-tests-1, r=Centril

Moved some feature gate tests to correct location

I evidently need to create some sort of GitHub monitor tool that yells at people when they do this in their PRs. ;-)

r? @centril

5 years agoRollup merge of #56364 - dlrobertson:fix_55903, r=oli-obk
kennytm [Fri, 30 Nov 2018 17:06:08 +0000 (01:06 +0800)]
Rollup merge of #56364 - dlrobertson:fix_55903, r=oli-obk

Fix panic with outlives in existential type

Don't panic in determining the privacy of a type if a lifetime outlives
generic exists in an existential type.

r? @oli-obk

Fixes: #55903
5 years agoRollup merge of #56360 - alexcrichton:linkchecker-omg, r=pietroalbini
kennytm [Fri, 30 Nov 2018 17:06:06 +0000 (01:06 +0800)]
Rollup merge of #56360 - alexcrichton:linkchecker-omg, r=pietroalbini

Optimize local linkchecker program

I noticed on a [recent build][1] that the linkchecker stage of CI took a
whopping 15 minutes of CI time for something that should be near
instantaneous. Some local profiling showed some very hot functions and
clones which were pretty easy to remove, and now instead of running in
minutes locally it runs in seconds.

[1]: https://ci.appveyor.com/project/rust-lang/rust/build/job/kptifw1kb1nm4xuu

5 years agoRollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister
kennytm [Fri, 30 Nov 2018 17:06:05 +0000 (01:06 +0800)]
Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister

Add inline attributes and add unit to CommonTypes

5 years agoRollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa
kennytm [Fri, 30 Nov 2018 17:06:02 +0000 (01:06 +0800)]
Rollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa

rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker

Part of #55396.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

r? @nagisa
cc @alexcrichton @japaric

5 years agoRollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrum
kennytm [Fri, 30 Nov 2018 17:06:01 +0000 (01:06 +0800)]
Rollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrum

Rename conversion util; remove duplicate util in librustc_codegen_llvm.

5 years agoRollup merge of #56339 - yui-knk:remove_mir_stats_flag, r=alexcrichton
kennytm [Fri, 30 Nov 2018 17:06:00 +0000 (01:06 +0800)]
Rollup merge of #56339 - yui-knk:remove_mir_stats_flag, r=alexcrichton

Remove not used option

`mir_stats` has not been used since 2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.

5 years agoRollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 17:05:59 +0000 (01:05 +0800)]
Rollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis

Clean up and streamline the pretty-printer

Some minor improvements.

5 years agoRollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov
kennytm [Fri, 30 Nov 2018 17:05:56 +0000 (01:05 +0800)]
Rollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov

Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.

This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.

5 years agoRollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboats
kennytm [Fri, 30 Nov 2018 17:05:54 +0000 (01:05 +0800)]
Rollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboats

Add TryFrom<&[T]> for [T; $N] where T: Copy

`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`.

Also add doc examples doing just that.

5 years agoRollup merge of #56131 - ljedrz:assorted, r=RalfJung
kennytm [Fri, 30 Nov 2018 17:05:51 +0000 (01:05 +0800)]
Rollup merge of #56131 - ljedrz:assorted, r=RalfJung

Assorted tweaks

- preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it)
- add a FIXME to `String::from_utf16`

r? @RalfJung

5 years agoRollup merge of #56014 - euclio:issue-21335, r=nagisa
kennytm [Fri, 30 Nov 2018 17:05:50 +0000 (01:05 +0800)]
Rollup merge of #56014 - euclio:issue-21335, r=nagisa

add test for issue #21335

Running this test with LLVM assertions enabled doesn't seem to trigger an assertion on my Mac.

Fixes #21335.

5 years agoRollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoerister
kennytm [Fri, 30 Nov 2018 17:05:48 +0000 (01:05 +0800)]
Rollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoerister

Use sort_by_cached_key when the key function is not trivial/free

I'm not 100% sure about `def_path_hash` (everything it does is inlined) but it seems like a good idea at least for the rest, as they are cloning.

5 years agoMoved feature-gate tests to correct dir.
Alexander Regueiro [Fri, 30 Nov 2018 15:48:01 +0000 (15:48 +0000)]
Moved feature-gate tests to correct dir.

5 years agoUpdated ui tests.
Alexander Regueiro [Fri, 30 Nov 2018 15:42:57 +0000 (15:42 +0000)]
Updated ui tests.

5 years agoRemoved feature gate.
Alexander Regueiro [Fri, 30 Nov 2018 02:57:30 +0000 (02:57 +0000)]
Removed feature gate.

5 years agoAdd the edition guide to doc.rust-lang.org
Steve Klabnik [Fri, 30 Nov 2018 14:36:49 +0000 (09:36 -0500)]
Add the edition guide to doc.rust-lang.org

5 years agoupdate nomicon
Steve Klabnik [Fri, 30 Nov 2018 14:29:36 +0000 (09:29 -0500)]
update nomicon

5 years agoPacify tidy
Philipp Hansch [Fri, 30 Nov 2018 07:45:15 +0000 (08:45 +0100)]
Pacify tidy

5 years agoFix const_fn ICE with non-const function pointer
Philipp Hansch [Fri, 30 Nov 2018 07:43:50 +0000 (08:43 +0100)]
Fix const_fn ICE with non-const function pointer

5 years agoInline things
John Kåre Alsaker [Thu, 29 Nov 2018 13:33:36 +0000 (14:33 +0100)]
Inline things

5 years agoAuto merge of #49219 - eddyb:proc-macro-decouple, r=alexcrichton
bors [Fri, 30 Nov 2018 06:44:14 +0000 (06:44 +0000)]
Auto merge of #49219 - eddyb:proc-macro-decouple, r=alexcrichton

Decouple proc_macro from the rest of the compiler.

This PR removes all dependencies of `proc_macro` on compiler crates and allows multiple copies of `proc_macro`, built even by different compilers (but from the same source), to interoperate.

Practically, it allows:
* running proc macro tests at stage1 (I moved most from `-fulldeps` to the regular suites)
* using proc macros in the compiler itself (may require some rustbuild trickery)

On the server (i.e. compiler front-end) side:
* `server::*` traits are implemented to provide the concrete types and methods
  * the concrete types are completely separated from the `proc_macro` public API
  * the only use of the type implementing `Server` is to be passed to `Client::run`

On the client (i.e. proc macro) side (potentially using a different `proc_macro` instance!):
* `client::Client` wraps around client-side (expansion) function pointers
  * it encapsulates the `proc_macro` instance used by the client
  * its `run` method can be called by a server, to execute the client-side function
    * the client instance is bridged to the provided server, while it runs
    * ~~currently a thread is spawned, could use process isolation in the future~~
(not the case anymore, see #56058)
* proc macro crates get a generated `static` holding a `&[ProcMacro]`
  * this describes all derives/attr/bang proc macros, replacing the "registrar" function
  * each variant of `ProcMacro` contains an appropriately typed `Client<fn(...) -> ...>`

`proc_macro` public APIs call into the server via an internal "bridge":
* only a currently running proc macro `Client` can interact with those APIs
  * server code might not be able to (if it uses a different `proc_macro` instance)
    * however, it can always create and `run` its own `Client`, but that may be inefficient
* the `bridge` uses serialization, C ABI and integer handles to avoid Rust ABI instability
* each invocation of a proc macro results in disjoint integers in its `proc_macro` handles
  * this prevents using values of those types across invocations (if they even can be kept)

r? @alexcrichton cc @jseyfried @nikomatsakis @Zoxc @thepowersgang

5 years agobootstrap: provide host `rust_test_helpers` to compiletest, not just target.
Eduard-Mihai Burtescu [Tue, 27 Nov 2018 13:40:40 +0000 (15:40 +0200)]
bootstrap: provide host `rust_test_helpers` to compiletest, not just target.

5 years agotests: ignore wasm32 for run-pass/proc-macro/expand-with-a-macro.
Eduard-Mihai Burtescu [Tue, 27 Nov 2018 02:42:20 +0000 (04:42 +0200)]
tests: ignore wasm32 for run-pass/proc-macro/expand-with-a-macro.

5 years agotests: use alloc instead of libc in unnecessary-extern-crate, to make it work on...
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 14:28:42 +0000 (16:28 +0200)]
tests: use alloc instead of libc in unnecessary-extern-crate, to make it work on wasm.

5 years agocompiletest: don't pass -Clinker when `// force-host` was requested.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 11:04:26 +0000 (13:04 +0200)]
compiletest: don't pass -Clinker when `// force-host` was requested.

5 years agotests: use a #![no_std] target crate in run-make/rustc-macro-dep-files.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 02:07:55 +0000 (04:07 +0200)]
tests: use a #![no_std] target crate in run-make/rustc-macro-dep-files.

5 years agobootstrap: don't use libraries from MUSL_ROOT on non-musl targets.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 12:08:06 +0000 (14:08 +0200)]
bootstrap: don't use libraries from MUSL_ROOT on non-musl targets.

5 years agotests: support cross-compilation in run-make/rustc-macro-dep-files.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 02:43:00 +0000 (04:43 +0200)]
tests: support cross-compilation in run-make/rustc-macro-dep-files.

5 years agobootstrap: ensure that `libproc_macro` is available on the host for tests even when...
Eduard-Mihai Burtescu [Wed, 16 May 2018 12:38:32 +0000 (15:38 +0300)]
bootstrap: ensure that `libproc_macro` is available on the host for tests even when cross-compiling.

5 years agotests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.
Eduard-Mihai Burtescu [Sat, 24 Nov 2018 13:34:13 +0000 (15:34 +0200)]
tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.

5 years agotests: move all proc_macro tests from -fulldeps.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 20:19:52 +0000 (22:19 +0200)]
tests: move all proc_macro tests from -fulldeps.

5 years agotests: remove ignore-stage1 where possible in proc_macro tests.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 18:20:03 +0000 (20:20 +0200)]
tests: remove ignore-stage1 where possible in proc_macro tests.

5 years agoStatically link proc_macro into proc macros.
Eduard-Mihai Burtescu [Thu, 26 Apr 2018 11:11:08 +0000 (14:11 +0300)]
Statically link proc_macro into proc macros.

5 years agoproc_macro: move to a dependency of libtest.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 18:43:33 +0000 (20:43 +0200)]
proc_macro: move to a dependency of libtest.

5 years agoproc_macro: move the rustc server to syntax_ext.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 14:41:14 +0000 (16:41 +0200)]
proc_macro: move the rustc server to syntax_ext.

5 years agoproc_macro: remove the __internal module.
Eduard-Mihai Burtescu [Mon, 19 Mar 2018 20:44:24 +0000 (22:44 +0200)]
proc_macro: remove the __internal module.

5 years agoproc_macro: introduce a "bridge" between clients (proc macros) and servers (compiler...
Eduard-Mihai Burtescu [Thu, 15 Mar 2018 23:09:22 +0000 (01:09 +0200)]
proc_macro: introduce a "bridge" between clients (proc macros) and servers (compiler front-ends).

5 years agoChanged test for issue 56202 to compile-pass.
Alexander Regueiro [Fri, 30 Nov 2018 02:55:22 +0000 (02:55 +0000)]
Changed test for issue 56202 to compile-pass.

5 years agoUse opt_def_id instead of having special branch
Esteban Küber [Sun, 25 Nov 2018 15:40:26 +0000 (07:40 -0800)]
Use opt_def_id instead of having special branch

5 years agoFix ICE with feature self_struct_ctor
Esteban Küber [Sun, 25 Nov 2018 01:12:28 +0000 (17:12 -0800)]
Fix ICE with feature self_struct_ctor

5 years agoFix panic with outlives in existential type
Dan Robertson [Fri, 30 Nov 2018 02:04:10 +0000 (02:04 +0000)]
Fix panic with outlives in existential type

Don't panic in determining the privacy of a type if a lifetime outlives
generic exists in an existential type.

5 years agoFix exceeding line width limit
Vitaly _Vi Shukela [Thu, 29 Nov 2018 23:37:04 +0000 (02:37 +0300)]
Fix exceeding line width limit

5 years agopanic_immediate_abort: Fix issues from review
Vitaly _Vi Shukela [Thu, 29 Nov 2018 23:17:05 +0000 (02:17 +0300)]
panic_immediate_abort: Fix issues from review

5 years agoOptimize local linkchecker program
Alex Crichton [Thu, 29 Nov 2018 23:02:06 +0000 (15:02 -0800)]
Optimize local linkchecker program

I noticed on a [recent build][1] that the linkchecker stage of CI took a
whopping 15 minutes of CI time for something that should be near
instantaneous. Some local profiling showed some very hot functions and
clones which were pretty easy to remove, and now instead of running in
minutes locally it runs in seconds.

[1]: https://ci.appveyor.com/project/rust-lang/rust/build/job/kptifw1kb1nm4xuu

5 years agoAdd libstd and libcore Cargo features "panic_immediate_abort"
Vitaly _Vi Shukela [Thu, 29 Nov 2018 21:06:10 +0000 (00:06 +0300)]
Add libstd and libcore Cargo features "panic_immediate_abort"

It stop asserts and panics from libstd to automatically
include string output and formatting code.

Use case: developing static executables smaller than 50 kilobytes,
where usual formatting code is excessive while keeping debuggability
in debug mode.

May resolve #54981.

5 years agoAdd inline attributes and add unit to CommonTypes
John Kåre Alsaker [Thu, 29 Nov 2018 20:13:04 +0000 (21:13 +0100)]
Add inline attributes and add unit to CommonTypes

5 years agoCorrectly generalize inference variables in `nll_relate`
scalexm [Thu, 29 Nov 2018 19:50:16 +0000 (20:50 +0100)]
Correctly generalize inference variables in `nll_relate`

5 years agoFix doc comments
scalexm [Thu, 29 Nov 2018 19:29:50 +0000 (20:29 +0100)]
Fix doc comments

5 years agoImplement `AggregateOps`
scalexm [Thu, 15 Nov 2018 19:05:36 +0000 (20:05 +0100)]
Implement `AggregateOps`
`make_solution` does not return any guidance for now

5 years agoImplement `ResolventOps`
scalexm [Fri, 9 Nov 2018 13:49:37 +0000 (14:49 +0100)]
Implement `ResolventOps`

5 years agoHandle inference variables in `nll_relate` and use it for chalk
scalexm [Tue, 6 Nov 2018 19:55:50 +0000 (20:55 +0100)]
Handle inference variables in `nll_relate` and use it for chalk

5 years agoOnly consider stem when extension is exe.
David Wood [Thu, 29 Nov 2018 19:40:43 +0000 (20:40 +0100)]
Only consider stem when extension is exe.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

5 years agoAuto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb
bors [Thu, 29 Nov 2018 19:28:21 +0000 (19:28 +0000)]
Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb

libcore: Add VaList and variadic arg handling intrinsics

## Summary

 - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`.
 - Add `core::va_list::VaList` to `libcore`.

Part 1 of (at least) 3 for #44930

Comments and critiques are very much welcomed 😄

5 years agoAuto merge of #56298 - tromey:update-and-reenable-lldb, r=alexcrichton
bors [Thu, 29 Nov 2018 15:24:20 +0000 (15:24 +0000)]
Auto merge of #56298 - tromey:update-and-reenable-lldb, r=alexcrichton

Re-enable lldb

Commit 7215963e56 disabled lldb due to the LLVM update.  This patch
updates lldb to build against the Rust LLVM, and re-enables it.

5 years agoUse raw_entry for more efficient interning
John Kåre Alsaker [Thu, 17 May 2018 03:19:08 +0000 (05:19 +0200)]
Use raw_entry for more efficient interning

5 years agoRename conversion util; remove duplicate util in librustc_codegen_llvm.
Corey Farwell [Thu, 29 Nov 2018 13:09:28 +0000 (08:09 -0500)]
Rename conversion util; remove duplicate util in librustc_codegen_llvm.

5 years agoAuto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 29 Nov 2018 12:23:05 +0000 (12:23 +0000)]
Auto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 22 pull requests

Successful merges:

 - #55391 (bootstrap: clean up a few clippy findings)
 - #56021 (avoid features_untracked)
 - #56023 (atomic::Ordering: Get rid of misleading parts of intro)
 - #56080 (Reduce the amount of bold text at doc.rlo)
 - #56114 (Enclose type in backticks for "non-exhaustive patterns" error)
 - #56124 (Fix small doc mistake on std::io::read::read_to_end)
 - #56127 (Update an outdated comment in mir building)
 - #56148 (Add rustc-guide as a submodule)
 - #56149 (Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer)
 - #56220 (Suggest appropriate place for lifetime when declared after type arguments)
 - #56223 (Make JSON output from -Zprofile-json valid)
 - #56236 (Remove unsafe `unsafe` inner function.)
 - #56255 (Update outdated code comments in StringReader)
 - #56257 (rustc-guide has moved to rust-lang/)
 - #56273 (Add missing doc link)
 - #56289 (Fix small typo in comment of thread::stack_size)
 - #56294 (Fix a typo in the documentation of std::ffi)
 - #56312 (Deduplicate literal -> constant lowering)
 - #56319 (fix futures creating aliasing mutable and shared ref)
 - #56321 (rustdoc: add bottom margin spacing to nested lists)
 - #56322 (resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`)
 - #56330 (Clean up span in non-trailing `..` suggestion)

Failed merges:

r? @ghost

5 years agoRollup merge of #56330 - estebank:cleanup-span, r=zackmdavis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:54 +0000 (13:10 +0100)]
Rollup merge of #56330 - estebank:cleanup-span, r=zackmdavis

Clean up span in non-trailing `..` suggestion

5 years agoRollup merge of #56322 - petrochenkov:edlints, r=eddyb
Guillaume Gomez [Thu, 29 Nov 2018 12:10:53 +0000 (13:10 +0100)]
Rollup merge of #56322 - petrochenkov:edlints, r=eddyb

resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`

Fixes https://github.com/rust-lang/rust/issues/56311 (stable-to-beta regression)

5 years agoRollup merge of #56321 - jnqnfe:css_nested_list_margin, r=GuillaumeGomez
Guillaume Gomez [Thu, 29 Nov 2018 12:10:52 +0000 (13:10 +0100)]
Rollup merge of #56321 - jnqnfe:css_nested_list_margin, r=GuillaumeGomez

rustdoc: add bottom margin spacing to nested lists

the current CSS for nested lists sets margin-bottom to zero, which means that a nested list is squished up against subsequent list items/paragraphs

this changes the bottom margin to .6em, same as for paragraphs

before:
![before](https://user-images.githubusercontent.com/33935229/49176291-699ba800-f342-11e8-9d33-c4acd4df2beb.png)
after:
![after](https://user-images.githubusercontent.com/33935229/49176299-6f918900-f342-11e8-90c3-aa14db195b45.png)

5 years agoRollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:50 +0000 (13:10 +0100)]
Rollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertj

fix futures creating aliasing mutable and shared ref

Fixes the problem described in https://github.com/solson/miri/issues/532#issuecomment-442552764: `set_task_waker` takes a shared reference and puts a copy into the TLS (in a `NonNull`), but `get_task_waker` gets it back out as a mutable reference. That violates "mutable references must not alias anything"!

5 years agoRollup merge of #56312 - oli-obk:const_eval_literal, r=eddyb
Guillaume Gomez [Thu, 29 Nov 2018 12:10:49 +0000 (13:10 +0100)]
Rollup merge of #56312 - oli-obk:const_eval_literal, r=eddyb

Deduplicate literal -> constant lowering

5 years agoRollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfackler
Guillaume Gomez [Thu, 29 Nov 2018 12:10:48 +0000 (13:10 +0100)]
Rollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfackler

Fix a typo in the documentation of std::ffi

5 years agoRollup merge of #56289 - marius:patch-1, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:46 +0000 (13:10 +0100)]
Rollup merge of #56289 - marius:patch-1, r=cramertj

Fix small typo in comment of thread::stack_size

5 years agoRollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, r=steveklabnik
Guillaume Gomez [Thu, 29 Nov 2018 12:10:45 +0000 (13:10 +0100)]
Rollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, r=steveklabnik

Add missing doc link

r? @steveklabnik

5 years agoRollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:44 +0000 (13:10 +0100)]
Rollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakis

rustc-guide has moved to rust-lang/

r? @nikomatsakis

5 years agoRollup merge of #56255 - jasonl:update-old-documents, r=michaelwoerister
Guillaume Gomez [Thu, 29 Nov 2018 12:10:43 +0000 (13:10 +0100)]
Rollup merge of #56255 - jasonl:update-old-documents, r=michaelwoerister

Update outdated code comments in StringReader

For the detection of newlines in the lexer, this is now done in `analyze_source_file.rs`.

5 years agoRollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:41 +0000 (13:10 +0100)]
Rollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertj

Remove unsafe `unsafe` inner function.

Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.

To address this issue, I removed that inner function.

5 years agoRollup merge of #56223 - Mark-Simulacrum:self-profile-json, r=wesleywiser
Guillaume Gomez [Thu, 29 Nov 2018 12:10:40 +0000 (13:10 +0100)]
Rollup merge of #56223 - Mark-Simulacrum:self-profile-json, r=wesleywiser

Make JSON output from -Zprofile-json valid

r? @wesleywiser

cc https://github.com/rust-lang-nursery/rustc-perf/issues/299

5 years agoRollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:39 +0000 (13:10 +0100)]
Rollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis

Suggest appropriate place for lifetime when declared after type arguments

5 years agoRollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:38 +0000 (13:10 +0100)]
Rollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNN

Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer

I was confused by this API so I clarified what they are doing.

I was wondering if I should try to unify more documentation and examples between `unix` and `linux` (e.g. “of the file” is used in `unix` to refer to the file these metadata is for, “of this file” in `linux`, “of the underlying file” in `std::fs::File`).

5 years agoRollup merge of #56148 - mark-i-m:rustc-guide-submodule, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:36 +0000 (13:10 +0100)]
Rollup merge of #56148 - mark-i-m:rustc-guide-submodule, r=nikomatsakis

Add rustc-guide as a submodule

Adding this as a submodule will allow two things:
- Linking to the guide from doc.rlo
- Doing a link check as part of the rust CI build

Key question: Do we want to wait for the book to be filled out more? e.g. do we ever want to move it out of the nursery?

r? @nikomatsakis

cc @steveklabnik

5 years agoRollup merge of #56127 - rust-lang:oli-obk-patch-1, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:35 +0000 (13:10 +0100)]
Rollup merge of #56127 - rust-lang:oli-obk-patch-1, r=nikomatsakis

Update an outdated comment in mir building

r? @eddyb

5 years agoRollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:34 +0000 (13:10 +0100)]
Rollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNN

Fix small doc mistake on std::io::read::read_to_end

The std::io::read main documentation can lead to error because the buffer is prefilled with 10 zeros that will pad the response.
Using an empty vector is better.

The `read_to_end` documentation is already correct though.

This is my first rust PR, don't hesitate to tell me if I did something wrong.

5 years agoRollup merge of #56114 - varkor:nonexhaustive-backticks, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:33 +0000 (13:10 +0100)]
Rollup merge of #56114 - varkor:nonexhaustive-backticks, r=nikomatsakis

Enclose type in backticks for "non-exhaustive patterns" error

This makes the error style consistent with the convention in error messages.

5 years agoRollup merge of #56080 - mark-i-m:patch-2, r=steveklabnik
Guillaume Gomez [Thu, 29 Nov 2018 12:10:31 +0000 (13:10 +0100)]
Rollup merge of #56080 - mark-i-m:patch-2, r=steveklabnik

Reduce the amount of bold text at doc.rlo

Currently, all of the text is either huge or small. IMHO this is hard to read, so I propose that we make the second-level headings smaller, without making them any less prominent.

# Before:

![image](https://user-images.githubusercontent.com/8827840/48737315-50447e80-ec13-11e8-8243-6211dbba1aa1.png)

# After:

![image](https://user-images.githubusercontent.com/8827840/48737258-32771980-ec13-11e8-814e-e7851954c05a.png)

5 years agoRollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepang
Guillaume Gomez [Thu, 29 Nov 2018 12:10:30 +0000 (13:10 +0100)]
Rollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepang

atomic::Ordering: Get rid of misleading parts of intro

Remove the parts of atomic::Ordering's intro that wrongly claimed that
SeqCst prevents all reorderings around it.

Closes #55196

This is a (minimal) alternative to #55233.

I also wonder if it would be worth adding at least some warnings that atomics are often a footgun/hard to use correctly, similarly like `mem::transmute` or other functions have.

5 years agoRollup merge of #56021 - RalfJung:track-features, r=oli-obk
Guillaume Gomez [Thu, 29 Nov 2018 12:10:28 +0000 (13:10 +0100)]
Rollup merge of #56021 - RalfJung:track-features, r=oli-obk

avoid features_untracked

The docs say to not use `features_untracked` when we have a tcx.

@oli-obk any particular reason why the untracked version is used all over const qualification?

5 years agoRollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:27 +0000 (13:10 +0100)]
Rollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=TimNN

bootstrap: clean up a few clippy findings

remove useless format!()s
remove redundant field names in a few struct initializations
pass slice instead of a vector to a function
use is_empty() instead of comparisons to .len()

No functional change intended.

5 years agoRemove not used option
yui-knk [Wed, 28 Nov 2018 23:44:44 +0000 (08:44 +0900)]
Remove not used option

`mir_stats` has not been used since 2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.

5 years agoAuto merge of #56313 - nikic:update-llvm, r=alexcrichton
bors [Thu, 29 Nov 2018 09:36:19 +0000 (09:36 +0000)]
Auto merge of #56313 - nikic:update-llvm, r=alexcrichton

Update LLVM

In particular this fixes #56265.

r? @alexcrichton

5 years agoAuto merge of #56245 - mark-i-m:stabilize_ques_kleene, r=alexcrichton
bors [Thu, 29 Nov 2018 06:44:12 +0000 (06:44 +0000)]
Auto merge of #56245 - mark-i-m:stabilize_ques_kleene, r=alexcrichton

Stabilize feature `macro_at_most_once_rep`

a.k.a. `?` Kleene operator :tada:

cc #48075

r? @Centril

5 years agoSplit up `pretty_print` and `print`.
Nicholas Nethercote [Thu, 29 Nov 2018 02:58:58 +0000 (13:58 +1100)]
Split up `pretty_print` and `print`.

`pretty_print` takes a `Token` and `match`es on it. But the particular
`Token` kind is known at each call site, so this commit splits it into
five functions: `pretty_print_eof`, `pretty_print_begin`, etc.

This commit also does likewise with `print`, though there is one
callsite for `print` where the `Token` kind isn't known, so a generic
`print` has to stay (but it now just calls out to the various `print_*`
functions).

5 years agoUse `Cow` in `Token::String`.
Nicholas Nethercote [Thu, 29 Nov 2018 00:36:58 +0000 (11:36 +1100)]
Use `Cow` in `Token::String`.

`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.

This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.

5 years agoRemove `huge_word` and `zero_word`.
Nicholas Nethercote [Wed, 28 Nov 2018 05:46:43 +0000 (16:46 +1100)]
Remove `huge_word` and `zero_word`.

They are unused. The commit also adds some blank lines between some
methods.

5 years agoFix whitespace in `pp.rs`.
Nicholas Nethercote [Wed, 28 Nov 2018 05:45:58 +0000 (16:45 +1100)]
Fix whitespace in `pp.rs`.

This commit converts some 2-space indents to 4-space indents.

5 years agoAuto merge of #56329 - eddyb:load-operand-overaligned, r=nikomatsakis
bors [Thu, 29 Nov 2018 02:56:24 +0000 (02:56 +0000)]
Auto merge of #56329 - eddyb:load-operand-overaligned, r=nikomatsakis

rustc_codegen_llvm: don't overalign loads of pair operands.

Counterpart to #56300, but for loads instead of stores.

5 years agoAuto merge of #56300 - nikic:issue-56267, r=eddyb
bors [Thu, 29 Nov 2018 00:06:20 +0000 (00:06 +0000)]
Auto merge of #56300 - nikic:issue-56267, r=eddyb

Fix alignment of stores to scalar pair

The alignment for the second element of a scalar pair is not the same as for the first element, make sure it is calculated correctly. This fixes #56267.

r? @eddyb

5 years agoClean up span in non-trailing `..` suggestion
Esteban Küber [Thu, 29 Nov 2018 00:05:02 +0000 (16:05 -0800)]
Clean up span in non-trailing `..` suggestion