]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #68313 - batrla:master, r=alexcrichton
Mazdak Farrokhzad [Tue, 21 Jan 2020 18:42:22 +0000 (19:42 +0100)]
Rollup merge of #68313 - batrla:master, r=alexcrichton

Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD

Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and Solaris

See ip(4P) man page:
 IP_MULTICAST_TTL     Time  to live for multicast datagrams. This option
                      takes an unsigned character as  an  argument.  Its
                      value  is  the TTL that IP uses on outgoing multi-
                      cast datagrams. The default is 1.

 IP_MULTICAST_LOOP    Loopback for multicast datagrams. Normally  multi-
                      cast  datagrams  are  delivered  to members on the
                      sending  host  (or  sending  zone).  Setting   the
                      unsigned  character argument to 0 causes the oppo-
                      site behavior, meaning that  when  multiple  zones
                      are  present,  the  datagrams are delivered to all
                      zones except the sending zone.

https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html
https://man.openbsd.org/ip.4

4 years agoRollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obk
Mazdak Farrokhzad [Tue, 21 Jan 2020 18:42:20 +0000 (19:42 +0100)]
Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obk

Implement `?const` opt-out for trait bounds

For now, such bounds are treated exactly the same as unprefixed ones in all contexts. [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) does not specify whether such bounds are forbidden outside of `const` contexts, so they are allowed at the moment.

Prior to this PR, the constness of a trait bound/impl was stored in `TraitRef`. Now, the constness of an `impl` is stored in `ast::ItemKind::Impl` and the constness of a bound in `ast::TraitBoundModifer`. Additionally, constness of trait bounds is now stored in an additional field of `ty::Predicate::Trait`, and the combination of the constness of the item along with any `TraitBoundModifier` determines the constness of the bound in accordance with the RFC. Encoding the constness of impls at the `ty` level is left for a later PR.

After a discussion in \#wg-grammar on Discord, it was decided that the grammar should not encode the mutual exclusivity of trait bound modifiers. The grammar for trait bound modifiers remains `[?const] [?]`. To encode this, I add a dummy variant to `ast::TraitBoundModifier` that is used when the syntax `?const ?` appears. This variant causes an error in AST validation and disappears during HIR lowering.

cc #67794

r? @oli-obk

4 years agoRollup merge of #67686 - ssomers:keys_start_slasher, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 21 Jan 2020 18:42:17 +0000 (19:42 +0100)]
Rollup merge of #67686 - ssomers:keys_start_slasher, r=Mark-Simulacrum

Simplify NodeHeader by avoiding slices in BTreeMaps with shared roots

Simplify a complicated piece of code that creates slices of keys in node leaves.

4 years agoDo not use Cortex-M0 since Qemu is too old
Jonas Schievink [Tue, 21 Jan 2020 13:35:04 +0000 (14:35 +0100)]
Do not use Cortex-M0 since Qemu is too old

4 years agoCheck in lockfile
Jonas Schievink [Tue, 21 Jan 2020 10:37:02 +0000 (11:37 +0100)]
Check in lockfile

4 years agoUpdate dependencies
Jonas Schievink [Tue, 21 Jan 2020 10:12:17 +0000 (11:12 +0100)]
Update dependencies

This fixes a linkage issue that was fixed a while ago, and adds thumbv8
support.

4 years agoUse the right runners for all thumb targets
Jonas Schievink [Tue, 21 Jan 2020 10:11:28 +0000 (11:11 +0100)]
Use the right runners for all thumb targets

4 years agoAccount for run-make tests in `is_up_to_date`
Jonas Schievink [Mon, 13 Jan 2020 23:56:11 +0000 (00:56 +0100)]
Account for run-make tests in `is_up_to_date`

4 years agoFix thumb target CI
Jonas Schievink [Mon, 13 Jan 2020 23:42:19 +0000 (00:42 +0100)]
Fix thumb target CI

4 years agoTest try diagnostics for impl and trait methods
Philipp Gesang [Tue, 21 Jan 2020 20:51:13 +0000 (21:51 +0100)]
Test try diagnostics for impl and trait methods

Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
4 years agoUpdate cargo, books
Eric Huss [Tue, 21 Jan 2020 17:55:43 +0000 (09:55 -0800)]
Update cargo, books

4 years agoHandle methods in try diagnostic
Philipp Gesang [Tue, 21 Jan 2020 20:49:23 +0000 (21:49 +0100)]
Handle methods in try diagnostic

The diagnostic for diagnostic for methods and trait provided
methods would only show the empty string:

    error[E0277]: the `?` operator can only be used in  that returns `Result` or `Option` (or another type that implements `std::ops::Try`)

Handle the missing cases so it reads ``a method'' / ``an async
method'' / ``a trait method'' respectively.

Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
4 years agotypeck: remove redundant diverges check
Mazdak Farrokhzad [Tue, 21 Jan 2020 17:47:58 +0000 (18:47 +0100)]
typeck: remove redundant diverges check

4 years agotypeck: remove redundant diverges code
Mazdak Farrokhzad [Tue, 21 Jan 2020 17:24:25 +0000 (18:24 +0100)]
typeck: remove redundant diverges code

4 years agotypeck: use diverges.replace(..)
Mazdak Farrokhzad [Tue, 21 Jan 2020 16:37:11 +0000 (17:37 +0100)]
typeck: use diverges.replace(..)

4 years agofor now, do not build rust-std for the armv7a-none-eabihf target
Jorge Aparicio [Tue, 21 Jan 2020 16:18:37 +0000 (17:18 +0100)]
for now, do not build rust-std for the armv7a-none-eabihf target

it needs some upstream changes in the build script of the compiler-builtins
crate

4 years agolowering: cleanup some hofs
Mazdak Farrokhzad [Tue, 21 Jan 2020 16:04:43 +0000 (17:04 +0100)]
lowering: cleanup some hofs

4 years agoAuto merge of #65672 - ecstatic-morse:unified-dataflow-proto, r=pnkfelix
bors [Tue, 21 Jan 2020 15:29:18 +0000 (15:29 +0000)]
Auto merge of #65672 - ecstatic-morse:unified-dataflow-proto, r=pnkfelix

A single framework for gen-kill and generic dataflow problems

This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface.

r? @ghost

cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)

4 years agoDeclare unsafe functions that can no longer handle shared roots
Stein Somers [Tue, 21 Jan 2020 15:12:19 +0000 (16:12 +0100)]
Declare unsafe functions that can no longer handle shared roots

4 years agotidy: fix most clippy warnings
Matthias Krüger [Tue, 21 Jan 2020 14:33:17 +0000 (15:33 +0100)]
tidy: fix most clippy warnings

4 years agoAdd comment explaining `MaybeConstMaybe` lowering
Dylan MacKenzie [Tue, 21 Jan 2020 09:42:45 +0000 (01:42 -0800)]
Add comment explaining `MaybeConstMaybe` lowering

4 years agotrade in outdated comments for correct ones
Stein Somers [Tue, 21 Jan 2020 09:30:14 +0000 (10:30 +0100)]
trade in outdated comments for correct ones

4 years agoAuto merge of #68267 - estebank:lt-sugg, r=petrochenkov
bors [Tue, 21 Jan 2020 06:28:33 +0000 (06:28 +0000)]
Auto merge of #68267 - estebank:lt-sugg, r=petrochenkov

Tweak lifetime definition errors

Taking inspiration from the narrative in @fasterthanlime's https://fasterthanli.me/blog/2019/declarative-memory-management/, add suggestions to some lifetime definition errors.

4 years agoAuto merge of #68154 - ssomers:btreemap_navigation_benches, r=Mark-Simulacrum
bors [Tue, 21 Jan 2020 03:07:01 +0000 (03:07 +0000)]
Auto merge of #68154 - ssomers:btreemap_navigation_benches, r=Mark-Simulacrum

Add more BTreeMap/BTreeSet benchmarks regarding iteration

Serving #67073 or other developments

4 years agoMake `TooGeneric` error in WF checking a proper error
varkor [Mon, 20 Jan 2020 15:22:12 +0000 (15:22 +0000)]
Make `TooGeneric` error in WF checking a proper error

`TooGeneric` is encountered during WF checking when we cannot determine that a constant involving a generic parameter will always be evaluated successfully (rather than resulting in an error). In these cases, the burden of proof should be with the caller, so that we can avoid post-monomorphisation tim errors (which was the previous previous behaviour). This commit ensures that this situation produces a proper compiler error, rather than silently ignoring it or ICEing.

4 years agoMark __msan_keep_going as an exported symbol for LTO
Tomasz Miąsko [Tue, 21 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Mark __msan_keep_going as an exported symbol for LTO

4 years agoAuto merge of #68405 - JohnTitor:rollup-kj0x4za, r=JohnTitor
bors [Mon, 20 Jan 2020 23:35:50 +0000 (23:35 +0000)]
Auto merge of #68405 - JohnTitor:rollup-kj0x4za, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #67734 (Remove appendix from Apache license)
 - #67795 (Cleanup formatting code)
 - #68290 (Fix some tests failing in `--pass check` mode)
 - #68297 ( Filter and test predicates using `normalize_and_test_predicates` for const-prop)
 - #68302 (Fix #[track_caller] and function pointers)
 - #68339 (Add `riscv64gc-unknown-linux-gnu` into target list in build-manifest)
 - #68381 (Added minor clarification to specification of GlobalAlloc::realloc.)
 - #68397 (rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`s)

Failed merges:

r? @ghost

4 years agocheck_match: simplify check_arm
Mazdak Farrokhzad [Mon, 20 Jan 2020 21:23:07 +0000 (22:23 +0100)]
check_match: simplify check_arm

4 years agoRollup merge of #68397 - ollie27:rustdoc_async_unsafe, r=Centril
Yuki Okushi [Mon, 20 Jan 2020 22:32:50 +0000 (07:32 +0900)]
Rollup merge of #68397 - ollie27:rustdoc_async_unsafe, r=Centril

rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`s

The order was swapped in #61319 but rustdoc was never updated to match.

r? @GuillaumeGomez

4 years agoRollup merge of #68381 - mjp41:master, r=Dylan-DPC
Yuki Okushi [Mon, 20 Jan 2020 22:32:48 +0000 (07:32 +0900)]
Rollup merge of #68381 - mjp41:master, r=Dylan-DPC

Added minor clarification to specification of GlobalAlloc::realloc.

The specification of `realloc` is slightly unclear:

```
    /// * `layout` must be the same layout that was used
    ///   to allocate that block of memory,
```
https://github.com/rust-lang/rust/blob/master/src/libcore/alloc.rs#L541-L542

In the case of an `alloc` or `alloc_zeroed` this is fairly evidently the `layout` parameter passed into the original call.  In the case of a `realloc`, this I assume is `layout` modified to contain `new_size`.  However, I could not find this case specified in the documentation.  Thus technically in a sequence of calls to `realloc`, it would be valid to provide the second call to `realloc` the same `layout` as the first call to `realloc`, which is almost certainly not going to be handled correctly.

This PR attempts to clarify the specification.

4 years agoRollup merge of #68339 - msizanoen1:patch-1, r=pietroalbini
Yuki Okushi [Mon, 20 Jan 2020 22:32:47 +0000 (07:32 +0900)]
Rollup merge of #68339 - msizanoen1:patch-1, r=pietroalbini

Add `riscv64gc-unknown-linux-gnu` into target list in build-manifest

Missed in #68037

r? @alexcrichton

4 years agoRollup merge of #68302 - anp:caller-fn-ptr, r=eddyb,oli-obk
Yuki Okushi [Mon, 20 Jan 2020 22:32:45 +0000 (07:32 +0900)]
Rollup merge of #68302 - anp:caller-fn-ptr, r=eddyb,oli-obk

Fix #[track_caller] and function pointers

Starting with failing tests, fix the miscompilation and ICE caused by `ReifyShim` bug.

Fixes #68178.

4 years agoRollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obk
Yuki Okushi [Mon, 20 Jan 2020 22:32:44 +0000 (07:32 +0900)]
Rollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obk

 Filter and test predicates using `normalize_and_test_predicates` for const-prop

Fixes #68264

Previously, I attempted to use
`substitute_normalize_and_test_predicates` to detect unsatisfiable
bounds. Unfortunately, since const-prop runs in a generic environment
(we don't have any of the function's generic parameters substituted),
this could lead to cycle errors when attempting to normalize predicates.

This check is replaced with a more precise check. We now only call
`normalize_and_test_predicates` on predicates that have the possibility
of being proved unsatisfiable - that is, predicates that don't depend
on anything local to the function (e.g. generic parameters). This
ensures that we don't hit cycle errors when we normalize said
predicates, while still ensuring that we detect unsatisfiable
predicates.

I haven't been able to come up with a minimization of the Diesel issue - however, I've verified that it compiles successfully.

4 years agoRollup merge of #68290 - petrochenkov:passcheck, r=oli-obk
Yuki Okushi [Mon, 20 Jan 2020 22:32:42 +0000 (07:32 +0900)]
Rollup merge of #68290 - petrochenkov:passcheck, r=oli-obk

Fix some tests failing in `--pass check` mode

Warnings reported at codegen or linking time either have to be converted to errors (preferable), or the tests for them need to be marked with `// ignore-pass` (as a last resort).

https://github.com/rust-lang/rust/commit/ecd5852194f43511443f134aebf0462b58c8e197 turned them from errors to warnings, but that shouldn't be necessary because it's still clear from the `.stderr` output that the errors are lints and not hard-coded.

4 years agoRollup merge of #67795 - Mark-Simulacrum:fmt-argument, r=dtolnay
Yuki Okushi [Mon, 20 Jan 2020 22:32:40 +0000 (07:32 +0900)]
Rollup merge of #67795 - Mark-Simulacrum:fmt-argument, r=dtolnay

Cleanup formatting code

This removes a few leftover positional enum variants that were no longer used.

All details that are changed are unstable (and `#[doc(hidden)]`), so this should
not impact downstream code.

4 years agoRollup merge of #67734 - XAMPPRocky:master, r=skade
Yuki Okushi [Mon, 20 Jan 2020 22:32:39 +0000 (07:32 +0900)]
Rollup merge of #67734 - XAMPPRocky:master, r=skade

Remove appendix from Apache license

Looking at the codebase I noticed an oddity, in that the appendix of how use the Apache licence is still contained in the licence file. We don't put licence headers at the top of all of our files so I don't think we need to keep this. Alternatively we could delete everything above line 191 to have a shorter licence file.

4 years agoMark __msan_track_origins as an exported symbol for LTO
Nikita Popov [Sun, 19 Jan 2020 21:08:15 +0000 (22:08 +0100)]
Mark __msan_track_origins as an exported symbol for LTO

4 years agoCorrect rmeta/rlib test
Mark Rousskov [Mon, 20 Jan 2020 20:35:43 +0000 (15:35 -0500)]
Correct rmeta/rlib test

4 years agoRead metadata from rmeta exclusively, if possible
Mark Rousskov [Sat, 18 Jan 2020 19:08:11 +0000 (14:08 -0500)]
Read metadata from rmeta exclusively, if possible

When we're producing an rlib, we do not need anything more than an rmeta file
for each of our dependencies (this is indeed utilized by Cargo for pipelining).
Previously, we were still storing the paths of possible rlib/dylib crates, which
meant that they could still plausibly be accessed. With -Zbinary-dep-depinfo,
that meant that Cargo thought that rustc was using both the rlib and an (earlier
emitted) rmeta, and so needed a recompile, as the rlib may have finished writing
*after* compilation started (for more detail, see issue 68149).

This commit changes metadata loading to not store the filepaths of dylib/rlib if
we're going to end up creating an rlib only.

4 years agoAuto merge of #68066 - CAD97:stabilize-manuallydrop-take, r=Amanieu,Mark-Simulacrum
bors [Mon, 20 Jan 2020 20:11:20 +0000 (20:11 +0000)]
Auto merge of #68066 - CAD97:stabilize-manuallydrop-take, r=Amanieu,Mark-Simulacrum

Stabilize ManuallyDrop::take

Tracking issue: closes #55422
FCP merge: https://github.com/rust-lang/rust/issues/55422#issuecomment-572653619

Reclaims the doc improvements from closed #62198.

-----

Stable version is a simple change if necessary.

Proposal: [relnotes] (this changes how to best take advantage of `ManuallyDrop`, esp. wrt. `Drop::drop` and finalize-by-value members)

4 years agoAdd aliases attribute check
Guillaume Gomez [Mon, 20 Jan 2020 19:42:52 +0000 (20:42 +0100)]
Add aliases attribute check

4 years agocheck_match: unify some lowering code and fix some ICEs
Mazdak Farrokhzad [Mon, 20 Jan 2020 18:46:06 +0000 (19:46 +0100)]
check_match: unify some lowering code and fix some ICEs

4 years agorefactor fix using cfg_if! (fix build on Solaris)
Vita Batrla [Mon, 20 Jan 2020 18:15:37 +0000 (19:15 +0100)]
refactor fix using cfg_if! (fix build on Solaris)

4 years agorustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`s
Oliver Middleton [Mon, 20 Jan 2020 18:14:51 +0000 (18:14 +0000)]
rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`s

4 years agoFix UI test
Mark Rousskov [Mon, 20 Jan 2020 17:17:12 +0000 (12:17 -0500)]
Fix UI test

fmt::Formatter is still not Send/Sync, but the UI test emitted two errors, for
the dyn Write and the Void inside Formatter. As of this PR, the Void is now
gone, but the dyn Write remains.

4 years agogeneralize bindings_with_variant_name lint
Mazdak Farrokhzad [Mon, 20 Jan 2020 16:57:08 +0000 (17:57 +0100)]
generalize bindings_with_variant_name lint

4 years agoDrop args from Formatter
Mark Rousskov [Wed, 1 Jan 2020 19:09:50 +0000 (14:09 -0500)]
Drop args from Formatter

These are no longer used by Formatter methods.

4 years agoMove run/getcount to functions
Mark Rousskov [Wed, 1 Jan 2020 18:58:57 +0000 (13:58 -0500)]
Move run/getcount to functions

These are only called from one place and don't generally support being called
from other places; furthermore, they're the only formatter functions that look
at the `args` field (which a future commit will remove).

4 years agoDelete unused "next" variants from formatting infrastructure
Mark Rousskov [Wed, 1 Jan 2020 18:14:33 +0000 (13:14 -0500)]
Delete unused "next" variants from formatting infrastructure

The formatting infrastructure stopped emitting these a while back, and in
removing them we can simplify related code.

4 years agocompiletest: Simplify multi-debugger support
Tomasz Miąsko [Mon, 20 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Simplify multi-debugger support

Previous implementation used a single mode type to store various pieces
of otherwise loosely related information:

* Whether debuginfo mode is in use or not.
* Which debuggers should run in general.
* Which debuggers are enabled for particular test case.

The new implementation introduces a separation between those aspects.
There is a single debuginfo mode parametrized by a debugger type.
The debugger detection is performed first and a separate configuration
is created for each detected debugger. The test cases are gathered
independently for each debugger which makes it trivial to implement
support for `ignore` / `only` conditions.

Functional changes:

* A single `debuginfo` entry point (rather than `debuginfo-cdb`, `debuginfo-gdb+lldb`, etc.).
* Debugger name is included in the test name.
* Test outputs are placed in per-debugger directory.
* Fixed spurious hash mismatch. Previously, the config mode would change
  from `DebugInfoGdbLldb` (when collecting tests) to `DebugInfoGdb` or
  `DebugInfoLldb` (when running them) which would affect hash computation.
* PYTHONPATH is additionally included in gdb hash.
* lldb-python and lldb-python-dir are additionally included in lldb hash.

4 years agoAuto merge of #68277 - michaelwoerister:re-export-dylib-instances, r=alexcrichton
bors [Mon, 20 Jan 2020 13:37:03 +0000 (13:37 +0000)]
Auto merge of #68277 - michaelwoerister:re-export-dylib-instances, r=alexcrichton

Make sure that all upstream generics get re-exported from Rust dylibs.

This PR contains a fix for #67276. Rust dylibs would not re-export all generic instances when compiling with `-Zshare-generics=on` (=default for debug builds) which could lead to situations where the compiler expected certain generic instances to be available but then the linker would not find them.

### TODO
- [x] Write a regression test based on the description [here](https://github.com/rust-lang/rust/issues/67276#issuecomment-574613457).
- [x] Find out if this also fixes other issues related to https://github.com/rust-lang/rust/issues/64319.

r? @alexcrichton ~~(once the TODOs are done)~~
cc @pnkfelix @AlexKornitzer

4 years agoRemove usage of global variable "inlined_types"
Guillaume Gomez [Mon, 13 Jan 2020 22:28:34 +0000 (23:28 +0100)]
Remove usage of global variable "inlined_types"

4 years agoAdd regression test for #64319 back in.
Michael Woerister [Thu, 16 Jan 2020 14:18:11 +0000 (15:18 +0100)]
Add regression test for #64319 back in.

The regression test is originally from #64324 but was removed again
after the fix in there turned out to break other things.

4 years agoAdd regression test for shared-generics x dylibs (#67276).
Michael Woerister [Thu, 16 Jan 2020 14:09:49 +0000 (15:09 +0100)]
Add regression test for shared-generics x dylibs (#67276).

4 years agoMake sure that all upstream generics get re-exported from Rust dylibs.
Michael Woerister [Thu, 16 Jan 2020 12:21:10 +0000 (13:21 +0100)]
Make sure that all upstream generics get re-exported from Rust dylibs.

4 years agoAdded minor clarification to specification of realloc.
Matthew Parkinson [Mon, 20 Jan 2020 10:01:17 +0000 (10:01 +0000)]
Added minor clarification to specification of realloc.

The `layout` for the returned allocation of a `realloc` is
only implicitly specified.  This change makes it explicit.

4 years agoUpdate tests
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:34 +0000 (20:30 -0800)]
Update tests

4 years agoParse `?const ?Trait`
Dylan MacKenzie [Mon, 20 Jan 2020 09:20:45 +0000 (01:20 -0800)]
Parse `?const ?Trait`

4 years agoIgnore filelength for `astconv`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:35 +0000 (20:30 -0800)]
Ignore filelength for `astconv`

4 years agoTrack constness while lowering bounds
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:33 +0000 (20:30 -0800)]
Track constness while lowering bounds

4 years agoAdd `ConstnessAnd` that implements `ToPredicate`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:32 +0000 (20:30 -0800)]
Add `ConstnessAnd` that implements `ToPredicate`

4 years agoAdd `constness` field to `ty::Predicate::Trait`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:31 +0000 (20:30 -0800)]
Add `constness` field to `ty::Predicate::Trait`

4 years agoRevert "Add a `constness` field to `ast::TraitRef`"
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:29 +0000 (20:30 -0800)]
Revert "Add a `constness` field to `ast::TraitRef`"

This reverts commit fd4a6a12136c5b5d6bce4081e95890df1fd1febd.

4 years agoAdd `MaybeConst` variant to `{ast,hir}::TraitBoundModifier`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:27 +0000 (20:30 -0800)]
Add `MaybeConst` variant to `{ast,hir}::TraitBoundModifier`

4 years agoMerge branch 'master' into bare-metal-cortex-a
Jorge Aparicio [Mon, 20 Jan 2020 07:50:32 +0000 (07:50 +0000)]
Merge branch 'master' into bare-metal-cortex-a

4 years agoStore `impl const` in `ItemKind::Impl`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:25 +0000 (20:30 -0800)]
Store `impl const` in `ItemKind::Impl`

4 years agoAdd `constness` field to `hir::ItemKind::Impl`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:24 +0000 (20:30 -0800)]
Add `constness` field to `hir::ItemKind::Impl`

4 years agoAdd `constness` field to `ast::ItemKind::Impl`
Dylan MacKenzie [Tue, 14 Jan 2020 04:30:23 +0000 (20:30 -0800)]
Add `constness` field to `ast::ItemKind::Impl`

4 years agoAuto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC
bors [Mon, 20 Jan 2020 05:56:53 +0000 (05:56 +0000)]
Auto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #68326 (rustdoc: Catch fatal errors when syntax highlighting)
 - #68335 (Remove real_drop_in_place)
 - #68353 (Remove `rustc_error_codes` deps except in `rustc_driver`)
 - #68357 (rustdoc: Fix handling of compile errors when running `rustdoc --test`)
 - #68365 (Clean up error codes)

Failed merges:

r? @ghost

4 years agoRollup merge of #68365 - GuillaumeGomez:clean-up-err-codes-2, r=Dylan-DPC
Dylan DPC [Mon, 20 Jan 2020 05:44:51 +0000 (11:14 +0530)]
Rollup merge of #68365 - GuillaumeGomez:clean-up-err-codes-2, r=Dylan-DPC

Clean up error codes

r? @Dylan-DPC

4 years agoRollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomez
Dylan DPC [Mon, 20 Jan 2020 05:44:49 +0000 (11:14 +0530)]
Rollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomez

rustdoc: Fix handling of compile errors when running `rustdoc --test`

 * Call `abort_if_errors` so all errors actually stop rustdoc.
* Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message.
* Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors.

Fixes #52243
Fixes #54010

r? @GuillaumeGomez

4 years agoRollup merge of #68353 - Centril:code-liberation, r=petrochenkov
Dylan DPC [Mon, 20 Jan 2020 05:44:48 +0000 (11:14 +0530)]
Rollup merge of #68353 - Centril:code-liberation, r=petrochenkov

Remove `rustc_error_codes` deps except in `rustc_driver`

Remove dependencies on `rustc_error_codes` in all crates except for `rustc_driver`.

This has some benefits:

1. Adding a new error code when hacking on the compiler only requires rebuilding at most `rustc_error_codes`, `rustc_driver`, and the reflexive & transitive closure of the crate where the new error code is being added and its reverse dependencies. This improves time-to-UI-tests (TTUT).

2. Adding an error description to an error code only requires rebuilding `rustc_error_codes` and `rustc_driver`. This should substantially improve TTUT.

r? @petrochenkov
cc @rust-lang/wg-diagnostics

4 years agoRollup merge of #68335 - RalfJung:drop-in-place, r=Mark-Simulacrum
Dylan DPC [Mon, 20 Jan 2020 05:44:46 +0000 (11:14 +0530)]
Rollup merge of #68335 - RalfJung:drop-in-place, r=Mark-Simulacrum

Remove real_drop_in_place

In https://github.com/rust-lang/rust/commit/af9b057156f610df3528a502c668cfed99ce8a1a, I added `real_drop_in_place` because Stacked Borrows at the time couldn't handle transmuting of mutable references to raw pointers and back. Stacked Borrows 2, however, doesn't have any issue with these transmutes, so it is time to remove this hack again.

4 years agoRollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, r=GuillaumeGomez
Dylan DPC [Mon, 20 Jan 2020 05:44:42 +0000 (11:14 +0530)]
Rollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, r=GuillaumeGomez

rustdoc: Catch fatal errors when syntax highlighting

For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.

Fixes #56885

r? @GuillaumeGomez

4 years agoDocument all methods
Dylan MacKenzie [Mon, 20 Jan 2020 02:47:29 +0000 (18:47 -0800)]
Document all methods

4 years agoExplain motivation for `GenKill` trait
Dylan MacKenzie [Mon, 20 Jan 2020 02:31:56 +0000 (18:31 -0800)]
Explain motivation for `GenKill` trait

4 years agoreview comments
Esteban Küber [Mon, 20 Jan 2020 01:48:47 +0000 (17:48 -0800)]
review comments

4 years agoDeal with stabilization of `feature(slice_patterns)`
Esteban Küber [Sat, 18 Jan 2020 00:03:11 +0000 (16:03 -0800)]
Deal with stabilization of `feature(slice_patterns)`

4 years agoreview comments: use closures
Esteban Küber [Fri, 17 Jan 2020 23:59:07 +0000 (15:59 -0800)]
review comments: use closures

4 years agoreview comments
Esteban Küber [Fri, 17 Jan 2020 06:05:31 +0000 (22:05 -0800)]
review comments

4 years agoWhen encountering an expected named lifetime and none are present, suggest adding one
Esteban Küber [Thu, 16 Jan 2020 02:35:48 +0000 (18:35 -0800)]
When encountering an expected named lifetime and none are present, suggest adding one

4 years agoWhen encountering an undefined named lifetime, point to where it can be
Esteban Küber [Thu, 16 Jan 2020 02:34:30 +0000 (18:34 -0800)]
When encountering an undefined named lifetime, point to where it can be

This doesn't mention that using an existing lifetime is possible, but
that would hopefully be clear as always being an option. The intention
of this is to teach newcomers what the lifetime syntax is.

4 years agoAuto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasper
bors [Mon, 20 Jan 2020 00:10:48 +0000 (00:10 +0000)]
Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasper

Don't discard marker trait impls when inference variables are present

Fixes #61651

Previously, we would unconditionally discard impl candidates for marker
traits during trait selection. However, if the predicate had inference
variables, this could have the effect of constrainting inference
variables (due to a successful trait selection) when we would have
otherwise failed due to mutliple applicable impls,

This commit prevents marker trait impls from being discarded while the
obligation predicate has any inference variables, ensuring that
discarding impls will never cause us to incorrectly constraint inference
variables.

4 years agoReplace `walk_callee` with `consume_expr`
Yuki Okushi [Sun, 19 Jan 2020 22:38:05 +0000 (07:38 +0900)]
Replace `walk_callee` with `consume_expr`

4 years agoTest that ReifyShim + caller_location return the def site.
Adam Perry [Sun, 19 Jan 2020 22:25:43 +0000 (14:25 -0800)]
Test that ReifyShim + caller_location return the def site.

4 years agorustc_mir: don't require a self argument for ReifyShim.
Eduard-Mihai Burtescu [Sun, 19 Jan 2020 19:21:48 +0000 (21:21 +0200)]
rustc_mir: don't require a self argument for ReifyShim.

4 years agoInstanceDef::requires_caller_location limited to items.
Adam Perry [Fri, 17 Jan 2020 03:23:45 +0000 (19:23 -0800)]
InstanceDef::requires_caller_location limited to items.

4 years agoAdd failing #[track_caller] test with fn pointers.
Adam Perry [Fri, 17 Jan 2020 02:58:32 +0000 (18:58 -0800)]
Add failing #[track_caller] test with fn pointers.

4 years agoFix ICE #68025
Yuki Okushi [Thu, 9 Jan 2020 20:08:02 +0000 (05:08 +0900)]
Fix ICE #68025

4 years agoAuto merge of #68343 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Sun, 19 Jan 2020 20:37:44 +0000 (20:37 +0000)]
Auto merge of #68343 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from a8d90f6a to 7ae24429

Changes:
````
Downgrade range_plus_one to pedantic
Rustup to rust-lang/rust#68204
Add lifetimes to `LateLintPass`
Fix rustc lint import paths generated by `new_lint`
Add lint for default lint description
Update documentation for adding new lints
Generate new lints easily
````
Fixes #68331

4 years agoFix invalid link to C++ Exception Handling ABI documentation
Tianjiao Huang [Sun, 19 Jan 2020 20:16:29 +0000 (12:16 -0800)]
Fix invalid link to C++ Exception Handling ABI documentation

4 years agofix real_drop_in_place in comments
Ralf Jung [Sun, 19 Jan 2020 16:11:16 +0000 (10:11 -0600)]
fix real_drop_in_place in comments

4 years agoadjust codegen-units tests
Ralf Jung [Sun, 19 Jan 2020 16:09:52 +0000 (10:09 -0600)]
adjust codegen-units tests

4 years agoclean up E0204 explanation
Guillaume Gomez [Sun, 19 Jan 2020 14:35:55 +0000 (15:35 +0100)]
clean up E0204 explanation

4 years agoclean up E0201 explanation
Guillaume Gomez [Sun, 19 Jan 2020 14:35:44 +0000 (15:35 +0100)]
clean up E0201 explanation

4 years agoAuto merge of #68363 - Dylan-DPC:rollup-33enndv, r=Dylan-DPC
bors [Sun, 19 Jan 2020 14:06:57 +0000 (14:06 +0000)]
Auto merge of #68363 - Dylan-DPC:rollup-33enndv, r=Dylan-DPC

Rollup of 3 pull requests

Successful merges:

 - #67682 ([const-prop] Remove useless typedef)
 - #68247 (Clean up err codes)
 - #68348 (Make iter::Empty<T> Send and Sync for any T)

Failed merges:

r? @ghost

4 years agosubmodules: update clippy from a8d90f6a to fd0428f6
Matthias Krüger [Sun, 19 Jan 2020 13:01:52 +0000 (14:01 +0100)]
submodules: update clippy from a8d90f6a to fd0428f6

Changes:
````
Treat more strange pattern
Split up `if_same_then_else` ui test
Apply review comments
Run `update_lints`
Reduce span range
Rename `ok_if_let` to `if_let_some_result`
Apply review comments
Add suggestion in `if_let_some_result`
rustup https://github.com/rust-lang/rust/pull/67712
Allow `unused_self` lint at the function level
Downgrade range_plus_one to pedantic
Rustup to rust-lang/rust#68204
Add lifetimes to `LateLintPass`
Fix rustc lint import paths generated by `new_lint`
Add lint for default lint description
Update documentation for adding new lints
Generate new lints easily
Split up `booleans` ui test
Fix the ordering on `nonminimal_bool`
````

4 years agoRollup merge of #68348 - xfix:patch-14, r=nagisa
Dylan DPC [Sun, 19 Jan 2020 11:52:09 +0000 (17:22 +0530)]
Rollup merge of #68348 - xfix:patch-14, r=nagisa

Make iter::Empty<T> Send and Sync for any T

Continuing from #57682

It's quite funny, when I initially submitted this pull request, I said "Likely nobody will be using that property of `iter::empty`", but then a year later I got a compilation error because it wasn't `Send` and `Sync`.

Unfortunately, `PhantomData<fn() -> T>` still errors out. Oh well. I proposed `
struct PhantomFnWorkaround<T>(fn() -> T);`, but dtolnay did not like it, so using explicit implementations.

4 years agoRollup merge of #68247 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Dylan DPC [Sun, 19 Jan 2020 11:52:07 +0000 (17:22 +0530)]
Rollup merge of #68247 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC

Clean up err codes

r? @Dylan-DPC

4 years agoRollup merge of #67682 - wesleywiser:remove_opty_const_typedef, r=Dylan-DPC
Dylan DPC [Sun, 19 Jan 2020 11:52:06 +0000 (17:22 +0530)]
Rollup merge of #67682 - wesleywiser:remove_opty_const_typedef, r=Dylan-DPC

[const-prop] Remove useless typedef

It's confusing because it conflicts with `ty::Const` and just isn't
generally useful.