Commit Graph

106008 Commits

Author SHA1 Message Date
Tomasz Miąsko
d8c661a886 Mark __msan_keep_going as an exported symbol for LTO 2020-01-21 00:00:00 +00:00
bors
06b945049b 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
2020-01-20 23:35:50 +00:00
Mazdak Farrokhzad
58eb03d20f check_match: simplify check_arm 2020-01-20 23:39:24 +01:00
Yuki Okushi
f6406f7f68
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
2020-01-21 07:32:50 +09:00
Yuki Okushi
32ecb6f1f2
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.
2020-01-21 07:32:48 +09:00
Yuki Okushi
67b87c8ba8
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
2020-01-21 07:32:47 +09:00
Yuki Okushi
8d2bac8dff
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.
2020-01-21 07:32:45 +09:00
Yuki Okushi
bff216c56f
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.
2020-01-21 07:32:44 +09:00
Yuki Okushi
eff6381c32
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).

ecd5852194 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.
2020-01-21 07:32:42 +09:00
Yuki Okushi
e1bd9b3396
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.
2020-01-21 07:32:40 +09:00
Yuki Okushi
ec7f209ad4
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.
2020-01-21 07:32:39 +09:00
Nikita Popov
2c0845c6cc Mark __msan_track_origins as an exported symbol for LTO 2020-01-20 23:13:38 +01:00
Mark Rousskov
be663bf850 Correct rmeta/rlib test 2020-01-20 16:00:01 -05:00
Mark Rousskov
4bb68828de 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.
2020-01-20 16:00:01 -05:00
bors
b5a3341f1b 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)
2020-01-20 20:11:20 +00:00
Guillaume Gomez
871e82b7d0 Add aliases attribute check 2020-01-20 20:42:52 +01:00
Mazdak Farrokhzad
78f0c7fd64 check_match: unify some lowering code and fix some ICEs 2020-01-20 19:46:27 +01:00
Vita Batrla
5392442869 refactor fix using cfg_if! (fix build on Solaris) 2020-01-20 19:15:37 +01:00
Oliver Middleton
3e0bfe1238 rustdoc: Correct order of async and unsafe in async unsafe fns 2020-01-20 18:14:51 +00:00
Mark Rousskov
a804a45528 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.
2020-01-20 12:17:12 -05:00
Mazdak Farrokhzad
71450c7aad generalize bindings_with_variant_name lint 2020-01-20 18:00:04 +01:00
Mark Rousskov
9ae32c9b27 Drop args from Formatter
These are no longer used by Formatter methods.
2020-01-20 11:57:27 -05:00
Mark Rousskov
4919b96f81 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).
2020-01-20 11:57:27 -05:00
Mark Rousskov
fdef4f185e 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.
2020-01-20 11:57:27 -05:00
Tomasz Miąsko
6d218db26d 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.
2020-01-20 16:58:24 +01:00
bors
66b0c97070 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
2020-01-20 13:37:03 +00:00
Guillaume Gomez
12882a8392 Remove usage of global variable "inlined_types" 2020-01-20 13:34:44 +01:00
Michael Woerister
0a9bcb0adf 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.
2020-01-20 12:00:43 +01:00
Michael Woerister
ce6995f98e Add regression test for shared-generics x dylibs (#67276). 2020-01-20 12:00:43 +01:00
Michael Woerister
31095d7e37 Make sure that all upstream generics get re-exported from Rust dylibs. 2020-01-20 12:00:43 +01:00
Mazdak Farrokhzad
25460ebef6 transparent_enums: test alignment 2020-01-20 11:18:05 +01:00
Mazdak Farrokhzad
93efe41b4e stabilize transparent_enums 2020-01-20 11:18:05 +01:00
Matthew Parkinson
6be3446f92 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.
2020-01-20 10:09:51 +00:00
Dylan MacKenzie
23ea42cfd1 Update tests 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
0ac4ba0eed Parse ?const ?Trait 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
3b1a9d35c8 Ignore filelength for astconv 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
adbd01e84a Track constness while lowering bounds 2020-01-20 01:28:10 -08:00
Dylan MacKenzie
d2aefbb286 Add ConstnessAnd that implements ToPredicate 2020-01-20 00:00:08 -08:00
Dylan MacKenzie
ab3081a70e Add constness field to ty::Predicate::Trait 2020-01-20 00:00:08 -08:00
Dylan MacKenzie
1a3bd5775f Revert "Add a constness field to ast::TraitRef"
This reverts commit fd4a6a1213.
2020-01-20 00:00:08 -08:00
Dylan MacKenzie
eb60346cc9 Add MaybeConst variant to {ast,hir}::TraitBoundModifier 2020-01-20 00:00:08 -08:00
Jorge Aparicio
a3a0776100
Merge branch 'master' into bare-metal-cortex-a 2020-01-20 07:50:32 +00:00
Dylan MacKenzie
958b0bc8d2 Store impl const in ItemKind::Impl 2020-01-19 23:41:44 -08:00
Dylan MacKenzie
a790f9bb2d Add constness field to hir::ItemKind::Impl 2020-01-19 23:41:44 -08:00
Dylan MacKenzie
01cbe506f9 Add constness field to ast::ItemKind::Impl 2020-01-19 23:41:42 -08:00
bors
900811e430 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
2020-01-20 05:56:53 +00:00
Dylan DPC
0259c10385
Rollup merge of #68365 - GuillaumeGomez:clean-up-err-codes-2, r=Dylan-DPC
Clean up error codes

r? @Dylan-DPC
2020-01-20 11:14:51 +05:30
Dylan DPC
cd4652a195
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
2020-01-20 11:14:49 +05:30
Dylan DPC
fb86b820bb
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
2020-01-20 11:14:48 +05:30
Dylan DPC
5d8edc99aa
Rollup merge of #68335 - RalfJung:drop-in-place, r=Mark-Simulacrum
Remove real_drop_in_place

In af9b057156, 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.
2020-01-20 11:14:46 +05:30