]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3
bors [Mon, 21 Jun 2021 22:24:13 +0000 (22:24 +0000)]
Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3

Add MIR pass to lower call to `core::slice::len` into `Len` operand

During some larger experiment with range analysis I've found that code like `let l = slice.len()` produces different MIR then one found in bound checks. This optimization pass replaces terminators that are calls to `core::slice::len` with just a MIR operand and Goto terminator.

It uses some heuristics to remove the outer borrow that is made to call `core::slice::len`, but I assume it can be eliminated, just didn't find how.

Would like to express my gratitude to `@oli-obk` who helped me a lot on Zullip

3 years agoAuto merge of #86515 - JohnTitor:rollup-axzb4xh, r=JohnTitor
bors [Mon, 21 Jun 2021 19:36:04 +0000 (19:36 +0000)]
Auto merge of #86515 - JohnTitor:rollup-axzb4xh, r=JohnTitor

Rollup of 9 pull requests

Successful merges:

 - #86192 (Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint)
 - #86248 (Add a regression test for issue-85113)
 - #86274 (Spaces)
 - #86349 (Add regression test for issue #78632)
 - #86424 (rustfmt: load nested out-of-line mods correctly)
 - #86472 (Fix CI to fetch master on beta channel)
 - #86473 (Rustdoc: Account for const-unstable functions)
 - #86495 (Improve `proc_macro::{Punct, Spacing}` documentation)
 - #86503 (Fix rust.css fonts.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #86503 - ehuss:rustc.css-fonts, r=jyn514,GuillaumeGomez
Yuki Okushi [Mon, 21 Jun 2021 15:00:45 +0000 (00:00 +0900)]
Rollup merge of #86503 - ehuss:rustc.css-fonts, r=jyn514,GuillaumeGomez

Fix rust.css fonts.

The `rust.css` file (used for all non-rustdoc and non-mdbook pages) has gotten out of sync with rustdoc's css. The two share the same fonts, so this updates them to match what rustdoc uses.

It would be ideal not to need this at all, but that's for another time.

3 years agoRollup merge of #86495 - r00ster91:patch-11, r=petrochenkov
Yuki Okushi [Mon, 21 Jun 2021 15:00:44 +0000 (00:00 +0900)]
Rollup merge of #86495 - r00ster91:patch-11, r=petrochenkov

Improve `proc_macro::{Punct, Spacing}` documentation

I noticed some misspellings and then thought I could improve it a bit overall.

3 years agoRollup merge of #86473 - fee1-dead:rustdoc-const-unstable, r=jyn514
Yuki Okushi [Mon, 21 Jun 2021 15:00:43 +0000 (00:00 +0900)]
Rollup merge of #86473 - fee1-dead:rustdoc-const-unstable, r=jyn514

Rustdoc: Account for const-unstable functions

Fixes #86464

3 years agoRollup merge of #86472 - Mark-Simulacrum:fix-ci-beta, r=pietroalbini
Yuki Okushi [Mon, 21 Jun 2021 15:00:42 +0000 (00:00 +0900)]
Rollup merge of #86472 - Mark-Simulacrum:fix-ci-beta, r=pietroalbini

Fix CI to fetch master on beta channel

This forward-ports a fix from the beta channel (landing in #86413, hopefully) to master so that we don't need to apply it on each round of backports.

This bug also demonstrates that our channel-checking is a bit insufficient -- stable is checked, but beta has some of its own peculiarities currently and isn't checked. But this does not attempt to adjust for that; we likely can't afford to run both beta and stable channels by CI and the current state here seems OK for now.

r? `@pietroalbini`

3 years agoRollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 15:00:41 +0000 (00:00 +0900)]
Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Mark-Simulacrum

rustfmt: load nested out-of-line mods correctly

This should address https://github.com/rust-lang/rustfmt/issues/4874

r? `@Mark-Simulacrum`

Decided to make the change directly in tree here for expediency/to minimize any potential backporting issues, and because there's some subtree sync items I need to get resolved before pulling from r-l/rustfmt

3 years agoRollup merge of #86349 - yerke:add-test-for-issue-78632, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 15:00:40 +0000 (00:00 +0900)]
Rollup merge of #86349 - yerke:add-test-for-issue-78632, r=Mark-Simulacrum

Add regression test for issue #78632

Add regression test for issue #78632

Closes #78632

Took this test from #78632 (what was committed to glacier in https://github.com/rust-lang/rust/issues/78632#issuecomment-731843345).

Tested that the we get ICE on 1.52.1 on the playground (https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b86d51fee4cded9d24b50d8ecbc48c6a).

3 years agoRollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
Yuki Okushi [Mon, 21 Jun 2021 15:00:38 +0000 (00:00 +0900)]
Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3

Spaces

3 years agoRollup merge of #86248 - JohnTitor:issue-85113, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 15:00:37 +0000 (00:00 +0900)]
Rollup merge of #86248 - JohnTitor:issue-85113, r=Mark-Simulacrum

Add a regression test for issue-85113

Fixed by #86118, closes #85113

3 years agoRollup merge of #86192 - hi-rustin:rustin-patch-lint, r=nikomatsakis
Yuki Okushi [Mon, 21 Jun 2021 15:00:36 +0000 (00:00 +0900)]
Rollup merge of #86192 - hi-rustin:rustin-patch-lint, r=nikomatsakis

Make OR_PATTERNS_BACK_COMPAT be a 2021 future-incompatible lint

close https://github.com/rust-lang/rust/issues/84869

r? `@nikomatsakis`

3 years agoReadd `unsafe` keyword in tests
Deadbeef [Mon, 21 Jun 2021 12:42:57 +0000 (20:42 +0800)]
Readd `unsafe` keyword in tests

3 years agoUpdate comment regarding staged_api
Deadbeef [Mon, 21 Jun 2021 12:21:37 +0000 (20:21 +0800)]
Update comment regarding staged_api

3 years agoAuto merge of #86210 - ehuss:rustfix-update, r=Mark-Simulacrum
bors [Mon, 21 Jun 2021 12:21:19 +0000 (12:21 +0000)]
Auto merge of #86210 - ehuss:rustfix-update, r=Mark-Simulacrum

Rustfix update

This updates to rustfix 0.6.0. One of the key changes here is https://github.com/rust-lang/rustfix/pull/195 which changes rustfix to apply multi-part suggestions. One of the tests needs to updated because there are some overlapping suggestions which rustfix cannot handle. The solution is to only apply the machine-applicable suggestions to avoid the overlapping issue.

This also includes a minor change to compiletest to provide better error messages with rustfix.

3 years agoRemoved/Updated some cases and simplified `match`
Deadbeef [Mon, 21 Jun 2021 12:15:27 +0000 (20:15 +0800)]
Removed/Updated some cases and simplified `match`

3 years agoAdded some tests for `unsafe` in const-dispay.rs
Deadbeef [Mon, 21 Jun 2021 11:17:07 +0000 (19:17 +0800)]
Added some tests for `unsafe` in const-dispay.rs

3 years agoCheck for const_unstable before printing `const`
Deadbeef [Sun, 20 Jun 2021 00:39:54 +0000 (08:39 +0800)]
Check for const_unstable before printing `const`

3 years agoAuto merge of #86157 - jsha:tera, r=jyn514,GuillaumeGomez
bors [Mon, 21 Jun 2021 09:40:34 +0000 (09:40 +0000)]
Auto merge of #86157 - jsha:tera, r=jyn514,GuillaumeGomez

Use Tera templates for rustdoc.

Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.

This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.

Part of #84419.

Demo at https://hoffman-andrews.com/rust/tera/std/string/struct.String.html.

3 years agoDelete spaces
Alexander Melentyev [Mon, 21 Jun 2021 09:11:37 +0000 (12:11 +0300)]
Delete spaces

3 years agoAuto merge of #85775 - adamrk:warn-unused-target-fields, r=nagisa
bors [Mon, 21 Jun 2021 06:56:51 +0000 (06:56 +0000)]
Auto merge of #85775 - adamrk:warn-unused-target-fields, r=nagisa

Emit warnings for unused fields in custom targets.

Add a warning which lists any fields in a custom target `json` file that aren't used. Currently unrecognized fields are ignored so, for example, a typo in the `json` will silently produce a target which isn't the one intended.

3 years agoUse Tera templates for rustdoc.
Jacob Hoffman-Andrews [Wed, 9 Jun 2021 00:19:03 +0000 (17:19 -0700)]
Use Tera templates for rustdoc.

Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.

This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.

3 years agoAuto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa
bors [Mon, 21 Jun 2021 04:03:51 +0000 (04:03 +0000)]
Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa

Do not emit alloca for ZST locals with multiple assignments

This extends 35566bfd7dd2e316d190078703de54a4dadda062 to additionally stop emitting unnecessary allocas for zero sized locals that are assigned multiple times.

When rebuilding the standard library with `-Zbuild-std` this reduces the number of locals that require an allocation from 62315 to 61767.

3 years agoAuto merge of #86502 - JohnTitor:rollup-wge0f3x, r=JohnTitor
bors [Mon, 21 Jun 2021 01:16:15 +0000 (01:16 +0000)]
Auto merge of #86502 - JohnTitor:rollup-wge0f3x, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #83739 (Account for bad placeholder errors on consts/statics with trait objects)
 - #85637 (document PartialEq, PartialOrd, Ord requirements more explicitly)
 - #86152 (Lazify is_really_default condition in the RustdocGUI bootstrap step)
 - #86156 (Fix a bug in the linkchecker)
 - #86427 (Updated release note)
 - #86452 (fix panic-safety in specialized Zip::next_back)
 - #86484 (Do not set depth to 0 in fully_expand_fragment)
 - #86491 (expand: Move some more derive logic to rustc_builtin_macros)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoFix rust.css fonts.
Eric Huss [Mon, 21 Jun 2021 01:15:54 +0000 (18:15 -0700)]
Fix rust.css fonts.

3 years agoRollup merge of #86491 - petrochenkov:derefact, r=Aaron1011
Yuki Okushi [Mon, 21 Jun 2021 00:42:19 +0000 (09:42 +0900)]
Rollup merge of #86491 - petrochenkov:derefact, r=Aaron1011

expand: Move some more derive logic to rustc_builtin_macros

And cleanup some `unwrap`s in `cfg_eval`.

Refactorings extracted from https://github.com/rust-lang/rust/pull/83354 and https://github.com/rust-lang/rust/pull/86057.
r? ``@Aaron1011``

3 years agoRollup merge of #86484 - fee1-dead:builtin-macro-recursion, r=petrochenkov
Yuki Okushi [Mon, 21 Jun 2021 00:42:18 +0000 (09:42 +0900)]
Rollup merge of #86484 - fee1-dead:builtin-macro-recursion, r=petrochenkov

Do not set depth to 0 in fully_expand_fragment

Fixes #84632.

3 years agoRollup merge of #86452 - the8472:fix-zip-drop-safety, r=m-ou-se
Yuki Okushi [Mon, 21 Jun 2021 00:42:17 +0000 (09:42 +0900)]
Rollup merge of #86452 - the8472:fix-zip-drop-safety, r=m-ou-se

fix panic-safety in specialized Zip::next_back

This was unsound since a panic in a.next_back() would result in the
length not being updated which would then lead to the same element
being revisited in the side-effect preserving code.

fixes #86443

3 years agoRollup merge of #86427 - hi-rustin:rustin-patch-release-note, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 00:42:16 +0000 (09:42 +0900)]
Rollup merge of #86427 - hi-rustin:rustin-patch-release-note, r=Mark-Simulacrum

Updated release note

close https://github.com/rust-lang/rust/issues/77098

base on https://github.com/rust-lang/rust/pull/78690

3 years agoRollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 00:42:15 +0000 (09:42 +0900)]
Rollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-Simulacrum

Fix a bug in the linkchecker

There was a small typo in the linkchecker (in #85652) that caused it to report a `#` fragment link error pointing to the wrong file (it was displaying the path to the source file, not the target of the link).

This also includes a few other changes:
- Fixes the tests due to some changes in the redirect handling in #84703.
- Adds the tests to rustbuild to run whenever the linkchecker itself is run.
- Updates the tests to validate more of the output (so that a mistake like this would have been caught).

Closes #86144

3 years agoRollup merge of #86152 - the8472:lazify-npm-queries, r=Mark-Simulacrum
Yuki Okushi [Mon, 21 Jun 2021 00:42:15 +0000 (09:42 +0900)]
Rollup merge of #86152 - the8472:lazify-npm-queries, r=Mark-Simulacrum

Lazify is_really_default condition in the RustdocGUI bootstrap step

The `RustdocGUI::should_run` condition spawns `npm list` several times which adds up to seconds of wall-time.
Evaluate the condition lazily to to keep `./x.py test tidy` and similar short-running tasks fast.

Fixes #86147

3 years agoRollup merge of #85637 - RalfJung:partial-ord, r=m-ou-se
Yuki Okushi [Mon, 21 Jun 2021 00:42:13 +0000 (09:42 +0900)]
Rollup merge of #85637 - RalfJung:partial-ord, r=m-ou-se

document PartialEq, PartialOrd, Ord requirements more explicitly

This is the result of discussion in https://github.com/rust-lang/rust/issues/50230, in particular [this summary comment](https://github.com/rust-lang/rust/issues/50230#issuecomment-392819364).

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

3 years agoRollup merge of #83739 - JohnTitor:issue-75889, r=estebank
Yuki Okushi [Mon, 21 Jun 2021 00:42:12 +0000 (09:42 +0900)]
Rollup merge of #83739 - JohnTitor:issue-75889, r=estebank

Account for bad placeholder errors on consts/statics with trait objects

Fixes #75889
r? ``@estebank``

3 years agotidy: Check that cargo and compiletest share the same rustfix.
Eric Huss [Sun, 20 Jun 2021 23:36:26 +0000 (16:36 -0700)]
tidy: Check that cargo and compiletest share the same rustfix.

3 years agocompiletest: display the error if rustfix fails
Eric Huss [Fri, 11 Jun 2021 03:40:52 +0000 (20:40 -0700)]
compiletest: display the error if rustfix fails

3 years agoUpdate rustfix for compiletest.
Eric Huss [Fri, 11 Jun 2021 03:39:05 +0000 (20:39 -0700)]
Update rustfix for compiletest.

3 years agoAuto merge of #85980 - ssomers:btree_cleanup_LeafRange, r=Mark-Simulacrum
bors [Sun, 20 Jun 2021 22:52:49 +0000 (22:52 +0000)]
Auto merge of #85980 - ssomers:btree_cleanup_LeafRange, r=Mark-Simulacrum

BTree: encapsulate LeafRange better & some debug asserts

Looking at iterators again, I think #81937 didn't house enough code in `LeafRange`. Moving the API boundary a little makes things more local in navigate.rs and less complicated in map.rs.

r? `@Mark-Simulacrum`

3 years agoFix CI to fetch master on beta channel
Mark Rousskov [Sat, 19 Jun 2021 14:08:13 +0000 (10:08 -0400)]
Fix CI to fetch master on beta channel

3 years agoImprove documentation
r00ster91 [Sun, 20 Jun 2021 20:19:47 +0000 (22:19 +0200)]
Improve  documentation

3 years agoAuto merge of #85538 - r00ster91:iterrepeat, r=Mark-Simulacrum
bors [Sun, 20 Jun 2021 20:07:13 +0000 (20:07 +0000)]
Auto merge of #85538 - r00ster91:iterrepeat, r=Mark-Simulacrum

Replace some `std::iter::repeat` with `str::repeat`

I noticed that there were some instances where `std::iter::repeat` would be used to repeat a string or a char to take a specific count of it and then collect it into a `String` when `str::repeat` is actually much faster and better for that.

See also: https://github.com/rust-lang/rust-clippy/issues/7260.

3 years agoDo not set depth to 0 in fully_expand_fragment
Deadbeef [Sun, 20 Jun 2021 18:05:37 +0000 (02:05 +0800)]
Do not set depth to 0 in fully_expand_fragment

3 years agoAuto merge of #84967 - CDirkx:os_str_ext, r=m-ou-se
bors [Sun, 20 Jun 2021 16:42:13 +0000 (16:42 +0000)]
Auto merge of #84967 - CDirkx:os_str_ext, r=m-ou-se

Move `OsStringExt` and `OsStrExt` to `std::os`

Moves the `OsStringExt` and `OsStrExt` traits and implementations from `sys_common` to `os`. `sys_common` is for abstractions over `sys` and shouldn't really contain publicly exported items.

This does introduce some duplication: the traits and implementations are now duplicated in `unix`, `wasi`, `hermit`, and `sgx`. However, I would argue that this duplication is no different to how something like `MetadataExt` is duplicated in `linux`, `vxworkx`, `redox`, `solaris` etc. The duplication also matches the fact that the traits on different platforms are technically distinct types: any platform is free to add it's own extra methods to the extension trait.

3 years agocfg_eval: Replace multiple `unwrap`s with a single `unwrap`
Vadim Petrochenkov [Sun, 20 Jun 2021 15:52:10 +0000 (18:52 +0300)]
cfg_eval: Replace multiple `unwrap`s with a single `unwrap`

3 years agoexpand: Move some more derive logic to `rustc_builtin_macros`
Vadim Petrochenkov [Sun, 20 Jun 2021 15:10:02 +0000 (18:10 +0300)]
expand: Move some more derive logic to `rustc_builtin_macros`

3 years agoSquashed implementation of the pass
Alex Vlasov [Sun, 20 Jun 2021 14:09:42 +0000 (16:09 +0200)]
Squashed implementation of the pass

3 years agoAuto merge of #86250 - RalfJung:intrinsic_operation_unsafety, r=oli-obk
bors [Sun, 20 Jun 2021 14:01:26 +0000 (14:01 +0000)]
Auto merge of #86250 - RalfJung:intrinsic_operation_unsafety, r=oli-obk

fix intrinsic_operation_unsafety comment

3 years agoAuto merge of #86486 - RalfJung:miri, r=RalfJung
bors [Sun, 20 Jun 2021 11:20:39 +0000 (11:20 +0000)]
Auto merge of #86486 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoupdate Miri
Ralf Jung [Sun, 20 Jun 2021 10:58:04 +0000 (12:58 +0200)]
update Miri

3 years agodisable test on platforms that don't support unwinding
The8472 [Sun, 20 Jun 2021 10:20:05 +0000 (12:20 +0200)]
disable test on platforms that don't support unwinding

3 years agoAdd comment to `std::os::unix::ffi::os_str` explaining that the module is reused...
Christiaan Dirkx [Sun, 20 Jun 2021 10:06:19 +0000 (12:06 +0200)]
Add comment to `std::os::unix::ffi::os_str` explaining that the module is reused on other platforms.

3 years agoMake `os_str_bytes::{Buf, Slice}` `pub` and `repr(transparent)`
Christiaan Dirkx [Sun, 20 Jun 2021 09:55:26 +0000 (11:55 +0200)]
Make `os_str_bytes::{Buf, Slice}` `pub` and `repr(transparent)`

3 years agoMove `OsStringExt` and `OsStrExt` to `std::os`
Christiaan Dirkx [Sun, 20 Jun 2021 09:52:43 +0000 (11:52 +0200)]
Move `OsStringExt` and `OsStrExt` to `std::os`

3 years agoAuto merge of #86468 - GuillaumeGomez:update-browser-ui-test-version, r=jsha
bors [Sun, 20 Jun 2021 05:47:13 +0000 (05:47 +0000)]
Auto merge of #86468 - GuillaumeGomez:update-browser-ui-test-version, r=jsha

Update browser-ui-test version

It greatly improves the test readability (thanks to `@jsha` for the suggestions!).

r? `@jsha`

3 years agoAuto merge of #86463 - fee1-dead:fixed-encode_wide, r=m-ou-se
bors [Sun, 20 Jun 2021 02:18:51 +0000 (02:18 +0000)]
Auto merge of #86463 - fee1-dead:fixed-encode_wide, r=m-ou-se

Account for self.extra in size_hint for EncodeWide

Fixes #86414.

3 years ago"(const: unstable)" for stable-but-const-unstable
Deadbeef [Sun, 20 Jun 2021 00:13:23 +0000 (08:13 +0800)]
"(const: unstable)" for stable-but-const-unstable

3 years agoAuto merge of #86433 - paolobarbolini:string-overlapping, r=m-ou-se
bors [Sat, 19 Jun 2021 23:10:55 +0000 (23:10 +0000)]
Auto merge of #86433 - paolobarbolini:string-overlapping, r=m-ou-se

Use `copy_nonoverlapping` to copy `bytes` in `String::insert_bytes`

The second copy could be made using `ptr::copy_nonoverlapping` instead of `ptr::copy`, since aliasing won't allow `self` and `bytes` to overlap. LLVM even seems to recognize this, [replacing the second `memmove` with a `memcopy`](https://rust.godbolt.org/z/Yoaa6rrGn), so this makes it so it's always applied.

3 years agoAuto merge of #86460 - JohnTitor:use-static-in-pattern-err, r=oli-obk
bors [Sat, 19 Jun 2021 19:46:02 +0000 (19:46 +0000)]
Auto merge of #86460 - JohnTitor:use-static-in-pattern-err, r=oli-obk

Refactor `PatternError` structure

Now we emit the `StaticInPattern` error precisely.
Fixes #68395
r? `@oli-obk`

3 years agoAuto merge of #86034 - nagisa:nagisa/rt-soundness, r=m-ou-se
bors [Sat, 19 Jun 2021 17:05:08 +0000 (17:05 +0000)]
Auto merge of #86034 - nagisa:nagisa/rt-soundness, r=m-ou-se

Change entry point to πŸ›‘️ against πŸ’₯ πŸ’₯-payloads

Guard against panic payloads panicking within entrypoints, where it is
UB to do so.

Note that there are a number of tradeoffs to consider. For instance, I
considered guarding against accidental panics inside the `rt::init` and
`rt::cleanup` code as well, as it is not all that obvious these may not
panic, but doing so would mean that we initialize certain thread-local
slots unconditionally, which has its own problems.

Fixes #86030
r? `@m-ou-se`

3 years agoAuto merge of #86437 - nikomatsakis:tait-docs, r=oli-obk
bors [Sat, 19 Jun 2021 12:41:10 +0000 (12:41 +0000)]
Auto merge of #86437 - nikomatsakis:tait-docs, r=oli-obk

add various coments to explain how the TAIT code works

r? `@oli-obk`

3 years agoUpdate browser-ui-test version
Guillaume Gomez [Sat, 19 Jun 2021 10:56:55 +0000 (12:56 +0200)]
Update browser-ui-test version

3 years agoChange entry point to πŸ›‘οΈ against πŸ’₯ πŸ’₯-payloads
Simonas Kazlauskas [Sat, 5 Jun 2021 18:47:35 +0000 (21:47 +0300)]
Change entry point to πŸ›‘️ against πŸ’₯ πŸ’₯-payloads

Guard against panic payloads panicking within entrypoints, where it is
UB to do so.

Note that there are a number of implementation approaches to consider.
Some simpler, some more complicated. This particular solution is nice in
that it also guards against accidental implementation issues in
various pieces of runtime code, something we cannot prevent statically
right now.

Fixes #86030

3 years agoAuto merge of #86426 - hi-rustin:rustin-patch-lint-warn, r=Aaron1011
bors [Sat, 19 Jun 2021 08:41:58 +0000 (08:41 +0000)]
Auto merge of #86426 - hi-rustin:rustin-patch-lint-warn, r=Aaron1011

Lint for unused borrows as part of UNUSED_MUST_USE

close https://github.com/rust-lang/rust/issues/76264

base on https://github.com/rust-lang/rust/pull/76894

r? `@RalfJung`

3 years agoAuto merge of #86378 - Smittyvb:thir-walker-pat, r=LeSeulArtichaut
bors [Sat, 19 Jun 2021 05:44:11 +0000 (05:44 +0000)]
Auto merge of #86378 - Smittyvb:thir-walker-pat, r=LeSeulArtichaut

Add pattern walking support to THIR walker

Suggested in https://github.com/rust-lang/rust/pull/85263#issuecomment-861906730, this splits off the support for pattern walking in THIR from #85263. This has no observable effect on THIR unsafety checking, since it is not currently possible to trigger unsafety from the THIR checker using the additional patterns or constants that are now walked. THIR patterns are walked in source code order.

r? `@LeSeulArtichaut`

3 years agoAccount for self.extra in size_hint for EncodeWide
Deadbeef [Sat, 19 Jun 2021 04:59:22 +0000 (12:59 +0800)]
Account for self.extra in size_hint for EncodeWide

3 years agoAssert `is_associated_const` when resolving
Yuki Okushi [Sat, 19 Jun 2021 04:54:33 +0000 (13:54 +0900)]
Assert `is_associated_const` when resolving

3 years agoRefactor `PatternError` structure
Yuki Okushi [Sat, 19 Jun 2021 02:46:14 +0000 (11:46 +0900)]
Refactor `PatternError` structure

3 years agoAuto merge of #86456 - JohnTitor:rollup-jjzupny, r=JohnTitor
bors [Sat, 19 Jun 2021 01:57:14 +0000 (01:57 +0000)]
Auto merge of #86456 - JohnTitor:rollup-jjzupny, r=JohnTitor

Rollup of 9 pull requests

Successful merges:

 - #86136 (Stabilize span_open() and span_close().)
 - #86359 (Use as_secs_f64 in JunitFormatter)
 - #86370 (Fix rustdoc stabilized versions layout)
 - #86397 (Alter std::cell::Cell::get_mut documentation)
 - #86407 (Use `map_or` instead of open-coding it)
 - #86425 (Update rustversion to 1.0.5)
 - #86440 (Update library tracking issue for libs-api rename.)
 - #86444 (Fix ICE with `#[repr(simd)]` on enum)
 - #86453 (stdlib: Fix typo in internal RefCell docs )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #86453 - akiselev:patch-1, r=dtolnay
Yuki Okushi [Sat, 19 Jun 2021 01:14:15 +0000 (10:14 +0900)]
Rollup merge of #86453 - akiselev:patch-1, r=dtolnay

stdlib: Fix typo in internal RefCell docs

`BorroeError` => `BorrowError` in [cell.rs](https://github.com/rust-lang/rust/blob/master/library/core/src/cell.rs#L581)

3 years agoRollup merge of #86444 - FabianWolff:issue-83505, r=LeSeulArtichaut
Yuki Okushi [Sat, 19 Jun 2021 01:14:14 +0000 (10:14 +0900)]
Rollup merge of #86444 - FabianWolff:issue-83505, r=LeSeulArtichaut

Fix ICE with `#[repr(simd)]` on enum

This pull request fixes #83505. `#[repr(simd)]` may only be applied to structs, which correctly causes `E0517` for the example given in #83505, but the compiler attempts to recover from this error, which leads to an ICE later, when `.non_enum_variant()` is called on the `AdtDef`. I have added a check that prevents this from happening.

3 years agoRollup merge of #86440 - rust-lang:libs-api-issue-template, r=m-ou-se
Yuki Okushi [Sat, 19 Jun 2021 01:14:13 +0000 (10:14 +0900)]
Rollup merge of #86440 - rust-lang:libs-api-issue-template, r=m-ou-se

Update library tracking issue for libs-api rename.

3 years agoRollup merge of #86425 - dtolnay:rustversion, r=Mark-Simulacrum
Yuki Okushi [Sat, 19 Jun 2021 01:14:12 +0000 (10:14 +0900)]
Rollup merge of #86425 - dtolnay:rustversion, r=Mark-Simulacrum

Update rustversion to 1.0.5

1.0.4 was problematic for bootstrapping rustc on gentoo. See https://github.com/dtolnay/rustversion/issues/28.

3 years agoRollup merge of #86407 - LingMan:map-or, r=LeSeulArtichaut
Yuki Okushi [Sat, 19 Jun 2021 01:14:11 +0000 (10:14 +0900)]
Rollup merge of #86407 - LingMan:map-or, r=LeSeulArtichaut

Use `map_or` instead of open-coding it

`@rustbot` modify labels +C-cleanup +T-compiler

3 years agoRollup merge of #86397 - Eosis:alter-cell-docs, r=JohnTitor
Yuki Okushi [Sat, 19 Jun 2021 01:14:10 +0000 (10:14 +0900)]
Rollup merge of #86397 - Eosis:alter-cell-docs, r=JohnTitor

Alter std::cell::Cell::get_mut documentation

I felt that there was some inconsistency between between Cell and RefCell with regards to their `get_mut` method documentation: `RefCell` flags this method as "unusual" in that it takes `&mut self`, while `Cell` does not. I attempted to flag this in `Cell`s documentation as well, and point to `RefCell`s method in the case where it is required.

Find relevant parts of docs and the new version below.

The current docs for `Cell::get_mut`:
> Returns a mutable reference to the underlying data.
This call borrows Cell mutably (at compile-time) which guarantees that we possess the only reference.

And `RefCell::get_mut`:
> Returns a mutable reference to the underlying data.
 This call borrows `RefCell` mutably (at compile-time) so there is no need for dynamic checks.
However be cautious: this method expects self to be mutable, which is generally not the case when using a `RefCell`. Take a look at the `borrow_mut` method instead if self isn’t mutable.
Also, please be aware that this method is only for special circumstances and is usually not what you want. In case of doubt, use `borrow_mut` instead.

My attempt to make `Cell::get_mut` clearer:
> Returns a mutable reference to the underlying data.
This call borrows `Cell` mutably (at compile-time) which guaranteesthat we possess the only reference.
However be cautious: this method expects `self` to be mutable, which is generally not the case when using a `Cell`. If you require interior mutability by reference, consider using `RefCell` which provides run-time checked mutable borrows through its `borrow_mut` method.

3 years agoRollup merge of #86370 - matteo-briani:fix-rustdoc-stabilized-versions-layout, r...
Yuki Okushi [Sat, 19 Jun 2021 01:14:09 +0000 (10:14 +0900)]
Rollup merge of #86370 - matteo-briani:fix-rustdoc-stabilized-versions-layout, r=GuillaumeGomez

Fix rustdoc stabilized versions layout

Fixes #86342
r? `@GuillaumeGomez`

3 years agoRollup merge of #86359 - fee1-dead:f64-junit-formatter, r=JohnTitor
Yuki Okushi [Sat, 19 Jun 2021 01:14:08 +0000 (10:14 +0900)]
Rollup merge of #86359 - fee1-dead:f64-junit-formatter, r=JohnTitor

Use as_secs_f64 in JunitFormatter

cc `@andoriyu`

3 years agoRollup merge of #86136 - m-ou-se:proc-macro-open-close-span, r=m-ou-se
Yuki Okushi [Sat, 19 Jun 2021 01:14:07 +0000 (10:14 +0900)]
Rollup merge of #86136 - m-ou-se:proc-macro-open-close-span, r=m-ou-se

Stabilize span_open() and span_close().

This proposes to stabilize `Group::span_open()` and `Group::span_close()`.

These are part of the `proc_macro_span` feature gate tracked in https://github.com/rust-lang/rust/issues/54725

Most of the features gated behind `proc_macro_span` are about source location information (file path, line and column information), expansion information (parent()), source_text(), etc. Those are not ready for stabilizaiton. However, getting the span of the `(` and `)` separately instead of only of the entire `(...)` can be very useful in proc macros, and doesn't seem blocked on anything that all the other parts of `proc_macro_span` are blocked on. So, this renames the feature gate for those two functions to `proc_macro_group_span` and stabilizes them.

3 years agoFixed typo `BorroeError` => `BorrowError` in RefCell docs
Alexander Kiselev [Sat, 19 Jun 2021 00:43:18 +0000 (17:43 -0700)]
Fixed typo `BorroeError` => `BorrowError` in RefCell docs

3 years agofix panic-safety in specialized Zip::next_back
The8472 [Sat, 19 Jun 2021 00:20:22 +0000 (02:20 +0200)]
fix panic-safety in specialized Zip::next_back

This was unsound since a panic in a.next_back() would result in the
length not being updated which would then lead to the same element
being revisited in the side-effect preserving code.

3 years agoAuto merge of #86194 - RalfJung:const-ub-hard-error, r=oli-obk
bors [Fri, 18 Jun 2021 23:17:40 +0000 (23:17 +0000)]
Auto merge of #86194 - RalfJung:const-ub-hard-error, r=oli-obk

make UB during CTFE a hard error

This is a next step for https://github.com/rust-lang/rust/issues/71800. `const_err` has been a future-incompatibility lint for 4 months now since https://github.com/rust-lang/rust/pull/80394 (and err-by-default for many years before that), so I think we could try making it a proper hard error at least in some situations.

I didn't yet adjust the tests, since I first want to gauge the fall-out via crater.
Cc `@rust-lang/wg-const-eval`

3 years agofix typos
Niko Matsakis [Fri, 18 Jun 2021 22:20:07 +0000 (18:20 -0400)]
fix typos

3 years agoAuto merge of #85815 - YuhanLiin:buf-read-data-left, r=m-ou-se
bors [Fri, 18 Jun 2021 20:11:51 +0000 (20:11 +0000)]
Auto merge of #85815 - YuhanLiin:buf-read-data-left, r=m-ou-se

Add has_data_left() to BufRead

This is a continuation of #40747 and also addresses #40745. The problem with the previous PR was that it had "eof" in its method name. This PR uses a more descriptive method name, but I'm open to changing it.

3 years agoFix ICE with `#[repr(simd)]` on enum
Fabian Wolff [Fri, 18 Jun 2021 19:39:53 +0000 (21:39 +0200)]
Fix ICE with `#[repr(simd)]` on enum

3 years agoimprove test by using intrinsic directly
Ralf Jung [Fri, 18 Jun 2021 17:43:03 +0000 (19:43 +0200)]
improve test by using intrinsic directly

3 years agobless you
Ralf Jung [Fri, 18 Jun 2021 17:31:56 +0000 (19:31 +0200)]
bless you

3 years agoAuto merge of #85747 - maxwase:path-symlinks-methods, r=m-ou-se
bors [Fri, 18 Jun 2021 17:13:19 +0000 (17:13 +0000)]
Auto merge of #85747 - maxwase:path-symlinks-methods, r=m-ou-se

Path methods β€” symlinks improvement

This PR adds symlink method for the `Path`.

Tracking issue: #85748
For the discussion you can see [internals topic](https://internals.rust-lang.org/t/path-methods-symlinks-improvement/14776)

P.S.
I'm not fully sure about `stable` attribute, correct me if I'm wrong.

3 years agoUpdate library tracking issue for libs-api rename.
Mara Bos [Fri, 18 Jun 2021 16:44:09 +0000 (18:44 +0200)]
Update library tracking issue for libs-api rename.

3 years agoadd various coments to explain how the code works
Niko Matsakis [Fri, 18 Jun 2021 15:44:56 +0000 (11:44 -0400)]
add various coments to explain how the code works

3 years agoAuto merge of #85421 - Smittyvb:rm_pushpop_unsafe, r=matthewjasper
bors [Fri, 18 Jun 2021 14:17:53 +0000 (14:17 +0000)]
Auto merge of #85421 - Smittyvb:rm_pushpop_unsafe, r=matthewjasper

Remove some last remants of {push,pop}_unsafe!

These macros have already been removed, but there was still some code handling these macros. That code is now removed.

3 years agomake UB during CTFE a hard error
Ralf Jung [Thu, 10 Jun 2021 08:02:01 +0000 (10:02 +0200)]
make UB during CTFE a hard error

3 years agoUse `copy_nonoverlapping` to copy `bytes` in `String::insert_bytes`
Paolo Barbolini [Fri, 18 Jun 2021 13:14:22 +0000 (15:14 +0200)]
Use `copy_nonoverlapping` to copy `bytes` in `String::insert_bytes`

3 years ago`no_run` and `ignore` doc attributes
Max Wase [Fri, 18 Jun 2021 11:17:21 +0000 (14:17 +0300)]
`no_run` and `ignore` doc attributes

3 years agoAuto merge of #86428 - RalfJung:miri, r=RalfJung
bors [Fri, 18 Jun 2021 11:04:59 +0000 (11:04 +0000)]
Auto merge of #86428 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoAddress comment
hi-rustin [Fri, 18 Jun 2021 08:20:30 +0000 (16:20 +0800)]
Address comment

3 years agoMake clippy tests happy
hi-rustin [Fri, 18 Jun 2021 08:11:32 +0000 (16:11 +0800)]
Make clippy tests happy

3 years agoupdate Miri
Ralf Jung [Fri, 18 Jun 2021 07:56:37 +0000 (09:56 +0200)]
update Miri

3 years agoAuto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, r=jyn514
bors [Fri, 18 Jun 2021 07:49:41 +0000 (07:49 +0000)]
Auto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, r=jyn514

fix rustdoc stack overflow on mutually recursive Deref

fix #85095
fix #85037

3 years agoUpdated release note
hi-rustin [Fri, 18 Jun 2021 07:21:41 +0000 (15:21 +0800)]
Updated release note

3 years agoLint for unused borrows as part of UNUSED_MUST_USE
hi-rustin [Fri, 18 Jun 2021 07:09:40 +0000 (15:09 +0800)]
Lint for unused borrows as part of UNUSED_MUST_USE

3 years agoUpdate rustversion to 1.0.5
David Tolnay [Fri, 18 Jun 2021 05:34:55 +0000 (22:34 -0700)]
Update rustversion to 1.0.5

3 years agoAuto merge of #85284 - eggyal:custom-profiler-runtime, r=jackh726
bors [Fri, 18 Jun 2021 04:39:01 +0000 (04:39 +0000)]
Auto merge of #85284 - eggyal:custom-profiler-runtime, r=jackh726

Provide option for specifying the profiler runtime

Currently, if `-Zinstrument-coverage` is enabled, the target is linked
against the `library/profiler_builtins` crate (which pulls in LLVM's
compiler-rt runtime).

This option enables backends to specify an alternative runtime crate for
handling injected instrumentation calls.

3 years agofix(rustfmt): load nested out-of-line mods correctly
Caleb Cartwright [Fri, 18 Jun 2021 03:35:19 +0000 (22:35 -0500)]
fix(rustfmt): load nested out-of-line mods correctly