Commit Graph

125970 Commits

Author SHA1 Message Date
bors 41aaa90c67 Auto merge of #70212 - Amanieu:catch_foreign, r=Mark-Simulacrum
Abort when foreign exceptions are caught by catch_unwind

Prior to this PR, foreign exceptions were not caught by catch_unwind, and instead passed through invisibly. This represented a painful soundness hole in some libraries ([take_mut](https://github.com/Sgeo/take_mut/blob/master/src/lib.rs#L37)), which relied on `catch_unwind` to handle all possible exit paths from a closure.

With this PR, foreign exceptions are now caught by `catch_unwind` and will trigger an abort since catching foreign exceptions is currently UB according to the latest proposals by the FFI unwind project group.

cc @rust-lang/wg-ffi-unwind
2020-08-28 01:20:17 +00:00
bors 2aa741a9fa Auto merge of #75995 - pietroalbini:ci-let-fallible-finish, r=Mark-Simulacrum
Disable cancel-outdated-builds for auto-fallible

`cancel-outdated-builds` doesn't need to be enabled on fallible jobs, and it's actually making it harder for us to see if https://github.com/rust-lang/rust/issues/71988 is fixed. This adds some temporary code to avoid `auto-fallible` jobs from being cancelled by our tooling.

r? @Mark-Simulacrum
2020-08-27 23:22:34 +00:00
bors 397b390cc7 Auto merge of #75976 - GuillaumeGomez:help-popup, r=jyn514
Improve help popup

Fixes #75623.

The second commit is just a slight improvement: the help popup won't be created until someone presses "?" or ESC. Not a big improvement in itself but considering the low amount of code required, I think it was worth the shot.

r? @jyn514
2020-08-27 21:30:32 +00:00
Amanieu d'Antras 239f833ed1 Abort when catch_unwind catches a foreign exception 2020-08-27 21:08:30 +01:00
Pietro Albini 19e70bf822
ci: disable cancel-outdated-builds for auto-fallible 2020-08-27 20:07:06 +02:00
bors 132f5fc2e5 Auto merge of #75933 - Aaron1011:feature/closure-move-err, r=oli-obk
Point to a move-related span when pointing to closure upvars

Fixes #75904

When emitting move/borrow errors, we may point into a closure to
indicate why an upvar is used in the closure. However, we use the
'upvar span', which is just an arbitrary usage of the upvar. If the
upvar is used in multiple places (e.g. a borrow and a move), we may end
up pointing to the borrow. If the overall error is a move error, this
can be confusing.

This PR tracks the span that caused an upvar to become captured by-value
instead of by-ref (assuming that it's not a `move` closure). We use this
span instead of the 'upvar' span when we need to point to an upvar usage
during borrow checking.
2020-08-27 17:48:23 +00:00
bors 3d0c847d33 Auto merge of #74941 - dylanmckay:replace-broken-avr-unknown-unknown-target, r=oli-obk
[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target

The `avr-unknown-unknown` target has never worked correctly, always trying to invoke
the host linker and failing. It aimed to be a mirror of AVR-GCC's
default handling of the `avr-unknown-unknown' triple (assume bare
minimum chip features, silently skip linking runtime libraries, etc).
This behaviour is broken-by-default as it will cause a miscompiled executable
when flashed.

This patch improves the AVR builtin target specifications to instead
expose only a 'avr-unknown-gnu-atmega328' target. This target system is
`gnu`, as it uses the AVR-GCC frontend along with avr-binutils. The
target triple ABI is 'atmega328'.

In the future, it should be possible to replace the dependency on
AVR-GCC and binutils by using the in-progress AVR LLD and compiler-rt support.
Perhaps at that point it would make sense to add an
'avr-unknown-unknown-atmega328' target as a better default when
implemented.

There is no current intention to add in-tree AVR target specifications for other
AVR microcontrollers - this one can serve as a reference implementation
for other devices via `rustc --print target-spec-json
avr-unknown-gnu-atmega328p`.

There should be no users of the existing 'avr-unknown-unknown' Rust
target as a custom target specification JSON has always been
recommended, and the avr-unknown-unknown target could never pass the
linking step anyway.
2020-08-27 15:48:56 +00:00
Guillaume Gomez 86e42c2742 Delay help popup creation to when it's needed 2020-08-27 14:22:54 +02:00
Guillaume Gomez 1727c7a194 Improve helper wording 2020-08-27 14:22:54 +02:00
bors 118860a7e7 Auto merge of #75947 - pietroalbini:bootstrap-update, r=Mark-Simulacrum
Bump version to 1.48 and update cfg(bootstrap)s

r? @Mark-Simulacrum
2020-08-27 09:24:51 +00:00
Pietro Albini 1b6590c9f4
forgot to remove a cfg(not(bootstrap)) 2020-08-27 10:58:34 +02:00
bors f7cbb7a594 Auto merge of #72784 - csmoe:issue-61076, r=estebank
Await on mismatched future types

Closes #61076
This PR suggests to `await` on:
1. `async_fn().bar() => async_fn().await.bar()`
2. `async_fn().field => async_fn().await.field`
3. ` if let x = async() {} => if let x = async().await {}`

r? @tmandry @estebank
2020-08-27 07:26:32 +00:00
bors 4e701afd84 Auto merge of #75879 - pietroalbini:update-relnotes, r=Mark-Simulacrum
Include last-minute compatibility notes for 1.46.0

This cherry-picks the relnotes update of https://github.com/rust-lang/rust/pull/75878 on master.

r? @Mark-Simulacrum
2020-08-27 05:29:43 +00:00
csmoe 7cfcefd1fb add projection_ty_from_predicates query 2020-08-27 12:09:34 +08:00
bors 18b0585b52 Auto merge of #75842 - camelid:highlight-crate-links, r=jyn514
Highlight crate links like normal links

Fixes #75823.

Cc @jyn514
2020-08-27 02:51:01 +00:00
bors 09b06f9a09 Auto merge of #75966 - Dylan-DPC:rollup-srfpces, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #74730 (Hexagon libstd: update type defs)
 - #75758 (Fixes for VxWorks)
 - #75780 (Unconfuse Unpin docs a bit)
 - #75806 (Prevent automatic page change when using history)
 - #75818 (Update docs for SystemTime Windows implementation)
 - #75837 (Fix font color for help button in ayu and dark themes)
 - #75870 (Unify theme choices border color in ayu theme)
 - #75875 (Shorten liballoc vec resize intra-doc link)
 - #75953 (Fix swapped stability attributes for rustdoc lints)
 - #75958 (Avoid function-scoping global variables)

Failed merges:

r? @ghost
2020-08-27 00:25:52 +00:00
Dylan DPC 8fd73aa45d
Rollup merge of #75958 - Mark-Simulacrum:fix-toolstate, r=kennytm
Avoid function-scoping global variables

In 2e6f2e8855, we added a main function to the publish_toolstate.py script.
Unfortunately, we missed that the Python program implicitly declares global
variables in that code, which means that adding a function changes variable
scoping and breaks other code.

This commit avoids introducing that function and adds a warning to future
editors of the code.
2020-08-27 01:14:20 +02:00
Dylan DPC c2a0168ce5
Rollup merge of #75953 - jyn514:missing-lints, r=Manishearth
Fix swapped stability attributes for rustdoc lints

This fixes a regression introduced in https://github.com/rust-lang/rust/pull/74855. Previously, `missing_doc_code_examples` would be run on stable and `private_doc_tests` would only be run on nightly. Now, it correctly does the reverse.
Closes https://github.com/rust-lang/rust/issues/75951.
r? @ehuss
2020-08-27 01:14:18 +02:00
Dylan DPC 11e9769a97
Rollup merge of #75875 - pickfire:patch-4, r=jyn514
Shorten liballoc vec resize intra-doc link

r? @jyn514
2020-08-27 01:14:17 +02:00
Dylan DPC c1cb46e906
Rollup merge of #75870 - GuillaumeGomez:unify-border-color-theme-ayu, r=pickfire
Unify theme choices border color in ayu theme

There was a slight color difference in the theme choice menu borders:

![Screenshot from 2020-08-24 10-37-05](https://user-images.githubusercontent.com/3050060/91022913-22654880-e5f6-11ea-8165-302b2d4e701e.png)
![Screenshot from 2020-08-24 10-37-58](https://user-images.githubusercontent.com/3050060/91022918-242f0c00-e5f6-11ea-989a-e26a28196d09.png)

r? @Cldfire
2020-08-27 01:14:15 +02:00
Dylan DPC 88c68cae4f
Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
Fix font color for help button in ayu and dark themes

A nice before/after:

![Screenshot from 2020-08-23 14-47-07](https://user-images.githubusercontent.com/3050060/90979230-0dd07400-e554-11ea-85f7-046dfca65e8e.png)

![Screenshot from 2020-08-23 14-47-03](https://user-images.githubusercontent.com/3050060/90979233-145eeb80-e554-11ea-8e63-1864c3f2699b.png)

For the ayu theme, the change is very "light", the font color was already close to white, so I unified the color with the pictures of the other buttons:

![Screenshot from 2020-08-23 15-20-45](https://user-images.githubusercontent.com/3050060/90979281-5e47d180-e554-11ea-9993-8595057481ab.png)
![Screenshot from 2020-08-23 15-20-50](https://user-images.githubusercontent.com/3050060/90979279-5daf3b00-e554-11ea-8d39-beb57091aba7.png)
2020-08-27 01:14:13 +02:00
Dylan DPC a838f2fc79
Rollup merge of #75818 - ollie27:doc_systemtime_windows, r=retep998
Update docs for SystemTime Windows implementation

Windows now uses `GetSystemTimePreciseAsFileTime` (since #69858) on versions of Windows that support it.
2020-08-27 01:14:11 +02:00
Dylan DPC 463fdf3e04
Rollup merge of #75806 - GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire
Prevent automatic page change when using history

Fixes #75774.
2020-08-27 01:14:08 +02:00
Dylan DPC a79f9af290
Rollup merge of #75780 - matklad:unconfuseunpindocs, r=KodrAus
Unconfuse Unpin docs a bit

* Don't say that Unpin is used to prevent moves, because it is used
  to *allow* moves
* Be more precise about kindedness of things, it is
  `Pin<Pointer<Data>>`, rather than just `Pin<Pointer>`.
2020-08-27 01:14:06 +02:00
Dylan DPC 730449d22a
Rollup merge of #75758 - bpangWR:master, r=Mark-Simulacrum
Fixes for VxWorks

r? @alexcrichton
2020-08-27 01:14:04 +02:00
Dylan DPC 2eec2ecbde
Rollup merge of #74730 - androm3da:fix_libstd_hexlinux_01, r=dtolnay
Hexagon libstd: update type defs
2020-08-27 01:14:02 +02:00
bors 45a83e97cc Auto merge of #75898 - lcnr:variant-def-recovered, r=petrochenkov
VariantDef: move `recovered` into `VariantFlags`
2020-08-26 22:28:48 +00:00
Mark Rousskov c8b240241a Avoid function-scoping global variables
In 2e6f2e8855, we added a main function to the publish_toolstate.py script.
Unfortunately, we missed that the Python program implicitly declares global
variables in that code, which means that adding a function changes variable
scoping and breaks other code.

This commit avoids introducing that function and adds a warning to future
editors of the code.
2020-08-26 17:24:52 -04:00
bors 2d8a3b9181 Auto merge of #75944 - jumbatm:issue-75924-clashing-extern-decl-ice, r=spastorino
Fix ICE on unwrap of unknown layout in ClashingExternDeclarations.

Fixes #75924.
2020-08-26 20:31:44 +00:00
Joshua Nelson 29399fad5f Fix swapped stability attributes
This fixes a regression introduced in
https://github.com/rust-lang/rust/pull/74855.
2020-08-26 15:31:08 -04:00
bors 48717b6f3c Auto merge of #75912 - scottmcm:manuallydrop-vs-forget, r=Mark-Simulacrum
Suggest `mem::forget` if `mem::ManuallyDrop::new` isn't used

I think this communicates the intent more idiomatically, and is shorter anyway.

Inspired because [it came up on URLO](https://users.rust-lang.org/t/validity-of-memory-area-after-std-forget/47730/7?u=scottmcm), and it turns out that std had done it too in one spot:
![image](https://user-images.githubusercontent.com/18526288/91203819-e19f2980-e6f2-11ea-9112-835f3b22ce05.png)
2020-08-26 18:40:51 +00:00
bors 1f2dd3b56a Auto merge of #75903 - jyn514:lint-refactor, r=GuillaumeGomez
Warn about unknown or renamed lints in rustdoc

Fixes https://github.com/rust-lang/rust/issues/75884.
This is best reviewed one commit at a time.
r? @GuillaumeGomez

Originally I tried to do a much broader refactoring that got rid of `init_lints` altogether. My reasoning is that now the lints aren't being run anymore (after https://github.com/rust-lang/rust/pull/73566), there's no need to ignore them explicitly. But it seems there are still some lints that aren't affected by setting `lint_mod` to a no-op:

```
deny(pub_use_of_private_extern_crate)
deny(const_err)
warn(unused_imports)
```

(there are possibly more, these are just the ones that failed in the rustdoc test suite).

Some of these seem like we really should be warning about, but that's a much larger change and I don't propose to make it here. So for the time being, this just adds the `unknown_lints` and `renamed_or_removed_lints` passes to the list of lints rustdoc warns about.
2020-08-26 16:38:58 +00:00
jumbatm 8c0128bb02 Fix ICE on unwrap of unknown layout. 2020-08-27 00:15:24 +10:00
bors 6ead62235a Auto merge of #75893 - Dylan-DPC:fix/offset-to-u64, r=oli-obk
change offset from u32 to u64

References #71696

r? @oli-obk

(closed the earlier pr because the rebase got messed up)
2020-08-26 13:10:42 +00:00
bors ffd59bf9c6 Auto merge of #75687 - TimDiekmann:realloc-align, r=Amanieu
Allow reallocation to different alignment in `AllocRef`

The allocator-wg [has decided](https://github.com/rust-lang/wg-allocators/issues/5#issuecomment-672591112) to support reallocating to a different alignment in `AllocRef`. For more details please see the linked issue.

r? @Amanieu

closes https://github.com/rust-lang/wg-allocators/issues/5
2020-08-26 10:44:28 +00:00
csmoe 8ee206a80d suggest await on unexpected types 2020-08-26 17:40:08 +08:00
Pietro Albini 3e16d4af7f
apply bootstrap cfgs 2020-08-26 10:17:31 +02:00
Pietro Albini e88d79ca41
bump version to 1.48 2020-08-26 10:16:59 +02:00
Aaron Hill b5b8b9329b
Point to a move-related span when pointing to closure upvars
Fixes #75904

When emitting move/borrow errors, we may point into a closure to
indicate why an upvar is used in the closure. However, we use the
'upvar span', which is just an arbitrary usage of the upvar. If the
upvar is used in multiple places (e.g. a borrow and a move), we may end
up pointing to the borrow. If the overall error is a move error, this
can be confusing.

This PR tracks the span that caused an upvar to become captured by-value
instead of by-ref (assuming that it's not a `move` closure). We use this
span instead of the 'upvar' span when we need to point to an upvar usage
during borrow checking.
2020-08-26 02:11:01 -04:00
bors 2fe9a33659 Auto merge of #75843 - hermitcore:devel, r=nagisa
HermitCore switchs to relocatable binaries

- switch to relocatbale binaries to realize ASLR
- remove all dependencies to gcc
2020-08-26 03:47:07 +00:00
bors 3e98860425 Auto merge of #75811 - ecstatic-morse:better-dlerror, r=nagisa
Refactor dynamic library error checking on *nix

The old code was checking `dlerror` more often than necessary, since (unlike `dlsym`) checking the return value of [`dlopen`](https://www.man7.org/linux/man-pages/man3/dlopen.3.html) is enough to indicate whether an error occurred. In the first commit, I've refactored the code to minimize the number of system calls needed. It should be strictly better than the old version.

The second commit is an optional addendum which fixes the issue observed on illumos in #74469, a PR I reviewed that was ultimately closed due to inactivity. I'm not sure how hard we try to work around platform-specific bugs like this, and I believe that, due to the way that `dlerror` is specified in the POSIX standard, libc implementations that want to run on conforming systems cannot call `dlsym` in multi-threaded programs.
2020-08-26 01:40:26 +00:00
bors bf4342114e Auto merge of #75302 - Aaron1011:feature/partial-move-diag, r=estebank
Be consistent when describing a move as a 'partial' in diagnostics

When an error occurs due to a partial move, we would use the world
"partial" in some parts of the error message, but not in others. This
commit ensures that we use the word 'partial' in either all or none of
the diagnostic messages.

Additionally, we no longer describe a move out of a `Box` via `*` as
a 'partial move'. This was a pre-existing issue, but became more
noticable when the word 'partial' is used in more places.
2020-08-25 20:54:59 +00:00
Dylan MacKenzie aae6c0fbfe Explicitly pass `RTLD_LOCAL` to `dlopen`
This happens to be the default on Linux, but the default is unspecified
in the POSIX standard. Also switches to `cast` to keep line lengths in
check.
2020-08-25 12:11:30 -07:00
Pang, Baoshan 079baafdf1 For VxWorks:
fix building errors
use wr-c++ as linker
2020-08-25 12:09:39 -07:00
Dylan MacKenzie f07011bad8 Always treat `dlsym` returning NULL as an error
This simplifies the code somewhat. Also updates comments to reflect
notes from reviw about thread-safety of `dlerror`.
2020-08-25 12:02:21 -07:00
bors 8ba22504e8 Auto merge of #74275 - wesleywiser:break_up_partitioning_rs, r=pnkfelix
Refactor the partitioning module to make it easier to introduce new algorithms

I've split the `librustc_mir::monomorphize::partitioning` module into a few files and introduced a `Partitioner` trait which allows us to decouple the partitioning algorithm from the code which integrates it into the query system. This should allow us to introduce new partitioning algorithms much more easily. I've also gone ahead and added a `-Z` flag to control which algorithm is used (currently there is only the `default`).

I left a few comments in places where things might be improved further.

r? @pnkfelix cc @rust-lang/wg-incr-comp
2020-08-25 18:52:11 +00:00
Scott McMurray f3024073f9 Suggest `mem::forget` if `mem::ManuallyDrop::new` isn't used
I think this communicates the intent better, and is shorter anyway.
2020-08-25 09:40:53 -07:00
bors ba4c4468f5 Auto merge of #75908 - pietroalbini:ci-bump-llvm, r=Mark-Simulacrum
Bump LLVM on CI to 10.0.0

This PR bumps the LLVM version we use on our macOS and Windows CI to 10.0.0, fixing a breakage we noticed today:

```
2020-08-25T14:24:28.5939568Z FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/AMDGPUMetadata.cpp.obj
2020-08-25T14:24:28.5940317Z D:\a\rust\rust\build\bootstrap\debug\sccache-plus-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\Support -ID:\a\rust\rust\src\llvm-project\llvm\lib\Support -Iinclude -ID:\a\rust\rust\src\llvm-project\llvm\include -nologo -MT -Brepro --target=x86_64-pc-windows-msvc /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wno-noexcept-type -Wno-comment /Gw /MT /O2 /Ob2 -UNDEBUG -std:c++14  /EHs-c- /GR- /showIncludes /Folib\Support\CMakeFiles\LLVMSupport.dir\AMDGPUMetadata.cpp.obj /Fdlib\Support\CMakeFiles\LLVMSupport.dir\LLVMSupport.pdb -c D:\a\rust\rust\src\llvm-project\llvm\lib\Support\AMDGPUMetadata.cpp
2020-08-25T14:24:28.5940861Z clang-cl: warning: argument unused during compilation: '-Brepro' [-Wunused-command-line-argument]
2020-08-25T14:24:28.5941076Z clang-cl: warning: argument unused during compilation: '-Brepro' [-Wunused-command-line-argument]
2020-08-25T14:24:28.5941321Z In file included from D:\a\rust\rust\src\llvm-project\llvm\lib\Support\AMDGPUMetadata.cpp:15:
2020-08-25T14:24:28.5941545Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/Twine.h:12:
2020-08-25T14:24:28.5941774Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/SmallVector.h:16:
2020-08-25T14:24:28.5942016Z In file included from D:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/iterator_range.h:21:
2020-08-25T14:24:28.5942257Z In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\iterator:9:
2020-08-25T14:24:28.5942542Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\yvals_core.h(494,2): error: STL1000: Unexpected compiler version, expected Clang 10.0.0 or newer.
```

I uploaded both the new tarballs to our mirrors bucket.
2020-08-25 15:44:03 +00:00
Pietro Albini 2c011096d2
ci: fix macOS target name for LLVM 10 2020-08-25 17:41:50 +02:00
Pietro Albini 61d4f0e876
ci: bump LLVM source tarball on Linux to 10.0.0 2020-08-25 17:27:43 +02:00