]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUpdate compiler-builtins
Thomas Vigouroux [Mon, 24 Aug 2020 13:44:13 +0000 (15:44 +0200)]
Update compiler-builtins

Fixes #57820 and #46651

3 years agoFix loading pretty-printers in rust-lldb script
ortem [Fri, 28 Aug 2020 06:29:45 +0000 (09:29 +0300)]
Fix loading pretty-printers in rust-lldb script

3 years agoOnce again, x.py tidy
Nathan West [Fri, 28 Aug 2020 02:55:58 +0000 (22:55 -0400)]
Once again, x.py tidy

3 years agoTypo fixes
Nathan West [Fri, 28 Aug 2020 02:49:16 +0000 (22:49 -0400)]
Typo fixes

3 years agoRemove unnecessary intra-doc link
Camelid [Fri, 28 Aug 2020 02:42:23 +0000 (19:42 -0700)]
Remove unnecessary intra-doc link

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoImprovements to `LineWriter::write_all`
Nathan West [Fri, 28 Aug 2020 02:32:28 +0000 (22:32 -0400)]
Improvements to `LineWriter::write_all`

`LineWriter::write_all` now only emits a single write when writing a
newline when there's already buffered data.

3 years agoAuto merge of #70212 - Amanieu:catch_foreign, r=Mark-Simulacrum
bors [Fri, 28 Aug 2020 01:20:17 +0000 (01:20 +0000)]
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

3 years agoAuto merge of #5971 - giraffate:fix_fp_in_to_string_in_display, r=ebroto
bors [Thu, 27 Aug 2020 23:26:52 +0000 (23:26 +0000)]
Auto merge of #5971 - giraffate:fix_fp_in_to_string_in_display, r=ebroto

Fix FP in `to_string_in_display`

Don't emit a lint when `.to_string()` on anything that is not `self`

Fix #5967

changelog: Fix FP in `to_string_in_display` when calling `.to_string()` on anything that is not `self`

3 years agoAuto merge of #75995 - pietroalbini:ci-let-fallible-finish, r=Mark-Simulacrum
bors [Thu, 27 Aug 2020 23:22:34 +0000 (23:22 +0000)]
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

3 years agoMake sure the functions don't get merged
Dániel Buga [Thu, 27 Aug 2020 23:16:20 +0000 (01:16 +0200)]
Make sure the functions don't get merged

3 years agoAuto merge of #75976 - GuillaumeGomez:help-popup, r=jyn514
bors [Thu, 27 Aug 2020 21:30:32 +0000 (21:30 +0000)]
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

3 years agoAbort when catch_unwind catches a foreign exception
Amanieu d'Antras [Sat, 21 Mar 2020 07:50:38 +0000 (07:50 +0000)]
Abort when catch_unwind catches a foreign exception

3 years agoAdds --bless support to test/run-make-fulldeps
Rich Kadel [Thu, 27 Aug 2020 19:27:18 +0000 (12:27 -0700)]
Adds --bless support to test/run-make-fulldeps

The ability to "bless" output for some of these tests is critical to
making it practical to adapt tests to unrelated changes.

This is needed for new coverage tests, as shown in PR #75828 (or its
derivative).

3 years agoSwitch to intra-doc links in `core::hash`
Camelid [Sun, 23 Aug 2020 21:48:37 +0000 (14:48 -0700)]
Switch to intra-doc links in `core::hash`

3 years agoAdd InstrProfilingPlatformFuchsia.c to profiler_builtins
Rich Kadel [Thu, 27 Aug 2020 18:52:36 +0000 (11:52 -0700)]
Add InstrProfilingPlatformFuchsia.c to profiler_builtins

All other Platform files included in `llvm-project/compiler-rt` were
present, except Fuchsia.

Now that there is a functional end-to-end version of
`-Zinstrument-coverage`, I need to start building and testing
coverage-enabled Rust programs on Fuchsia, and this file is required.

3 years agofix wording in release notes
tinaun [Thu, 27 Aug 2020 18:41:18 +0000 (14:41 -0400)]
fix wording in release notes

C-like enums are still allowed to impl drop, you just can't cast them to numbers

3 years agoUse intra-doc links in `core::num::dec2flt`
Camelid [Wed, 26 Aug 2020 19:26:26 +0000 (12:26 -0700)]
Use intra-doc links in `core::num::dec2flt`

3 years agoUse intra-doc links in `core::future::future`
Camelid [Wed, 26 Aug 2020 19:25:19 +0000 (12:25 -0700)]
Use intra-doc links in `core::future::future`

3 years agoci: disable cancel-outdated-builds for auto-fallible
Pietro Albini [Thu, 27 Aug 2020 18:07:06 +0000 (20:07 +0200)]
ci: disable cancel-outdated-builds for auto-fallible

3 years agoAuto merge of #75933 - Aaron1011:feature/closure-move-err, r=oli-obk
bors [Thu, 27 Aug 2020 17:48:23 +0000 (17:48 +0000)]
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.

3 years agoAdd __fastfail for Windows on arm/aarch64
Ryan Levick [Thu, 27 Aug 2020 17:11:48 +0000 (19:11 +0200)]
Add __fastfail for Windows on arm/aarch64

3 years agoAdd expect test for rustdoc html highlighting
Aleksey Kladov [Thu, 27 Aug 2020 10:50:28 +0000 (12:50 +0200)]
Add expect test for rustdoc html highlighting

It's a unit-test in a sense that it only checks syntax highlighting.
However, the resulting HTML is written to disk and can be easily
inspected in the browser.

To update the test, run with `--bless` argument or set
`UPDATE_EXPEC=1` env var

3 years agoMerge logic of looking for `Self` type
ThibsG [Thu, 27 Aug 2020 16:24:59 +0000 (18:24 +0200)]
Merge logic of looking for `Self` type

3 years agoRemove expansion restriction + fix doc and tests naming
ThibsG [Tue, 25 Aug 2020 07:16:08 +0000 (09:16 +0200)]
Remove expansion restriction + fix doc and tests naming

3 years agoFix FP in `new_ret_no_self`: trigger in trait def instead of impl block
ThibsG [Tue, 7 Jul 2020 20:47:32 +0000 (22:47 +0200)]
Fix FP in `new_ret_no_self`: trigger in trait def instead of impl block

3 years agoRename rustdoc/test -> rustdoc/doctest
Aleksey Kladov [Thu, 27 Aug 2020 16:20:15 +0000 (18:20 +0200)]
Rename rustdoc/test -> rustdoc/doctest

This modules contains the implementation of doctests, and not the
tests of rustdoc itself. This name is confusing, so let's rename it to
doctest for clarity.

3 years agoAuto merge of #74941 - dylanmckay:replace-broken-avr-unknown-unknown-target, r=oli-obk
bors [Thu, 27 Aug 2020 15:48:56 +0000 (15:48 +0000)]
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.

3 years agoRemove dependency on StringReader from rustdoc highlighter
Aleksey Kladov [Fri, 21 Aug 2020 14:38:35 +0000 (16:38 +0200)]
Remove dependency on StringReader from rustdoc highlighter

rustc_lexer is the lossless lexer, which is a better fit for
approximate syntax highlighting.

As a side-effect, we can now syntax-highlight even broken code.

3 years agoReduce duplicate doc link in error
Ivan Tham [Thu, 27 Aug 2020 15:30:15 +0000 (23:30 +0800)]
Reduce duplicate doc link in error

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoFix FP in `to_string_in_display`
Takayuki Nakata [Thu, 27 Aug 2020 14:37:47 +0000 (23:37 +0900)]
Fix FP in `to_string_in_display`

Don't emit a lint when `.to_string()` on anything that is not `self`

3 years agoshould not try to apply field accessing on enum
csmoe [Thu, 27 Aug 2020 14:01:52 +0000 (22:01 +0800)]
should not try to apply field accessing on enum

3 years agoDelay help popup creation to when it's needed
Guillaume Gomez [Thu, 27 Aug 2020 11:34:35 +0000 (13:34 +0200)]
Delay help popup creation to when it's needed

3 years agoImprove helper wording
Guillaume Gomez [Thu, 27 Aug 2020 10:56:43 +0000 (12:56 +0200)]
Improve helper wording

3 years agoAuto merge of #75947 - pietroalbini:bootstrap-update, r=Mark-Simulacrum
bors [Thu, 27 Aug 2020 09:24:51 +0000 (09:24 +0000)]
Auto merge of #75947 - pietroalbini:bootstrap-update, r=Mark-Simulacrum

Bump version to 1.48 and update cfg(bootstrap)s

r? @Mark-Simulacrum

3 years agoforgot to remove a cfg(not(bootstrap))
Pietro Albini [Thu, 27 Aug 2020 08:58:34 +0000 (10:58 +0200)]
forgot to remove a cfg(not(bootstrap))

3 years agoAuto merge of #72784 - csmoe:issue-61076, r=estebank
bors [Thu, 27 Aug 2020 07:26:32 +0000 (07:26 +0000)]
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

3 years agoAuto merge of #75879 - pietroalbini:update-relnotes, r=Mark-Simulacrum
bors [Thu, 27 Aug 2020 05:29:43 +0000 (05:29 +0000)]
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

3 years agoadd projection_ty_from_predicates query
csmoe [Thu, 27 Aug 2020 04:09:34 +0000 (12:09 +0800)]
add projection_ty_from_predicates query

3 years agoFix ICE due to carriage return w/ multibyte char
kadmin [Thu, 27 Aug 2020 02:18:38 +0000 (02:18 +0000)]
Fix ICE due to carriage return w/ multibyte char

Based off of
https://github.com/kfitch/rust/commit/972560b83f80e1219b5735ff3d751c034115b08e

3 years agoDebian 6 doesn't have ninja, so use make for the dist builds
Josh Triplett [Wed, 26 Aug 2020 22:24:39 +0000 (15:24 -0700)]
Debian 6 doesn't have ninja, so use make for the dist builds

3 years agoAuto merge of #75842 - camelid:highlight-crate-links, r=jyn514
bors [Thu, 27 Aug 2020 02:51:01 +0000 (02:51 +0000)]
Auto merge of #75842 - camelid:highlight-crate-links, r=jyn514

Highlight crate links like normal links

Fixes #75823.

Cc @jyn514

3 years agoAuto merge of #75966 - Dylan-DPC:rollup-srfpces, r=Dylan-DPC
bors [Thu, 27 Aug 2020 00:25:52 +0000 (00:25 +0000)]
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

3 years agoAuto merge of #5957 - xvschneider:AddUnwrapInsideResultLint, r=yaahc
bors [Wed, 26 Aug 2020 23:38:34 +0000 (23:38 +0000)]
Auto merge of #5957 - xvschneider:AddUnwrapInsideResultLint, r=yaahc

Adding new lint to prevent usage of 'unwrap' inside functions that re…

### Change
Adding a new lint that will emit a warning when using "unwrap" or "expect" inside a function that returns result.
### Motivation
These functions promote recoverable errors to non-recoverable errors which may be undesirable in code bases which wish to avoid panics.
### Test plan
Running:
`TESTNAME=unwrap_in_result cargo uitest
`---

changelog: none

3 years agoAdd new lint to prevent usage of unwrap in fns that return result
Jane Lusby [Wed, 26 Aug 2020 23:31:49 +0000 (16:31 -0700)]
Add new lint to prevent usage of unwrap in fns that return result

3 years agoFix typo in `std::hint::black_box` docs
aticu [Wed, 26 Aug 2020 23:16:18 +0000 (01:16 +0200)]
Fix typo in `std::hint::black_box` docs

3 years agoRollup merge of #75958 - Mark-Simulacrum:fix-toolstate, r=kennytm
Dylan DPC [Wed, 26 Aug 2020 23:14:20 +0000 (01:14 +0200)]
Rollup merge of #75958 - Mark-Simulacrum:fix-toolstate, r=kennytm

Avoid function-scoping global variables

In 2e6f2e885506ee4, 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.

3 years agoRollup merge of #75953 - jyn514:missing-lints, r=Manishearth
Dylan DPC [Wed, 26 Aug 2020 23:14:18 +0000 (01:14 +0200)]
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

3 years agoRollup merge of #75875 - pickfire:patch-4, r=jyn514
Dylan DPC [Wed, 26 Aug 2020 23:14:17 +0000 (01:14 +0200)]
Rollup merge of #75875 - pickfire:patch-4, r=jyn514

Shorten liballoc vec resize intra-doc link

r? @jyn514

3 years agoRollup merge of #75870 - GuillaumeGomez:unify-border-color-theme-ayu, r=pickfire
Dylan DPC [Wed, 26 Aug 2020 23:14:15 +0000 (01:14 +0200)]
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

3 years agoRollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
Dylan DPC [Wed, 26 Aug 2020 23:14:13 +0000 (01:14 +0200)]
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)

3 years agoRollup merge of #75818 - ollie27:doc_systemtime_windows, r=retep998
Dylan DPC [Wed, 26 Aug 2020 23:14:11 +0000 (01:14 +0200)]
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.

3 years agoRollup merge of #75806 - GuillaumeGomez:prevent-automatic-page-change-history, r...
Dylan DPC [Wed, 26 Aug 2020 23:14:08 +0000 (01:14 +0200)]
Rollup merge of #75806 - GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire

Prevent automatic page change when using history

Fixes #75774.

3 years agoRollup merge of #75780 - matklad:unconfuseunpindocs, r=KodrAus
Dylan DPC [Wed, 26 Aug 2020 23:14:06 +0000 (01:14 +0200)]
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>`.

3 years agoRollup merge of #75758 - bpangWR:master, r=Mark-Simulacrum
Dylan DPC [Wed, 26 Aug 2020 23:14:04 +0000 (01:14 +0200)]
Rollup merge of #75758 - bpangWR:master, r=Mark-Simulacrum

Fixes for VxWorks

r? @alexcrichton

3 years agoRollup merge of #74730 - androm3da:fix_libstd_hexlinux_01, r=dtolnay
Dylan DPC [Wed, 26 Aug 2020 23:14:02 +0000 (01:14 +0200)]
Rollup merge of #74730 - androm3da:fix_libstd_hexlinux_01, r=dtolnay

Hexagon libstd: update type defs

3 years agoAuto merge of #5968 - rail-rain:fix_use_snippet_with_applicability, r=flip1995
bors [Wed, 26 Aug 2020 22:52:47 +0000 (22:52 +0000)]
Auto merge of #5968 - rail-rain:fix_use_snippet_with_applicability, r=flip1995

Fix the wrong use of `snippet_with_applicability`

For the context, please see https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680749728 and https://github.com/rust-lang/rust-clippy/issues/5822#issuecomment-680783381.

---

changelog: none

3 years agoAuto merge of #75898 - lcnr:variant-def-recovered, r=petrochenkov
bors [Wed, 26 Aug 2020 22:28:48 +0000 (22:28 +0000)]
Auto merge of #75898 - lcnr:variant-def-recovered, r=petrochenkov

VariantDef: move `recovered` into `VariantFlags`

3 years agoFix the wrong use of `snippet_with_applicability`
rail [Wed, 26 Aug 2020 22:23:21 +0000 (10:23 +1200)]
Fix the wrong use of `snippet_with_applicability`

This includes a workaround of the issue #5822,
the cause of this little mistake.

3 years agoProvide a better diagnostic if ninja isn't installed
Josh Triplett [Wed, 29 Jul 2020 20:55:34 +0000 (13:55 -0700)]
Provide a better diagnostic if ninja isn't installed

Let people know that they can set ninja=false if they don't want to
install ninja.

3 years agoInstall ninja on CI builders
Josh Triplett [Wed, 29 Jul 2020 19:22:17 +0000 (12:22 -0700)]
Install ninja on CI builders

Windows CI builds already install ninja. Install it in all the
Docker-based builds as well.

3 years agoDisable ninja on macOS CI
Josh Triplett [Wed, 29 Jul 2020 19:21:35 +0000 (12:21 -0700)]
Disable ninja on macOS CI

Should be re-enabled when we have a recipe for installing ninja on
macOS.

3 years agoSet ninja=true by default
Josh Triplett [Wed, 29 Jul 2020 18:37:33 +0000 (11:37 -0700)]
Set ninja=true by default

Ninja substantially improves LLVM build time. On a 96-way system, using
Make took 248s, and using Ninja took 161s, a 35% improvement.

We already require a variety of tools to build Rust. If someone wants to
build without Ninja (for instance, to minimize the set of packages
required to bootstrap a new target), they can easily set `ninja=false`
in `config.toml`.  Our defaults should help people build Rust (and LLVM)
faster, to speed up development.

3 years agoAvoid function-scoping global variables
Mark Rousskov [Wed, 26 Aug 2020 21:22:13 +0000 (17:22 -0400)]
Avoid function-scoping global variables

In 2e6f2e885506ee4, 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.

3 years agoAuto merge of #75944 - jumbatm:issue-75924-clashing-extern-decl-ice, r=spastorino
bors [Wed, 26 Aug 2020 20:31:44 +0000 (20:31 +0000)]
Auto merge of #75944 - jumbatm:issue-75924-clashing-extern-decl-ice, r=spastorino

Fix ICE on unwrap of unknown layout in ClashingExternDeclarations.

Fixes #75924.

3 years agoFix swapped stability attributes
Joshua Nelson [Wed, 26 Aug 2020 19:13:57 +0000 (15:13 -0400)]
Fix swapped stability attributes

This fixes a regression introduced in
https://github.com/rust-lang/rust/pull/74855.

3 years agoAuto merge of #75912 - scottmcm:manuallydrop-vs-forget, r=Mark-Simulacrum
bors [Wed, 26 Aug 2020 18:40:51 +0000 (18:40 +0000)]
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)

3 years agoAuto merge of #5966 - 1c3t3a:1c3t3a-dev-5819-fix, r=Manishearth
bors [Wed, 26 Aug 2020 18:15:42 +0000 (18:15 +0000)]
Auto merge of #5966 - 1c3t3a:1c3t3a-dev-5819-fix, r=Manishearth

Corrects the float_equality_without_abs lint

Fixes an issue in the `float_equality_without_abs` lint. The lint suggestion was configured in a way that it lints the whole error and not just the subtraction part. In the current configuration the lint would suggest to change the expression in a wrong way, e.g.
```rust
let _ = (a - b) < f32::EPSILON; // before
let _ = (a - b).abs(); // after
```
This was dicovered by @flip1995. (See discussion of PR #5952).

Also the suggestion is now formatted via `utils::sugg`.
changelog: none

3 years agoAuto merge of #75903 - jyn514:lint-refactor, r=GuillaumeGomez
bors [Wed, 26 Aug 2020 16:38:58 +0000 (16:38 +0000)]
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.

3 years agoMerge conflict fix: disambiguate f32 -> prim@f32 and u32 -> prim@u32
Surya Midatala [Wed, 26 Aug 2020 16:25:42 +0000 (21:55 +0530)]
Merge conflict fix: disambiguate f32 -> prim@f32 and u32 -> prim@u32

3 years agoUse allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc...
Joshua Nelson [Sun, 23 Aug 2020 22:51:28 +0000 (18:51 -0400)]
Use allow(unused_imports) instead of cfg(doc) for imports used only for intra-doc links

3 years agoFix link to `f32`
Joshua Nelson [Sun, 23 Aug 2020 22:35:03 +0000 (18:35 -0400)]
Fix link to `f32`

Co-authored-by: Oliver Middleton <olliemail27@gmail.com>
3 years agoUse crate::mod to disambiguate links
Surya Midatala [Sun, 23 Aug 2020 15:56:17 +0000 (21:26 +0530)]
Use crate::mod to disambiguate links

3 years agoAdd suggestions from code review
Surya Midatala [Sun, 23 Aug 2020 15:43:14 +0000 (21:13 +0530)]
Add suggestions from code review

3 years agoAdd missed links in primitive_docs.rs
Surya Midatala [Sun, 23 Aug 2020 10:57:24 +0000 (16:27 +0530)]
Add missed links in primitive_docs.rs

3 years agoMove to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs, primitive_docs.rs &...
Surya Midatala [Sun, 23 Aug 2020 10:23:16 +0000 (15:53 +0530)]
Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs, primitive_docs.rs & poison.rs

3 years agoUse [xxx()] rather than the [xxx] function
Ivan Tham [Wed, 26 Aug 2020 15:21:44 +0000 (23:21 +0800)]
Use [xxx()] rather than the [xxx] function

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoError use explicit intra-doc link and fix text
Ivan Tham [Wed, 26 Aug 2020 14:41:56 +0000 (22:41 +0800)]
Error use explicit intra-doc link and fix text

3 years agoChanged the location of the suggestion as well as the way the suggestion is assembled
Bastian [Wed, 26 Aug 2020 14:39:30 +0000 (16:39 +0200)]
Changed the location of the suggestion as well as the way the suggestion is assembled

3 years agoFix ICE on unwrap of unknown layout.
jumbatm [Wed, 26 Aug 2020 13:32:57 +0000 (23:32 +1000)]
Fix ICE on unwrap of unknown layout.

3 years agoFix potential UB in align_offset docs
Elichai Turkel [Wed, 26 Aug 2020 14:02:24 +0000 (17:02 +0300)]
Fix potential UB in align_offset docs

3 years agoAuto merge of #75893 - Dylan-DPC:fix/offset-to-u64, r=oli-obk
bors [Wed, 26 Aug 2020 13:10:42 +0000 (13:10 +0000)]
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)

3 years agoClean up E0761 explanation
Guillaume Gomez [Wed, 26 Aug 2020 12:51:02 +0000 (14:51 +0200)]
Clean up E0761 explanation

3 years agoAuto merge of #5946 - mikerite:fix-5729, r=flip1995
bors [Wed, 26 Aug 2020 12:01:32 +0000 (12:01 +0000)]
Auto merge of #5946 - mikerite:fix-5729, r=flip1995

Fix `let_and_return` bad suggestion

Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.

This is similar to the problem in issue #4437.

Closes #5729

changelog: Fix `let_and_return` bad suggestion

3 years agoAuto merge of #5949 - rail-rain:fix_fp_borrow_interior_mutable_const, r=oli-obk
bors [Wed, 26 Aug 2020 11:06:37 +0000 (11:06 +0000)]
Auto merge of #5949 - rail-rain:fix_fp_borrow_interior_mutable_const, r=oli-obk

Fix fp in `borrow_interior_mutable_const`

fixes #5796

changelog: fix false positive in `borrow_interior_mutable_const` when referencing a field behind a pointer.

3 years agoAuto merge of #75687 - TimDiekmann:realloc-align, r=Amanieu
bors [Wed, 26 Aug 2020 10:44:28 +0000 (10:44 +0000)]
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

3 years agoFix a typo in #75781
Amanieu d'Antras [Wed, 26 Aug 2020 09:46:51 +0000 (10:46 +0100)]
Fix a typo in #75781

3 years agosuggest await on unexpected types
csmoe [Thu, 20 Aug 2020 10:42:08 +0000 (18:42 +0800)]
suggest await on unexpected types

3 years agoapply bootstrap cfgs
Pietro Albini [Wed, 26 Aug 2020 08:17:31 +0000 (10:17 +0200)]
apply bootstrap cfgs

3 years agobump version to 1.48
Pietro Albini [Wed, 26 Aug 2020 08:16:59 +0000 (10:16 +0200)]
bump version to 1.48

3 years agoAuto merge of #5964 - matsujika:matsujika-patch-1, r=ebroto
bors [Wed, 26 Aug 2020 07:53:07 +0000 (07:53 +0000)]
Auto merge of #5964 - matsujika:matsujika-patch-1, r=ebroto

Fix typo

changelog: none

3 years agoFix typo
Hirochika Matsumoto [Wed, 26 Aug 2020 07:03:35 +0000 (16:03 +0900)]
Fix typo

3 years agoPoint to a move-related span when pointing to closure upvars
Aaron Hill [Wed, 26 Aug 2020 03:58:58 +0000 (23:58 -0400)]
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.

3 years agoAuto merge of #75843 - hermitcore:devel, r=nagisa
bors [Wed, 26 Aug 2020 03:47:07 +0000 (03:47 +0000)]
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

3 years agoNote that `from_res` panics on errors
Joshua Nelson [Wed, 26 Aug 2020 02:01:01 +0000 (22:01 -0400)]
Note that `from_res` panics on errors

3 years agoUse map_or(true) instead of unwrap_or(true)
Joshua Nelson [Wed, 26 Aug 2020 02:00:25 +0000 (22:00 -0400)]
Use map_or(true) instead of unwrap_or(true)

Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years agoUse intra-doc links in `core::macros`
Camelid [Tue, 25 Aug 2020 23:53:33 +0000 (16:53 -0700)]
Use intra-doc links in `core::macros`

Also cleaned up some things and added a few more links.

3 years agoAuto merge of #75811 - ecstatic-morse:better-dlerror, r=nagisa
bors [Wed, 26 Aug 2020 01:40:26 +0000 (01:40 +0000)]
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.

3 years agoFix typo in release notes
Camelid [Tue, 25 Aug 2020 23:07:10 +0000 (16:07 -0700)]
Fix typo in release notes

3 years agoAuto merge of #5951 - ThibsG:FixMacroCloneOnRefPtr2076, r=ebroto
bors [Tue, 25 Aug 2020 21:48:19 +0000 (21:48 +0000)]
Auto merge of #5951 - ThibsG:FixMacroCloneOnRefPtr2076, r=ebroto

Fix incorrect suggestion when `clone_on_ref_ptr` is triggered in macros

In the lint `clone_on_ref_ptr`, if the `span` is in a macro, don't expand it for suggestion.

Fixes: #2076
changelog: none

r? @ebroto

3 years agoRemove outdated FIXME
Joshua Nelson [Tue, 25 Aug 2020 21:09:49 +0000 (17:09 -0400)]
Remove outdated FIXME