]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #68233 - danielframpton:update-compiler-builtins, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:59 +0000 (21:51 +0900)]
Rollup merge of #68233 - danielframpton:update-compiler-builtins, r=alexcrichton

Update compiler_builtins with changes to fix 128 bit integer remainder for aarch64 windows.

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:58 +0000 (21:51 +0900)]
Rollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichton

Better support for cross compilation on Windows.

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

Without the libpath changes we were trying to link a mix of amd64 and arm64 binaries.

Without the cmake system name change, the llvm build was trying to run an arm64 build tool on the x86_64 build machine.

That said, I haven't tested all different combinations here and am very open to resolving this a different way.

4 years agoRollup merge of #68230 - danielframpton:update-libssh2-sys, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:57 +0000 (21:51 +0900)]
Rollup merge of #68230 - danielframpton:update-libssh2-sys, r=alexcrichton

Update libssh2-sys to a version that can build for aarch64-pc-windows…

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68229 - danielframpton:update-iovec, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:55 +0000 (21:51 +0900)]
Rollup merge of #68229 - danielframpton:update-iovec, r=alexcrichton

Update iovec to a version with no winapi dependency

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68227 - danielframpton:update-cmake, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:54 +0000 (21:51 +0900)]
Rollup merge of #68227 - danielframpton:update-cmake, r=alexcrichton

Update to a version of cmake with windows arm64 support

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasper
Yuki Okushi [Wed, 15 Jan 2020 12:51:52 +0000 (21:51 +0900)]
Rollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasper

Avoid calling tcx.hir().get() on CRATE_HIR_ID

This was causing an ICE when enabling trace logging for an unrelated
module, since the arguments to `trace!` ended up getting evaluated

4 years agoRollup merge of #68222 - alexcrichton:update-wasi-libc, r=kennytm
Yuki Okushi [Wed, 15 Jan 2020 12:51:51 +0000 (21:51 +0900)]
Rollup merge of #68222 - alexcrichton:update-wasi-libc, r=kennytm

Update the wasi-libc bundled with libstd

4 years agoRollup merge of #68219 - oli-obk:fix_miri, r=RalfJung,wesleywiser
Yuki Okushi [Wed, 15 Jan 2020 12:51:50 +0000 (21:51 +0900)]
Rollup merge of #68219 - oli-obk:fix_miri, r=RalfJung,wesleywiser

Untangle ZST validation from integer validation and generalize it to all zsts

cc @RalfJung

r? @wesleywiser

4 years agoRollup merge of #68211 - GuillaumeGomez:add-failing-example-e0170, r=Dylan-DPC
Yuki Okushi [Wed, 15 Jan 2020 12:51:48 +0000 (21:51 +0900)]
Rollup merge of #68211 - GuillaumeGomez:add-failing-example-e0170, r=Dylan-DPC

Add failing example for E0170 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:45 +0000 (21:51 +0900)]
Rollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichton

use winapi for non-stdlib Windows bindings

4 years agoRollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk
Yuki Okushi [Wed, 15 Jan 2020 12:51:43 +0000 (21:51 +0900)]
Rollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk

Don't run const propagation on items with inconsistent bounds

Fixes #67696

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.

4 years agoRollup merge of #67784 - Mark-Simulacrum:residual-pad-integral, r=dtolnay
Yuki Okushi [Wed, 15 Jan 2020 12:51:42 +0000 (21:51 +0900)]
Rollup merge of #67784 - Mark-Simulacrum:residual-pad-integral, r=dtolnay

Reset Formatter flags on exit from pad_integral

This fixes a bug where after calling pad_integral with appropriate flags, the
fill and alignment flags would be set to '0' and 'Right' and left as such even
after exiting pad_integral, which meant that future calls on the same Formatter
would get incorrect flags reported.

This is quite difficult to observe in practice, as almost all formatting
implementations in practice don't call `Display::fmt` directly, but rather use
`write!` or a similar macro, which means that they cannot observe the effects of
the wrong flags (as `write!` creates a fresh Formatter instance). However, we
include a test case.

A manual check leads me to believe this is the only case where we failed to reset the flags appropriately, but I could have missed something.

4 years agoAdd tests
Oliver Scherer [Wed, 15 Jan 2020 09:30:26 +0000 (10:30 +0100)]
Add tests

4 years agoUpdate E0170.md
Dylan DPC [Wed, 15 Jan 2020 06:22:21 +0000 (11:52 +0530)]
Update E0170.md

4 years agoAuto merge of #66329 - ktrianta:mir-opt-unreachable-propagation, r=oli-obk
bors [Wed, 15 Jan 2020 05:01:10 +0000 (05:01 +0000)]
Auto merge of #66329 - ktrianta:mir-opt-unreachable-propagation, r=oli-obk

Add unreachable propagation mir optimization pass

@oli-obk suggested we create a MIR pass that optimizes away basic blocks that lead only to basic blocks with terminator kind **unreachable**. This is a first take on this, which we started with @gilescope at RustFest Impl Days.

The test currently fails when the compiled program runs (undefined behaviour). Is there a way to avoid running the compiled program?

4 years agoAuto merge of #68118 - skinny121:eager_lit_eval, r=varkor
bors [Wed, 15 Jan 2020 00:56:53 +0000 (00:56 +0000)]
Auto merge of #68118 - skinny121:eager_lit_eval, r=varkor

perf: Eagerly convert literals to consts

Previousely even literal constants were being converted to an `Unevaluted` constant for evaluation later. This seems unecessary as no more information is needed to be able to convert the literal to a mir constant.

Hopefully this will also minimise the performance impact of #67717, as far less constant evaluations are needed.

4 years agoAvoid calling tcx.hir().get() on CRATE_HIR_ID
Aaron Hill [Tue, 14 Jan 2020 19:26:35 +0000 (14:26 -0500)]
Avoid calling tcx.hir().get() on CRATE_HIR_ID

This was causing an ICE when enabling trace logging for an unrelated
module, since the arguments to `trace!` ended up getting evaluated

4 years agoUpdate to a version of compiler_builtins with changes for fixes remainder for aarch64...
Daniel Frampton [Tue, 14 Jan 2020 21:32:26 +0000 (13:32 -0800)]
Update to a version of compiler_builtins with changes for fixes remainder for aarch64 windows

4 years agoBetter support for cross compilation on Windows.
Daniel Frampton [Fri, 10 Jan 2020 17:11:32 +0000 (09:11 -0800)]
Better support for cross compilation on Windows.

4 years agoUpdate to a version of cmake with windows arm64 support
Daniel Frampton [Tue, 14 Jan 2020 19:56:51 +0000 (11:56 -0800)]
Update to a version of cmake with windows arm64 support

4 years agoUpdate iovec to a version with no winapi dependency
Daniel Frampton [Tue, 14 Jan 2020 19:52:46 +0000 (11:52 -0800)]
Update iovec to a version with no winapi dependency

4 years agoUpdate libssh2-sys to a version that can build for aarch64-pc-windows-msvc
Daniel Frampton [Tue, 14 Jan 2020 19:26:03 +0000 (11:26 -0800)]
Update libssh2-sys to a version that can build for aarch64-pc-windows-msvc

4 years agoUpdate the wasi-libc bundled with libstd
Alex Crichton [Tue, 14 Jan 2020 17:59:46 +0000 (09:59 -0800)]
Update the wasi-libc bundled with libstd

4 years agoFix normalizing 32bit symbol hash.
Ben Lewis [Tue, 14 Jan 2020 17:59:26 +0000 (06:59 +1300)]
Fix normalizing 32bit symbol hash.

4 years agoUntangle ZST validation from integer validation and generalize it to all zsts
Oliver Scherer [Mon, 13 Jan 2020 16:58:37 +0000 (17:58 +0100)]
Untangle ZST validation from integer validation and generalize it to all zsts

4 years agoAuto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichton
bors [Tue, 14 Jan 2020 15:29:43 +0000 (15:29 +0000)]
Auto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichton

Fix memory leak if C++ catches a Rust panic and discards it

If C++ catches a Rust panic using `catch (...)` and then chooses not to rethrow it, the `Box<dyn Any>` in the exception may be leaked. This PR fixes this by adding the necessary destructors to the exception object.

r? @Mark-Simulacrum

4 years agoAdd failing example for E0170 explanation
Guillaume Gomez [Tue, 14 Jan 2020 13:04:03 +0000 (14:04 +0100)]
Add failing example for E0170 explanation

4 years agoAuto merge of #67076 - mbrubeck:condvar, r=dtolnay
bors [Tue, 14 Jan 2020 10:34:43 +0000 (10:34 +0000)]
Auto merge of #67076 - mbrubeck:condvar, r=dtolnay

Stabilize Condvar::wait_while and wait_timeout_while (previously wait_until, wait_timeout_until)

Closes #47960.

4 years agoNormalize symbol hash in ui test for legacy symbol mangling, as it's dependent on the
Ben Lewis [Tue, 14 Jan 2020 07:41:14 +0000 (20:41 +1300)]
Normalize symbol hash in ui test for legacy symbol mangling, as it's dependent on the
number of bits within consts.

4 years agoAdd unreachable propagation mir optimization pass
Konstantinos Triantafyllou [Fri, 10 Jan 2020 19:15:16 +0000 (20:15 +0100)]
Add unreachable propagation mir optimization pass

4 years agoAuto merge of #68201 - JohnTitor:rollup-26e39gu, r=JohnTitor
bors [Tue, 14 Jan 2020 07:13:31 +0000 (07:13 +0000)]
Auto merge of #68201 - JohnTitor:rollup-26e39gu, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #67854 (Use `report_in_external_macro` for internal lints)
 - #67989 (rustdoc: Don't allow `#![feature(...)]` on stable or beta)
 - #68036 (libterm: parse extended terminfo format)
 - #68127 (Clarify the relationship between `extended` and `tools` in `config.toml`)
 - #68143 (Forbid elided lifetimes within const generic parameter types)
 - #68150 (Document behavior of set_nonblocking on UnixListener)
 - #68166 (rustdoc: HTML escape arrows on help popup)
 - #68176 (Clean up err codes)
 - #68179 (Remove unneeded scope)
 - #68188 (Tweak assertion note in format check)

Failed merges:

r? @ghost

4 years agoRollup merge of #68188 - JohnTitor:tweak-assertion-note, r=Mark-Simulacrum
Yuki Okushi [Tue, 14 Jan 2020 05:02:31 +0000 (14:02 +0900)]
Rollup merge of #68188 - JohnTitor:tweak-assertion-note, r=Mark-Simulacrum

Tweak assertion note in format check

It's informative to tell the existence of `--bless` flag if we're running `tidy`.

4 years agoRollup merge of #68179 - JohnTitor:nll-scope, r=varkor
Yuki Okushi [Tue, 14 Jan 2020 05:02:29 +0000 (14:02 +0900)]
Rollup merge of #68179 - JohnTitor:nll-scope, r=varkor

Remove unneeded scope

Now, we can remove this scope.

4 years agoRollup merge of #68176 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Yuki Okushi [Tue, 14 Jan 2020 05:02:28 +0000 (14:02 +0900)]
Rollup merge of #68176 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC

Clean up err codes

r? @Dylan-DPC

4 years agoRollup merge of #68166 - ollie27:rustdoc_help_escape, r=GuillaumeGomez
Yuki Okushi [Tue, 14 Jan 2020 05:02:26 +0000 (14:02 +0900)]
Rollup merge of #68166 - ollie27:rustdoc_help_escape, r=GuillaumeGomez

rustdoc: HTML escape arrows on help popup

r? @GuillaumeGomez

4 years agoRollup merge of #68150 - tillarnold:master, r=cramertj
Yuki Okushi [Tue, 14 Jan 2020 05:02:24 +0000 (14:02 +0900)]
Rollup merge of #68150 - tillarnold:master, r=cramertj

Document behavior of set_nonblocking on UnixListener

The description on `set_nonblocking` in `UnixListener` was rather brief so I adapted it to be more like the documentation of  `set_nonblocking` in `TcpListener`.

4 years agoRollup merge of #68143 - skinny121:const-param-type-elided-lifetime, r=petrochenkov
Yuki Okushi [Tue, 14 Jan 2020 05:02:23 +0000 (14:02 +0900)]
Rollup merge of #68143 - skinny121:const-param-type-elided-lifetime, r=petrochenkov

Forbid elided lifetimes within const generic parameter types

Disallows `fn foo<const T: &u32>()`, the lifetime must be explicitly given, i.e. `fn foo<const T: &'static u32>()`.

Fixes #67883

4 years agoRollup merge of #68127 - varkor:clarify-extended-option, r=alexcrichton
Yuki Okushi [Tue, 14 Jan 2020 05:02:21 +0000 (14:02 +0900)]
Rollup merge of #68127 - varkor:clarify-extended-option, r=alexcrichton

Clarify the relationship between `extended` and `tools` in `config.toml`

I.e. `tools` is only effective if `extended = true`. Alternatively, we could make `tools = []` by default and remove `extended` (although we'd want to list the possible options), but improving the description seems sufficient to solve the issue.

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

4 years agoRollup merge of #68036 - euclio:libterm-ncurses6-fix, r=KodrAus
Yuki Okushi [Tue, 14 Jan 2020 05:02:20 +0000 (14:02 +0900)]
Rollup merge of #68036 - euclio:libterm-ncurses6-fix, r=KodrAus

libterm: parse extended terminfo format

Fixes #45728.

Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions.

The ideal fix for this would be to migrate libtest to use `termcolor` (https://github.com/rust-lang/rust/issues/60349), but that's blocked for the foreseeable future.

4 years agoRollup merge of #67989 - ollie27:rustdoc_unstable, r=GuillaumeGomez
Yuki Okushi [Tue, 14 Jan 2020 05:02:18 +0000 (14:02 +0900)]
Rollup merge of #67989 - ollie27:rustdoc_unstable, r=GuillaumeGomez

rustdoc: Don't allow `#![feature(...)]` on stable or beta

Fixes #67647

r? @GuillaumeGomez

4 years agoRollup merge of #67854 - afnanenayet:afnan/report-external-macro-lints, r=petrochenkov
Yuki Okushi [Tue, 14 Jan 2020 05:02:16 +0000 (14:02 +0900)]
Rollup merge of #67854 - afnanenayet:afnan/report-external-macro-lints, r=petrochenkov

Use `report_in_external_macro` for internal lints

Add the option to report lints in external macros for rustc internal lints to resolve #66370

4 years agoTweak assertion note in fmt
Yuki Okushi [Mon, 13 Jan 2020 19:44:57 +0000 (04:44 +0900)]
Tweak assertion note in fmt

4 years agoAuto merge of #68183 - JohnTitor:clippy-up, r=JohnTitor
bors [Mon, 13 Jan 2020 20:56:44 +0000 (20:56 +0000)]
Auto merge of #68183 - JohnTitor:clippy-up, r=JohnTitor

Update Clippy

Fixes #68107

r? @ghost

4 years agoCode review changes and fix rustdoc test.
Ben Lewis [Sat, 11 Jan 2020 07:57:38 +0000 (20:57 +1300)]
Code review changes and fix rustdoc test.

4 years agoperf: eagerly convert literals to consts, this avoids creating loads on unevaluated...
Ben Lewis [Sat, 11 Jan 2020 02:22:36 +0000 (15:22 +1300)]
perf: eagerly convert literals to consts, this avoids creating loads on unevaluated consts
which requires a lot of unnecessary work to evaluate them further down the line.

4 years agoAuto merge of #68088 - oli-obk:fix_miri, r=RalfJung
bors [Mon, 13 Jan 2020 17:39:01 +0000 (17:39 +0000)]
Auto merge of #68088 - oli-obk:fix_miri, r=RalfJung

Don't try to force_ptr pointers to zsts

r? @RalfJung

cc @wesleywiser

This is required to fix miri after https://github.com/rust-lang/rust/pull/67501 broke it. The reason only miri sees this is that it uses validation on values during interpretation and not just on the final value of constants, which never contain such values.

4 years agoEarly abort validation of arrays of zsts because there is no data to be checked
Oliver Scherer [Mon, 13 Jan 2020 15:12:10 +0000 (16:12 +0100)]
Early abort validation of arrays of zsts because there is no data to be checked

4 years agoUpdate Clippy
Yuki Okushi [Mon, 13 Jan 2020 14:45:20 +0000 (23:45 +0900)]
Update Clippy

4 years agoClean up E0192 explanation
Guillaume Gomez [Mon, 13 Jan 2020 12:34:55 +0000 (13:34 +0100)]
Clean up E0192 explanation

4 years agoClean up E0191 explanation
Guillaume Gomez [Mon, 13 Jan 2020 12:32:32 +0000 (13:32 +0100)]
Clean up E0191 explanation

4 years agoRemove unneeded scope
Yuki Okushi [Mon, 13 Jan 2020 07:54:58 +0000 (16:54 +0900)]
Remove unneeded scope

4 years agoFix destructor in emcc.rs
Amanieu d'Antras [Mon, 13 Jan 2020 08:04:48 +0000 (08:04 +0000)]
Fix destructor in emcc.rs

4 years agoAuto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrum
bors [Mon, 13 Jan 2020 12:49:12 +0000 (12:49 +0000)]
Auto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrum

Error codes checkup and rustdoc test fix

This PR does a few things:

 * fix how rustdoc checks that an error code has been thrown (it only checked for "E0XXX" so if it appeared in the output because the file has it in its name or wherever, it passed the test, which was incorrect)
 * fix the failing code examples that weren't throwing the expected error code

4 years agoUse TraitQueryMode::Canonical when testing predicates in const prop
Aaron Hill [Mon, 13 Jan 2020 11:06:42 +0000 (06:06 -0500)]
Use TraitQueryMode::Canonical when testing predicates in const prop

4 years agoAdd "--emit=link"
Aaron Hill [Sat, 11 Jan 2020 19:17:42 +0000 (14:17 -0500)]
Add "--emit=link"

This avoids a strange linker error that we get with only "--emit=mir"
and "check-pass"

4 years agoConvert test to check-pass
Aaron Hill [Sat, 11 Jan 2020 18:20:09 +0000 (13:20 -0500)]
Convert test to check-pass

4 years agoFix typo
Aaron Hill [Tue, 7 Jan 2020 15:53:04 +0000 (10:53 -0500)]
Fix typo

4 years agoAdd additional regression test
Aaron Hill [Tue, 7 Jan 2020 15:01:52 +0000 (10:01 -0500)]
Add additional regression test

4 years agoDon't run const propagation on items with inconsistent bounds
Aaron Hill [Mon, 6 Jan 2020 03:32:53 +0000 (22:32 -0500)]
Don't run const propagation on items with inconsistent bounds

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.

4 years agoAuto merge of #68174 - JohnTitor:rollup-ix4amrj, r=JohnTitor
bors [Mon, 13 Jan 2020 08:20:49 +0000 (08:20 +0000)]
Auto merge of #68174 - JohnTitor:rollup-ix4amrj, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #67313 (Document more use cases of dataflow)
 - #67959 (rustdoc: improve stability mark arrows)
 - #68097 (Specify units for test timeout environment variables)
 - #68135 (restore some rustc_parse visibilities for rustfmt)
 - #68145 (Expose `context::CheckLintNameResult`)
 - #68156 (Fix crate paths in comments)
 - #68157 (Clean up E0186 explanation)
 - #68161 (Fix system call docs for time::Instant)

Failed merges:

r? @ghost

4 years agoRollup merge of #68161 - ruuda:fix-instant-docs, r=rkruppe
Yuki Okushi [Mon, 13 Jan 2020 07:44:24 +0000 (16:44 +0900)]
Rollup merge of #68161 - ruuda:fix-instant-docs, r=rkruppe

Fix system call docs for time::Instant

The link for UNIX was pointing to the Cloud ABI docs. It should have been pointing to the `clock_gettime` docs instead. A similar table is repeated in the docs for `SystemTime`, but there the UNIX entry was already correct.

`clock_gettime(CLOCK_MONOTONIC)` is the current implementation: https://github.com/rust-lang/rust/blob/3ebcfa1451cfedc13a07e6353d8ade9742dfdc2a/src/libstd/sys/unix/time.rs#L274
https://github.com/rust-lang/rust/blob/3ebcfa1451cfedc13a07e6353d8ade9742dfdc2a/src/libstd/sys/unix/time.rs#L348-L352

r? @steveklabnik

4 years agoRollup merge of #68157 - GuillaumeGomez:clean-up-e0186, r=Dylan-DPC
Yuki Okushi [Mon, 13 Jan 2020 07:44:23 +0000 (16:44 +0900)]
Rollup merge of #68157 - GuillaumeGomez:clean-up-e0186, r=Dylan-DPC

Clean up E0186 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68156 - JohnTitor:fix-path-in-doc, r=Dylan-DPC
Yuki Okushi [Mon, 13 Jan 2020 07:44:21 +0000 (16:44 +0900)]
Rollup merge of #68156 - JohnTitor:fix-path-in-doc, r=Dylan-DPC

Fix crate paths in comments

Tiny follow-up of #67806 and others

r? @Centril

4 years agoRollup merge of #68145 - JohnTitor:pub-check-lint-name-result, r=Centril
Yuki Okushi [Mon, 13 Jan 2020 07:44:20 +0000 (16:44 +0900)]
Rollup merge of #68145 - JohnTitor:pub-check-lint-name-result, r=Centril

Expose `context::CheckLintNameResult`

Clippy needs it

r? @Centril

4 years agoRollup merge of #68135 - calebcartwright:rustc-parse-visibilities, r=Centril
Yuki Okushi [Mon, 13 Jan 2020 07:44:18 +0000 (16:44 +0900)]
Rollup merge of #68135 - calebcartwright:rustc-parse-visibilities, r=Centril

restore some rustc_parse visibilities for rustfmt

In https://github.com/rust-lang/rust/pull/65495/commits/c189565edc5c9fc516170885b3a3061b936205fb some visibilities were reduced on the parse mod (which now resides in the rustc_parse crate) as part of some refactoring and splitting up of libsyntax. However, rustfmt needs access to a few of those items that are no longer visible.

This restores the visibility on those items rustfmt depends on.

https://github.com/rust-lang/rustfmt/issues/3903#issuecomment-563596269
https://github.com/rust-lang/rustfmt/issues/4009

cc @topecongiro

4 years agoRollup merge of #68097 - MikailBag:master, r=shepmaster
Yuki Okushi [Mon, 13 Jan 2020 07:44:17 +0000 (16:44 +0900)]
Rollup merge of #68097 - MikailBag:master, r=shepmaster

Specify units for test timeout environment variables

I think it is not obvious (I got it from reading libtest sources), so it is worth mentioning in docs.

4 years agoRollup merge of #67959 - liigo:patch-13, r=GuillaumeGomez
Yuki Okushi [Mon, 13 Jan 2020 07:44:15 +0000 (16:44 +0900)]
Rollup merge of #67959 - liigo:patch-13, r=GuillaumeGomez

rustdoc: improve stability mark arrows

### current

![old-stability-arrow](https://user-images.githubusercontent.com/346530/71863520-134d8b00-3138-11ea-86f9-a98068b3cff9.png)

### new

![new-stability-arrow](https://user-images.githubusercontent.com/346530/71863539-1b0d2f80-3138-11ea-843e-d79b9e5d9eec.png)

### new dark

![dark-stability-arrow](https://user-images.githubusercontent.com/346530/71863563-26f8f180-3138-11ea-9514-050e2c779f90.png)

4 years agoRollup merge of #67313 - oli-obk:document_all_the_t̶h̶i̶n̶g̶s̶dataflow, r=ecstatic...
Yuki Okushi [Mon, 13 Jan 2020 07:44:13 +0000 (16:44 +0900)]
Rollup merge of #67313 - oli-obk:document_all_the_t̶h̶i̶n̶g̶s̶dataflow, r=ecstatic-morse

Document more use cases of dataflow

r? @ecstatic-morse

4 years agoUse `report_in_external_macro` for internal lints
Afnan Enayet [Sat, 4 Jan 2020 01:27:14 +0000 (17:27 -0800)]
Use `report_in_external_macro` for internal lints

Add the option to report lints in external macros for rustc internal
lints

4 years agoAuto merge of #67900 - nikic:prepare-llvm-10, r=nagisa
bors [Mon, 13 Jan 2020 04:01:00 +0000 (04:01 +0000)]
Auto merge of #67900 - nikic:prepare-llvm-10, r=nagisa

Prepare for LLVM 10 upgrade

Split off from #67759, this just adds the necessary compatibility bits and updates codegen tests, without performing the actual LLVM upgrade.

r? @alexcrichton

4 years agoFix destructor return value in emcc.rs
Amanieu d'Antras [Mon, 13 Jan 2020 00:39:41 +0000 (00:39 +0000)]
Fix destructor return value in emcc.rs

4 years agorustdoc: HTML escape arrows on help popup
Oliver Middleton [Sun, 12 Jan 2020 23:37:47 +0000 (23:37 +0000)]
rustdoc: HTML escape arrows on help popup

4 years agoFix system call docs for time::Instant
Ruud van Asseldonk [Sun, 12 Jan 2020 20:24:31 +0000 (21:24 +0100)]
Fix system call docs for time::Instant

The link for UNIX was pointing to the Cloud ABI docs. It should have
been pointing to the clock_gettime docs instead. The table is repeated
in the docs for SystemTime, but there the UNIX entry was already correct.

4 years agoDon't include __rust_drop_panic when testing libstd
Amanieu d'Antras [Sun, 12 Jan 2020 16:59:44 +0000 (16:59 +0000)]
Don't include __rust_drop_panic when testing libstd

4 years agoClean up E0186 explanation
Guillaume Gomez [Sun, 12 Jan 2020 16:50:14 +0000 (17:50 +0100)]
Clean up E0186 explanation

4 years agoFix error codes explanation' code examples
Guillaume Gomez [Sat, 4 Jan 2020 00:41:25 +0000 (01:41 +0100)]
Fix error codes explanation' code examples

4 years agoFix crate paths in comments
Yuki Okushi [Sun, 12 Jan 2020 15:51:15 +0000 (00:51 +0900)]
Fix crate paths in comments

4 years agoAuto merge of #67831 - mati865:ci-images-upgrade, r=pietroalbini
bors [Sun, 12 Jan 2020 14:52:48 +0000 (14:52 +0000)]
Auto merge of #67831 - mati865:ci-images-upgrade, r=pietroalbini

ci: bump ubuntu 19.04 images to 19.10

Ubuntu 19.04 goes EOL this month.

4 years agoDocument behavior of set_nonblocking on UnixListener
Till Arnold [Sun, 12 Jan 2020 11:01:37 +0000 (12:01 +0100)]
Document behavior of set_nonblocking on UnixListener

4 years agoAuto merge of #67901 - matthewjasper:split-mir-build, r=nagisa
bors [Sun, 12 Jan 2020 09:44:55 +0000 (09:44 +0000)]
Auto merge of #67901 - matthewjasper:split-mir-build, r=nagisa

Split MIR building into its own crate

This moves `rustc_mir::{build, hair, lints}` to `rustc_mir_build`.
The new crate only has a `provide` function as it's public API.

Based on #67898

cc @Centril @rust-lang/compiler
r? @oli-obk

4 years agoSplit `rustc_mir::{build, hair, lints}` into their own crate
Matthew Jasper [Sun, 5 Jan 2020 15:46:44 +0000 (15:46 +0000)]
Split `rustc_mir::{build, hair, lints}` into their own crate

4 years agoUpdate test benchmark file
Ben Lewis [Sun, 12 Jan 2020 07:41:03 +0000 (20:41 +1300)]
Update test benchmark file

4 years agoExpose `context::CheckLintNameResult`
Yuki Okushi [Sun, 12 Jan 2020 06:25:41 +0000 (15:25 +0900)]
Expose `context::CheckLintNameResult`

Clippy needs it

4 years agoAdded comment about behaviour.
Ben Lewis [Sun, 12 Jan 2020 04:32:50 +0000 (17:32 +1300)]
Added comment about behaviour.

4 years agoForbid elided lifetimes within const generic parameter types.
Ben Lewis [Sun, 12 Jan 2020 02:55:12 +0000 (15:55 +1300)]
Forbid elided lifetimes within const generic parameter types.

4 years agoAuto merge of #68142 - Centril:rollup-dl232e9, r=Centril
bors [Sun, 12 Jan 2020 02:28:48 +0000 (02:28 +0000)]
Auto merge of #68142 - Centril:rollup-dl232e9, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #67494 (Constify more of alloc::Layout)
 - #67867 (Correctly check for opaque types in `assoc_ty_def`)
 - #67948 (Galloping search for binary_search_util)
 - #68045 (Move more of `rustc::lint` into `rustc_lint`)
 - #68089 (Unstabilize `Vec::remove_item`)
 - #68108 (Add suggestions when encountering chained comparisons)

Failed merges:

r? @ghost

4 years agoRollup merge of #68108 - varkor:chained-comparison-suggestions, r=Centril
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:28:02 +0000 (03:28 +0100)]
Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=Centril

Add suggestions when encountering chained comparisons

Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now.

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

4 years agoRollup merge of #68089 - lzutao:revert-remote_item, r=sfackler
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:28:00 +0000 (03:28 +0100)]
Rollup merge of #68089 - lzutao:revert-remote_item, r=sfackler

Unstabilize `Vec::remove_item`

As concerned by @kornelski, @LukasKalbertodt, and @gnzlbg in #40062.
Reverts #67727

4 years agoRollup merge of #68045 - Centril:liberate-lints, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:59 +0000 (03:27 +0100)]
Rollup merge of #68045 - Centril:liberate-lints, r=Mark-Simulacrum

Move more of `rustc::lint` into `rustc_lint`

Based on https://github.com/rust-lang/rust/pull/67806.

Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes:

- We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`.

- `in_derive_expansion` is, and needs to, be moved as a method on `Span`.

- We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined.

- `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133).

- `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints.

- `rustc::lint::context` is moved to `rustc_lint::context`.

- The visitors in `rustc::lint` are moved to `rustc_lint::passes`.

4 years agoRollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:57 +0000 (03:27 +0100)]
Rollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum

Galloping search for binary_search_util

This is unlikely to improve perf much unless for synthetic benchmarks, but I figure it likely won't hurt either.

4 years agoRollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:56 +0000 (03:27 +0100)]
Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk

Correctly check for opaque types in `assoc_ty_def`

Closes #67856

4 years agoRollup merge of #67494 - lukaslueg:const_alloc, r=oli-obk
Mazdak Farrokhzad [Sun, 12 Jan 2020 02:27:54 +0000 (03:27 +0100)]
Rollup merge of #67494 - lukaslueg:const_alloc, r=oli-obk

Constify more of alloc::Layout

Making more methods of `alloc::Layout` const would allow us to compute alignment/size information for arbitrary (sized) types at compile-time, including placing the information in associated constants. While `mem::size_of` and `mem::align_of` are already const and `Layout` is solely based on those, there is no guarantee in the implementation that a const derived from these functions will be exactly the same as what `Layout` uses and is subsequently used in a call to `alloc::alloc`. Constifying `Layout` makes this possible.

First contribution to core, excuse my ignorance.

4 years agouse winapi for non-stdlib Windows bindings
Andy Russell [Sat, 4 Jan 2020 21:46:47 +0000 (16:46 -0500)]
use winapi for non-stdlib Windows bindings

4 years agoGalloping search for binary_search_util
Andre Bogus [Mon, 6 Jan 2020 18:51:01 +0000 (19:51 +0100)]
Galloping search for binary_search_util

4 years agoAuto merge of #67458 - pnkfelix:fix-66530-by-propagating-fatal-error-from-worker...
bors [Sat, 11 Jan 2020 21:01:02 +0000 (21:01 +0000)]
Auto merge of #67458 - pnkfelix:fix-66530-by-propagating-fatal-error-from-worker, r=matthewjasper

When a codegen worker has a FatalError, propagate it instead of ICE'ing.

Fix #66530

4 years agoparse extended terminfo format
Andy Russell [Tue, 7 Jan 2020 19:32:37 +0000 (14:32 -0500)]
parse extended terminfo format

4 years agorestore some rustc_parse visibilities
Caleb Cartwright [Sat, 11 Jan 2020 19:19:57 +0000 (13:19 -0600)]
restore some rustc_parse visibilities

4 years agoConstify alloc::Layout
Lukas Lueg [Tue, 31 Dec 2019 23:25:20 +0000 (00:25 +0100)]
Constify alloc::Layout

Tracking issue #67521, Layout::new in #66254

4 years agoAuto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk
bors [Sat, 11 Jan 2020 14:46:17 +0000 (14:46 +0000)]
Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obk

Promote references to constants instead of statics

r? @oli-obk

4 years agoMake codegen tests wordsize independent
Oliver Scherer [Sat, 11 Jan 2020 13:40:07 +0000 (14:40 +0100)]
Make codegen tests wordsize independent