]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agobreak out to one scope higher for let-else
Ding Xiang Fei [Sat, 30 Jul 2022 16:02:47 +0000 (00:02 +0800)]
break out to one scope higher for let-else

23 months agoAuto merge of #99868 - yaahc:rustc-perf-bump, r=Mark-Simulacrum
bors [Sat, 30 Jul 2022 12:21:14 +0000 (12:21 +0000)]
Auto merge of #99868 - yaahc:rustc-perf-bump, r=Mark-Simulacrum

bump rustc-perf commit

split off from https://github.com/rust-lang/rust/pull/99431

needed to access bugfix from https://github.com/rust-lang/rustc-perf/pull/1366

23 months agoAuto merge of #99796 - compiler-errors:issue-53475, r=oli-obk
bors [Sat, 30 Jul 2022 09:35:22 +0000 (09:35 +0000)]
Auto merge of #99796 - compiler-errors:issue-53475, r=oli-obk

use `check_region_obligations_and_report_errors` to avoid ICEs

If we don't call `process_registered_region_obligations` before `resolve_regions_and_report_errors` then we'll ICE if we have any region obligations, and `check_region_obligations_and_report_errors` just does both of these for us in a nice convenient function.

Fixes #53475

r? types

23 months agoAuto merge of #99768 - klensy:bump-deps-07-22, r=Mark-Simulacrum
bors [Sat, 30 Jul 2022 06:54:38 +0000 (06:54 +0000)]
Auto merge of #99768 - klensy:bump-deps-07-22, r=Mark-Simulacrum

update few deps

Updates few crates:

* openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q: fixes few CVE's (https://www.openssl.org/news/vulnerabilities-1.1.1.html: https://cve.org/CVERecord?id=CVE-2022-1292 https://cve.org/CVERecord?id=CVE-2022-2068 https://cve.org/CVERecord?id=CVE-2022-2097)

* openssl-probe v0.1.2 -> v0.1.5 updates ancient (2017) crate (https://github.com/alexcrichton/openssl-probe/compare/0.1.2...0.1.5). Adds support to search cert for additional platforms.

* indoc v1.0.3 -> v1.0.6 (https://github.com/dtolnay/indoc/compare/1.0.3...1.0.6) Nothing special changed, removes unindent v0.1.7

* bstr v0.2.13 -> v0.2.17 (https://github.com/BurntSushi/bstr/compare/0.2.13...0.2.17) Few speedups (https://github.com/BurntSushi/bstr/commit/8e659921312830b91d2a48aafa36fb1a49cba5bc, https://github.com/BurntSushi/bstr/commit/5fcef919adf1b84a960c87126decb0f3ef8c2e61) and bugfix (https://github.com/BurntSushi/bstr/commit/b2111b6bbf2c9a819fb1338aa81bd099874106a1)

* crc32fast v1.2.0 -> v1.3.2 (https://github.com/srijs/rust-crc32fast/compare/v1.2.0...v1.3.2) Speedup debug (https://github.com/srijs/rust-crc32fast/commit/e61ce6a39bbe9da495198a4037292ec299e8970f)

* diff v0.1.12 -> v0.1.13 (https://github.com/utkarshkukreti/diff.rs/compare/0.1.12...0.1.13) Few optimizations (https://github.com/utkarshkukreti/diff.rs/pull/16, https://github.com/utkarshkukreti/diff.rs/commit/0f0aa580f197af7dab9ab905568f70a2387e23bc)

* ignore v0.4.17 -> v0.4.18 (it's hard to get usable diff, but most notable perf change is https://github.com/BurntSushi/ripgrep/commit/a28e664abd0d8912e4a2d85039fe282b9d37b994)

* globset v0.4.5 -> v0.4.9

* regex v1.5.5 -> v1.5.6 few bugfixes (https://github.com/rust-lang/regex/blob/1.5.6/CHANGELOG.md#156-2022-05-20). There exist 1.6.0 version, but it's too fresh.

23 months agoAuto merge of #99123 - mystor:crossbeam_bridge, r=eddyb
bors [Sat, 30 Jul 2022 04:05:28 +0000 (04:05 +0000)]
Auto merge of #99123 - mystor:crossbeam_bridge, r=eddyb

proc_macro: use crossbeam channels for the proc_macro cross-thread bridge

This is done by having the crossbeam dependency inserted into the `proc_macro` server code from the server side, to avoid adding a dependency to `proc_macro`.

In addition, this introduces a -Z command-line option which will switch rustc to run proc-macros using this cross-thread executor. With the changes to the bridge in #98186, #98187, #98188 and #98189, the performance of the executor should be much closer to same-thread execution.

In local testing, the crossbeam executor was substantially more performant than either of the two existing `CrossThread` strategies, so they have been removed to keep things simple.

r? `@eddyb`

23 months agoAuto merge of #99925 - JohnTitor:rollup-4bt9ou3, r=JohnTitor
bors [Sat, 30 Jul 2022 00:26:22 +0000 (00:26 +0000)]
Auto merge of #99925 - JohnTitor:rollup-4bt9ou3, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99227 (Fix thumbv4t-none-eabi frame pointer setting)
 - #99518 (Let-else: break out scopes when a let-else pattern fails to match)
 - #99671 (Suggest dereferencing index when trying to use a reference of usize as index)
 - #99831 (Add Fuchsia platform support documentation)
 - #99881 (fix ICE when computing codegen_fn_attrs on closure with non-fn parent)
 - #99888 (Streamline lint checking)
 - #99891 (Adjust an expr span to account for macros)
 - #99904 (Cleanup html whitespace)

Failed merges:

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

23 months agoRollup merge of #99904 - GuillaumeGomez:cleanup-html-whitespace, r=notriddle
Yuki Okushi [Fri, 29 Jul 2022 22:39:56 +0000 (07:39 +0900)]
Rollup merge of #99904 - GuillaumeGomez:cleanup-html-whitespace, r=notriddle

Cleanup html whitespace

I realized while looking at the raw HTML that we generated some unwanted white space characters. This PR cleans up the one coming directly from rustdoc. I'll check from `pulldown-cmark` for the remaining ones.

Some numbers now: the difference is small, it goes from `63009` to `62859`. But multiplied by the number of files, it becomes quite interesting overall.

r? `@notriddle`

23 months agoRollup merge of #99891 - compiler-errors:suggest-slicing-carefully, r=oli-obk
Yuki Okushi [Fri, 29 Jul 2022 22:39:55 +0000 (07:39 +0900)]
Rollup merge of #99891 - compiler-errors:suggest-slicing-carefully, r=oli-obk

Adjust an expr span to account for macros

Fix this erroneous suggestion:

```
error[E0529]: expected an array or slice, found `Vec<{integer}>`
 --> /home/gh-compiler-errors/test.rs:2:9
  |
2 |     let [..] = vec![1, 2, 3];
  |         ^^^^ pattern cannot match with input type `Vec<{integer}>`
  |
help: consider slicing here
 --> /home/gh-compiler-errors/rust2/library/alloc/src/macros.rs:50:36
  |
50~         $crate::__rust_force_expr!(<[_]>::into_vec(
51+             #[rustc_box]
52+             $crate::boxed::Box::new([$($x),+])
53~         )[..])
```

23 months agoRollup merge of #99888 - nnethercote:streamline-visitors, r=cjgillot
Yuki Okushi [Fri, 29 Jul 2022 22:39:54 +0000 (07:39 +0900)]
Rollup merge of #99888 - nnethercote:streamline-visitors, r=cjgillot

Streamline lint checking

The early (AST) and late (HIR) lint checkers have a number of functions that aren't used by rustc or clippy. Might as well remove them -- it's not like there's a canonical API here, as shown by the ad hoc use of `check_foo`/`check_foo_post` combinations.

r? `@cjgillot`

23 months agoRollup merge of #99881 - compiler-errors:issue-99876, r=tmiasko
Yuki Okushi [Fri, 29 Jul 2022 22:39:53 +0000 (07:39 +0900)]
Rollup merge of #99881 - compiler-errors:issue-99876, r=tmiasko

fix ICE when computing codegen_fn_attrs on closure with non-fn parent

Other call sites check `has_codegen_attrs` first, so let's do that too.

Fixes #99876

23 months agoRollup merge of #99831 - djkoloski:add_fuchsia_target_documentation, r=tmandry
Yuki Okushi [Fri, 29 Jul 2022 22:39:52 +0000 (07:39 +0900)]
Rollup merge of #99831 - djkoloski:add_fuchsia_target_documentation, r=tmandry

Add Fuchsia platform support documentation

This documentation contains instructions for building and running binaries on Fuchsia using its provided SDK.

23 months agoRollup merge of #99671 - TaKO8Ki:suggest-dereferencing-index, r=compiler-errors
Yuki Okushi [Fri, 29 Jul 2022 22:39:50 +0000 (07:39 +0900)]
Rollup merge of #99671 - TaKO8Ki:suggest-dereferencing-index, r=compiler-errors

Suggest dereferencing index when trying to use a reference of usize as index

fixes #96678

23 months agoRollup merge of #99518 - dingxiangfei2009:let-else-additional-tests, r=oli-obk
Yuki Okushi [Fri, 29 Jul 2022 22:39:49 +0000 (07:39 +0900)]
Rollup merge of #99518 - dingxiangfei2009:let-else-additional-tests, r=oli-obk

Let-else: break out scopes when a let-else pattern fails to match

This PR will commit to a new behavior so that values from initializer expressions are dropped earlier when a let-else pattern fails to match.

Fix #98672.
Close #93951.
cc `@camsteffen` `@est31`

23 months agoRollup merge of #99227 - Lokathor:fix-thumbv4t-none-eabi-frame-pointer, r=davidtwco
Yuki Okushi [Fri, 29 Jul 2022 22:39:48 +0000 (07:39 +0900)]
Rollup merge of #99227 - Lokathor:fix-thumbv4t-none-eabi-frame-pointer, r=davidtwco

Fix thumbv4t-none-eabi frame pointer setting

The `thumb_base` profile has changed since I last remember seeing it, and now it sets the frame pointer to "always keep", which is not desired for this target. Hooking a debugger to the running program is not really done, it's preferable to have the register available for actual program use, so the default "may omit" is now set.

I thought that the target was already using "may omit" when I checked on it last month, because I forgot that the target was previously based on `thumb_base` rather than `Default::default()`. I only noticed the issue just now when creating the `armv4t-none-eabi` target (https://github.com/rust-lang/rust/pull/99226), though this PR is not in any way conditional on that one.

23 months agoAuto merge of #99730 - lcnr:bound-vars-anon, r=jackh726
bors [Fri, 29 Jul 2022 21:38:36 +0000 (21:38 +0000)]
Auto merge of #99730 - lcnr:bound-vars-anon, r=jackh726

anonymize all bound vars, not just regions

fixes #98702

r? types

23 months agoproc_macro: use crossbeam channels for the proc_macro cross-thread bridge
Nika Layzell [Sat, 18 Jun 2022 18:15:03 +0000 (14:15 -0400)]
proc_macro: use crossbeam channels for the proc_macro cross-thread bridge

This is done by having the crossbeam dependency inserted into the
proc_macro server code from the server side, to avoid adding a
dependency to proc_macro.

In addition, this introduces a -Z command-line option which will switch
rustc to run proc-macros using this cross-thread executor. With the
changes to the bridge in #98186, #98187, #98188 and #98189, the
performance of the executor should be much closer to same-thread
execution.

In local testing, the crossbeam executor was substantially more
performant than either of the two existing CrossThread strategies, so
they have been removed to keep things simple.

23 months agoAuto merge of #99577 - est31:remove_box_librustdoc, r=jsha
bors [Fri, 29 Jul 2022 18:44:53 +0000 (18:44 +0000)]
Auto merge of #99577 - est31:remove_box_librustdoc, r=jsha

Remove remaining uses of box syntax from librustdoc

Remove the remaining uses of box syntax from librustdoc. Followup of #99066 where these changes were split out because they were responsible for a small but noticeable regression. This PR avoids the regression by boxing some large variants of `ItemKind` to reduce the enum's size by half from 224 bytes to 112 bytes (on x86-64). This should also help with reducing memory usage.

23 months agoStatically ensure the size of ItemKind
est31 [Thu, 21 Jul 2022 21:54:16 +0000 (23:54 +0200)]
Statically ensure the size of ItemKind

23 months agoBox FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItem
est31 [Thu, 21 Jul 2022 22:11:21 +0000 (00:11 +0200)]
Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItem

This reduces ItemKind size from 160 bytes to 112 bytes

23 months agoBox TypedefItem, ImplItem, AssocTypeItem variants of ItemKind
est31 [Thu, 21 Jul 2022 21:14:12 +0000 (23:14 +0200)]
Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKind

This reduces ItemKind size from 224 bytes to 160 bytes.

23 months agoRemove box_syntax feature gate from librustdoc
est31 [Sun, 10 Jul 2022 22:29:15 +0000 (00:29 +0200)]
Remove box_syntax feature gate from librustdoc

23 months agoRemove box syntax from doctest.rs
est31 [Thu, 21 Jul 2022 21:00:28 +0000 (23:00 +0200)]
Remove box syntax from doctest.rs

23 months agoRemove box syntax from Box<rustdoc::clean::types::ItemKind> construction
est31 [Sun, 10 Jul 2022 22:08:55 +0000 (00:08 +0200)]
Remove box syntax from Box<rustdoc::clean::types::ItemKind> construction

The type has 240 bytes according to compiler internal rustdoc.

23 months agoAuto merge of #99467 - BelovDV:add_option_link_arg, r=petrochenkov
bors [Fri, 29 Jul 2022 15:36:52 +0000 (15:36 +0000)]
Auto merge of #99467 - BelovDV:add_option_link_arg, r=petrochenkov

flag '-l link-arg=___ was added

#99427

23 months agoAuto merge of #99715 - tmiasko:coverage-run-make, r=Mark-Simulacrum
bors [Fri, 29 Jul 2022 12:45:47 +0000 (12:45 +0000)]
Auto merge of #99715 - tmiasko:coverage-run-make, r=Mark-Simulacrum

Move coverage tests from run-make-fulldeps to run-make

23 months agoRemove unwanted extra white space characters from HTML
Guillaume Gomez [Fri, 29 Jul 2022 12:32:48 +0000 (14:32 +0200)]
Remove unwanted extra white space characters from HTML

23 months agoAuto merge of #99892 - JohnTitor:rollup-qi4fem8, r=JohnTitor
bors [Fri, 29 Jul 2022 09:57:44 +0000 (09:57 +0000)]
Auto merge of #99892 - JohnTitor:rollup-qi4fem8, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99686 (add suggestion when there is a impl of external trait on pointer with wrong coherence rules)
 - #99760 (doc/rustc: describe the uefi target platforms)
 - #99766 (Htmldocck: Substitute the doc channel when blessing)
 - #99781 (Use String::from_utf8_lossy in CStr demo)
 - #99803 (Update mentions to `rustc_metadata::rmeta::Lazy`)
 - #99845 (Remove `$` prefix for bash scripts in doc)
 - #99850 (rustdoc: Remove more Clean trait implementations)
 - #99872 (Clone the `src/llvm-project` submodule if profiling is enabled)

Failed merges:

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

23 months agoAuto merge of #99667 - ouz-a:some_branch, r=oli-obk
bors [Fri, 29 Jul 2022 07:11:50 +0000 (07:11 +0000)]
Auto merge of #99667 - ouz-a:some_branch, r=oli-obk

Optimize `UnDerefer`

Addresses the performance [issues](https://github.com/rust-lang/rust/pull/98145#issuecomment-1183548597) faced here.

r? `@oli-obk`

23 months agooptimize bound vars replacement :3
lcnr [Thu, 28 Jul 2022 14:55:15 +0000 (16:55 +0200)]
optimize bound vars replacement :3

23 months agoRollup merge of #99872 - Nilstrieb:bootstrap-llvm, r=jyn514
Yuki Okushi [Fri, 29 Jul 2022 06:40:04 +0000 (15:40 +0900)]
Rollup merge of #99872 - Nilstrieb:bootstrap-llvm, r=jyn514

Clone the `src/llvm-project` submodule if profiling is enabled

To compile rustc with profiling information, `compiler-rt` from LLVM is required. Building it requires the `src/llvm-project` submodule to be initialized and updated.

Fixes #99869

23 months agoRollup merge of #99850 - GuillaumeGomez:clean-more-items, r=notriddle
Yuki Okushi [Fri, 29 Jul 2022 06:40:03 +0000 (15:40 +0900)]
Rollup merge of #99850 - GuillaumeGomez:clean-more-items, r=notriddle

rustdoc: Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`

23 months agoRollup merge of #99845 - xtexChooser:patch-1, r=GuillaumeGomez
Yuki Okushi [Fri, 29 Jul 2022 06:40:02 +0000 (15:40 +0900)]
Rollup merge of #99845 - xtexChooser:patch-1, r=GuillaumeGomez

Remove `$` prefix for bash scripts in doc

23 months agoRollup merge of #99803 - JohnTitor:update-lazy-docs, r=compiler-errors
Yuki Okushi [Fri, 29 Jul 2022 06:40:01 +0000 (15:40 +0900)]
Rollup merge of #99803 - JohnTitor:update-lazy-docs, r=compiler-errors

Update mentions to `rustc_metadata::rmeta::Lazy`

While working on https://github.com/rust-lang/rustc-dev-guide/pull/1411, I noticed there are still some mentions of `Lazy`. This updates them to `LazyValue`, `LazyArray`, or `LazyTable`.

r? ````@compiler-errors````

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
23 months agoRollup merge of #99781 - workingjubilee:demo-string-from-cstr, r=thomcc
Yuki Okushi [Fri, 29 Jul 2022 06:40:00 +0000 (15:40 +0900)]
Rollup merge of #99781 - workingjubilee:demo-string-from-cstr, r=thomcc

Use String::from_utf8_lossy in CStr demo

Fixes rust-lang/rust#99755.

23 months agoRollup merge of #99766 - fmease:htmldocck-subst-channel-when-blessing, r=Mark-Simulacrum
Yuki Okushi [Fri, 29 Jul 2022 06:39:59 +0000 (15:39 +0900)]
Rollup merge of #99766 - fmease:htmldocck-subst-channel-when-blessing, r=Mark-Simulacrum

Htmldocck: Substitute the doc channel when blessing

Since #84942, the snippet `{{channel}}` gets substituted with the concrete “doc channel” (e.g. `https://doc.rust-lang.org/nightly`) when snapshot files are checked against the actual rustdoc output.

However, when you `--bless` rustdoc tests, htmldocck just dumps the concrete channel into the snapshot file and
you have to manually do a find-and-replace after blessing to uphold what #84942 set out to fix.

I admit it's a bit fragile to blindly replace URLs like this but I guess it's not too bad in practice.
Feel free to close this PR if you don't think that this is a good idea.

`@rustbot` label T-rustdoc A-testsuite

23 months agoRollup merge of #99760 - dvdhrm:rw/uefiplat, r=ehuss
Yuki Okushi [Fri, 29 Jul 2022 06:39:58 +0000 (15:39 +0900)]
Rollup merge of #99760 - dvdhrm:rw/uefiplat, r=ehuss

doc/rustc: describe the uefi target platforms

Add a `platform-support` entry to the rustc-docs for the different `*-unknown-uefi` targets. This describes in detail how this platform works, a few basic examples, and how to compile for the platform.

Red Hat is sponsoring my work on this platform, so I am putting myself down as target maintainer. Co-maintainers are more than welcome to join me in the effort. Communication is going on off-list to coordinate the different efforts.

Note that the ultimate goal is to move the UEFI targets to Tier-2 so bootloaders can be more easily supported in commercial products. This documentation is the first step towards that goal, but should be a viable documentation even for the current Tier-3 status of the targets.

I also want to point out that there is an ongoing GSoC-effort to port the rust standard library to UEFI (by Ayush Singh). While this work is not necessarily required to get to Tier-2, we definitely should coordinate the efforts and update the documentation as soon as any such ports are merged.

Note that the targets are already used by multiple commercial and non commercial production systems, including, but not limited to:

 * Tianocore-EDK2 (Official UEFI SDK by Intel) comes with rust support
   in its staging repository (not part of any release, yet).
   (https://github.com/tianocore/edk2-staging/tree)
 * Intel's research program "Project Mu" uses the rust UEFI targets to
   show possible future replacements for Tianocore-EDK2.
 * The Rust OS "Redox" uses the UEFI targets for its bootloader.
   (https://www.redox-os.org/)
 * The hugely popular in-depth documentation of OS development in Rust
   by Philipp Oppermann uses the UEFI targets.
   (https://os.phil-opp.com/)

23 months agoRollup merge of #99686 - vincenzopalazzo:macros/impl_on_ptr, r=compiler-errors
Yuki Okushi [Fri, 29 Jul 2022 06:39:57 +0000 (15:39 +0900)]
Rollup merge of #99686 - vincenzopalazzo:macros/impl_on_ptr, r=compiler-errors

add suggestion when there is a impl of external trait on pointer with wrong coherence rules

Closes https://github.com/rust-lang/rust/issues/99572

This will try to improve the node in the error message by suggesting a general solution because the solution, in this case, is application depended.

I'm not super happy regarding the code quality, but I'm happy to have feedback on it.

`@rustbot` r? `@compiler-errors`

23 months agoDocument check_region_obligations_and_report_errors, simplify a call to resolve_regions
Michael Goulet [Fri, 29 Jul 2022 06:17:17 +0000 (06:17 +0000)]
Document check_region_obligations_and_report_errors, simplify a call to resolve_regions

23 months agoAdjust an expr span to account for macros
Michael Goulet [Fri, 29 Jul 2022 06:02:11 +0000 (06:02 +0000)]
Adjust an expr span to account for macros

23 months agoRemove some late `check_*` functions.
Nicholas Nethercote [Fri, 29 Jul 2022 01:28:51 +0000 (11:28 +1000)]
Remove some late `check_*` functions.

They're not used by rustc or clippy.

23 months agoRemove `visit_name` from the AST visitor.
Nicholas Nethercote [Fri, 29 Jul 2022 03:43:28 +0000 (13:43 +1000)]
Remove `visit_name` from the AST visitor.

Because the default is empty and it's never overridden. This means
`walk_ident` can also be removed, because it does nothing.

23 months agoRemove some early `check_*` functions.
Nicholas Nethercote [Fri, 29 Jul 2022 00:25:49 +0000 (10:25 +1000)]
Remove some early `check_*` functions.

They're not used by rustc or clippy.

23 months agocheck if T is slice
Takayuki Maeda [Fri, 29 Jul 2022 05:12:37 +0000 (14:12 +0900)]
check if T is slice

fix msg

23 months agoimplement `point_at_index_if_possible`
Takayuki Maeda [Fri, 29 Jul 2022 05:12:17 +0000 (14:12 +0900)]
implement `point_at_index_if_possible`

23 months agoAuto merge of #99660 - PrestonFrom:issue_99265, r=compiler-errors
bors [Fri, 29 Jul 2022 04:23:08 +0000 (04:23 +0000)]
Auto merge of #99660 - PrestonFrom:issue_99265, r=compiler-errors

Generate correct suggestion with named arguments used positionally

Address issue #99265 by checking each positionally used argument
to see if the argument is named and adding a lint to use the name
instead. This way, when named arguments are used positionally in a
different order than their argument order, the suggested lint is
correct.

For example:
```
println!("{b} {}", a=1, b=2);
```
This will now generate the suggestion:
```
println!("{b} {a}", a=1, b=2);
```

Additionally, this check now also correctly replaces or inserts
only where the positional argument is (or would be if implicit).
Also, width and precision are replaced with their argument names
when they exists.

Since the issues were so closely related, this fix for issue #99265
also fixes issue #99266.

Fixes #99265
Fixes #99266

23 months agoAuto merge of #99512 - nikic:llvm-15-fixes, r=cuviper
bors [Fri, 29 Jul 2022 01:35:15 +0000 (01:35 +0000)]
Auto merge of #99512 - nikic:llvm-15-fixes, r=cuviper

LLVM 15 compatibility fixes

These are LLVM 15 compatibility fixes split out from #99464. There are three changes here:

 * Emit elementtype attribtue for ldrex/strex intrinsics. This is requires as part of the opaque pointers migration.
 * Make more tests compatible with opaque pointers. These are either new or aren't run on x86.
 * Remove a test for `#[rustc_allocator]`. Since #99574 there are more requirement on the function signature. I dropped the test entirely, since we already test the effect of the attribute elsewhere.
 * The main change: When a worker thread emits an error, wait for other threads to finish before unwinding the main thread and exiting. Otherwise workers may end up using globals for which destructors have already been run. This was probably never quite correct, but became an active problem with LLVM 15, because it started using global dtors in critical places, as part of ManagedStatic removal.

Fixes #99432 (and probably also #95679).

r? `@cuviper`

23 months agofix ICE when computing codegen_fn_attrs on closure with non-fn parent
Michael Goulet [Fri, 29 Jul 2022 00:40:07 +0000 (00:40 +0000)]
fix ICE when computing codegen_fn_attrs on closure with non-fn parent

23 months agoAuto merge of #99865 - flip1995:clippyup, r=Manishearth
bors [Thu, 28 Jul 2022 22:02:12 +0000 (22:02 +0000)]
Auto merge of #99865 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

23 months agoAdd Fuchsia platform support documentation
David Koloski [Wed, 20 Jul 2022 19:42:17 +0000 (15:42 -0400)]
Add Fuchsia platform support documentation

23 months agoClone the `src/llvm-project` submodule if profiling is enabled
Nilstrieb [Thu, 28 Jul 2022 19:40:33 +0000 (21:40 +0200)]
Clone the `src/llvm-project` submodule if profiling is enabled

To compile rustc with profiling information, `compiler-rt` from
LLVM is required. Building it requires the `src/llvm-project` submodule
to be initialized and updated.

23 months agoAuto merge of #99863 - Dylan-DPC:rollup-lq9w047, r=Dylan-DPC
bors [Thu, 28 Jul 2022 19:12:21 +0000 (19:12 +0000)]
Auto merge of #99863 - Dylan-DPC:rollup-lq9w047, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #99628 (add more docs regarding ideographic numbers)
 - #99689 (Revert `write!` and `writeln!` to late drop temporaries)
 - #99807 (Fix PermissionDenied UI tests on WSL)
 - #99817 (rustdoc: remove Clean trait impls for more items)
 - #99851 (Fix small typo in Cargo.toml comment)
 - #99856 (fix: remove fake no_dead_strip for osx)

Failed merges:

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

23 months agobump rustc-perf commit
Jane Losare-Lusby [Mon, 25 Jul 2022 20:01:05 +0000 (20:01 +0000)]
bump rustc-perf commit

23 months agoUpdate Cargo.lock
Philipp Krones [Thu, 28 Jul 2022 17:08:41 +0000 (19:08 +0200)]
Update Cargo.lock

23 months agoMerge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup
Philipp Krones [Thu, 28 Jul 2022 17:08:22 +0000 (19:08 +0200)]
Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup

23 months agoonce again tidy was unhappy
Lokathor [Thu, 28 Jul 2022 16:58:42 +0000 (10:58 -0600)]
once again tidy was unhappy

23 months agoAuto merge of #9257 - flip1995:rustup, r=flip1995
bors [Thu, 28 Jul 2022 16:56:38 +0000 (16:56 +0000)]
Auto merge of #9257 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

23 months agoBump nightly version -> 2022-07-28
Philipp Krones [Thu, 28 Jul 2022 16:56:16 +0000 (18:56 +0200)]
Bump nightly version -> 2022-07-28

23 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 28 Jul 2022 16:47:48 +0000 (18:47 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

23 months agoRollup merge of #99856 - csmoe:osx-no-dead-strip, r=bjorn3
Dylan DPC [Thu, 28 Jul 2022 16:44:51 +0000 (22:14 +0530)]
Rollup merge of #99856 - csmoe:osx-no-dead-strip, r=bjorn3

fix: remove fake no_dead_strip for osx

Closes https://github.com/rust-lang/rust/issues/99788

Link arg `-no_dead_strip` doesn't exist on OSX at all.
The `no_gc_sections` function was never called before export-executable-symols implementation, and `export-executable-symbols` still works, so we just remove it.
r? `@bjorn3`

23 months agoRollup merge of #99851 - yotamofek:patch-1, r=Mark-Simulacrum
Dylan DPC [Thu, 28 Jul 2022 16:44:50 +0000 (22:14 +0530)]
Rollup merge of #99851 - yotamofek:patch-1, r=Mark-Simulacrum

Fix small typo in Cargo.toml comment

23 months agoRollup merge of #99817 - notriddle:notriddle/clean-trait-removal, r=GuillaumeGomez
Dylan DPC [Thu, 28 Jul 2022 16:44:49 +0000 (22:14 +0530)]
Rollup merge of #99817 - notriddle:notriddle/clean-trait-removal, r=GuillaumeGomez

rustdoc: remove Clean trait impls for more items

Follow up to https://github.com/rust-lang/rust/pull/99638 and https://github.com/rust-lang/rust/pull/99672

23 months agoRollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-Simulacrum
Dylan DPC [Thu, 28 Jul 2022 16:44:48 +0000 (22:14 +0530)]
Rollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-Simulacrum

Fix PermissionDenied UI tests on WSL

On my WSL with `appendWindowsPath=true`, running an invalid command returns `PermissionDenied` instead of `NotFound`, causing two UI tests to fail.

23 months agoRollup merge of #99689 - dtolnay:write, r=Mark-Simulacrum
Dylan DPC [Thu, 28 Jul 2022 16:44:46 +0000 (22:14 +0530)]
Rollup merge of #99689 - dtolnay:write, r=Mark-Simulacrum

Revert `write!` and `writeln!` to late drop temporaries

Closes (on master, but not on beta) #99684 by reverting the `write!` and `writeln!` parts of #96455.

argument position | before<br>#94868 | after<br>#94868 | after<br>#96455 | after<br>this PR | desired<br>(unimplementable)
--- |:---:|:---:|:---:|:---:|:---:
`write!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`write!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`writeln!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`writeln!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`print!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`println!("…", $tmp)` | *early⸺* | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprint!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprintln!("…", $tmp)` | *early⸺* | **⸺late**| *early⸺* | *early⸺* | *early⸺*
`panic!("…", $tmp)` | *early⸺* | *early⸺* | *early⸺* | *early⸺* | *early⸺*

"Late drop" refers to dropping temporaries at the nearest semicolon **outside** of the macro invocation.

"Early drop" refers to dropping temporaries inside of the macro invocation.

23 months agoRollup merge of #99628 - vincenzopalazzo:macros/is_number_doc, r=joshtriplett
Dylan DPC [Thu, 28 Jul 2022 16:44:46 +0000 (22:14 +0530)]
Rollup merge of #99628 - vincenzopalazzo:macros/is_number_doc, r=joshtriplett

add more docs regarding ideographic numbers

This was discussed in the last lib meeting and I try to avoid forgetting to open a PR because I think having some docs can help people.

However, I think we need to discuss a little bit if this is enough or if we need to add more clarification? Maybe an example?

Inspiration Source: https://github.com/rust-lang/rust/issues/84056#issuecomment-1184725924

Including suggestion https://github.com/rust-lang/rust/pull/99626#issuecomment-1192983043 my bad command git close the PR

23 months agoUpdate thumbv4t_none_eabi.rs
Lokathor [Thu, 28 Jul 2022 16:43:05 +0000 (10:43 -0600)]
Update thumbv4t_none_eabi.rs

23 months agoAuto merge of #99780 - Nilstrieb:mir-opt-test-line-no, r=oli-obk
bors [Thu, 28 Jul 2022 16:22:19 +0000 (16:22 +0000)]
Auto merge of #99780 - Nilstrieb:mir-opt-test-line-no, r=oli-obk

Use line numbers relative to the function in mir-opt tests

As shown in #99770, the line numbers can be a big source of needless and confusing diffs. This PR adds a new flag `-Zmir-pretty-relative-line-numbers` to make them relative to the function declaration, which avoids most needless diffs from attribute changes.

`@JakobDegen` told me that there has been a zulip conversation about disabling line numbers with mixed opinions, so I'd like to get some feedback here, for this hopefully better solution.

r? rust-lang/wg-mir-opt

23 months agoadd more docs regarding ideographic numbers
Vincenzo Palazzo [Fri, 22 Jul 2022 22:48:45 +0000 (22:48 +0000)]
add more docs regarding ideographic numbers

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
23 months agofix memchr features in workspace-hack
klensy [Thu, 28 Jul 2022 14:24:46 +0000 (17:24 +0300)]
fix memchr features in workspace-hack

23 months agofix: remove fake no_dead_strip for osx
csmoe [Thu, 28 Jul 2022 14:22:13 +0000 (22:22 +0800)]
fix: remove fake no_dead_strip for osx

23 months agoanonymize all bound vars, not just regions
lcnr [Mon, 25 Jul 2022 18:24:13 +0000 (20:24 +0200)]
anonymize all bound vars, not just regions

23 months ago`BoundVarReplacer`: trait object instead of 3 fns
lcnr [Mon, 25 Jul 2022 17:27:52 +0000 (19:27 +0200)]
`BoundVarReplacer`: trait object instead of 3 fns

23 months agoAuto merge of #99849 - Dylan-DPC:rollup-1yfpplw, r=Dylan-DPC
bors [Thu, 28 Jul 2022 13:32:35 +0000 (13:32 +0000)]
Auto merge of #99849 - Dylan-DPC:rollup-1yfpplw, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #99714 (Fix regression introduced with #99383)
 - #99723 (Allow using stable os::fd::raw items through unstable os::wasi module)
 - #99810 (Fix settings slider on small width screens)
 - #99837 (Avoid `Symbol` to `String` conversions)
 - #99846 (Refactor `UnresolvedImportError`)

Failed merges:

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

23 months agoBuild rust demangler before running run-make tests
Tomasz Miąsko [Mon, 25 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Build rust demangler before running run-make tests

23 months agoDiagnose missing make includes
Tomasz Miąsko [Mon, 25 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Diagnose missing make includes

23 months agoMove coverage tests from run-make-fulldeps to run-make
Tomasz Miąsko [Mon, 25 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Move coverage tests from run-make-fulldeps to run-make

23 months agobless mir opt tests
Nilstrieb [Wed, 27 Jul 2022 18:47:42 +0000 (20:47 +0200)]
bless mir opt tests

23 months agoFix small typo in Cargo.toml comment
Yotam Ofek [Thu, 28 Jul 2022 11:29:58 +0000 (14:29 +0300)]
Fix small typo in Cargo.toml comment

23 months agoRollup merge of #99846 - TaKO8Ki:refactor-UnresolvedImportError, r=davidtwco
Dylan DPC [Thu, 28 Jul 2022 11:08:35 +0000 (16:38 +0530)]
Rollup merge of #99846 - TaKO8Ki:refactor-UnresolvedImportError, r=davidtwco

Refactor `UnresolvedImportError`

This patch changes the type of `note` field in `UnresolvedImportError` to `Option<String>`.

23 months agoRollup merge of #99837 - TaKO8Ki:avoid-symbol-to-string-conversions, r=fee1-dead
Dylan DPC [Thu, 28 Jul 2022 11:08:34 +0000 (16:38 +0530)]
Rollup merge of #99837 - TaKO8Ki:avoid-symbol-to-string-conversions, r=fee1-dead

Avoid `Symbol` to `String` conversions

follow-up to #99508

23 months agoRollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, r=notriddle
Dylan DPC [Thu, 28 Jul 2022 11:08:31 +0000 (16:38 +0530)]
Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, r=notriddle

Fix settings slider on small width screens

Fixes #99794.

Screenshot of the fix:

![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png)

cc `````@jsha`````
r? `````@notriddle`````

23 months agoRollup merge of #99723 - bstrie:wasifd, r=yaahc
Dylan DPC [Thu, 28 Jul 2022 11:08:31 +0000 (16:38 +0530)]
Rollup merge of #99723 - bstrie:wasifd, r=yaahc

Allow using stable os::fd::raw items through unstable os::wasi module

This fixes a regression from stable to nightly.

Closes #99502.

23 months agoRollup merge of #99714 - ouz-a:issue_57961, r=oli-obk
Dylan DPC [Thu, 28 Jul 2022 11:08:30 +0000 (16:38 +0530)]
Rollup merge of #99714 - ouz-a:issue_57961, r=oli-obk

Fix regression introduced with #99383

Fixes #99642

23 months agoRemove Clean trait implementation for VariantData fields
Guillaume Gomez [Thu, 28 Jul 2022 11:08:08 +0000 (13:08 +0200)]
Remove Clean trait implementation for VariantData fields

23 months agoRemove Clean trait implementation for VariantStruct
Guillaume Gomez [Thu, 28 Jul 2022 11:05:19 +0000 (13:05 +0200)]
Remove Clean trait implementation for VariantStruct

23 months agotype alias covers whole return
ouz-a [Thu, 28 Jul 2022 10:52:49 +0000 (13:52 +0300)]
type alias covers whole return

23 months agoAuto merge of #99756 - fasterthanlime:ra-sync-and-pms-component, r=Mark-Simulacrum
bors [Thu, 28 Jul 2022 10:51:46 +0000 (10:51 +0000)]
Auto merge of #99756 - fasterthanlime:ra-sync-and-pms-component, r=Mark-Simulacrum

Sync `rust-analyzer`, add `rust-analyzer-proc-macro-srv` binary to Rustc component

As discussed earlier with `@jyn514` and `@pietroalbini,` I'm also going to use this PR to have `dist::Rustc` build the `rust-analyzer-proc-macro-srv` binary introduced in:

  * https://github.com/rust-lang/rust-analyzer/pull/12871

23 months agoupdate few deps
klensy [Tue, 26 Jul 2022 16:16:43 +0000 (19:16 +0300)]
update few deps

openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q
openssl-probe v0.1.2 -> v0.1.5
indoc v1.0.3 -> v1.0.6
bstr v0.2.13 -> v0.2.17
crc32fast v1.2.0 -> v1.3.2
diff v0.1.12 -> v0.1.13
ignore v0.4.17 -> v0.4.18
globset v0.4.5 -> v0.4.9
regex v1.5.5 -> v1.5.6

23 months agoUse line numbers relative to function in mir opt tests
Nilstrieb [Wed, 27 Jul 2022 18:42:07 +0000 (20:42 +0200)]
Use line numbers relative to function in mir opt tests

This adds a new option, `-Zmir-pretty-relative-line-numbers`, that
is then used in compiletest for the mir-opt tests.

23 months agocreate type alias
ouz-a [Thu, 28 Jul 2022 09:56:57 +0000 (12:56 +0300)]
create type alias

23 months agoRemove Clean trait implementation for ty::Visibility
Guillaume Gomez [Thu, 28 Jul 2022 09:52:59 +0000 (11:52 +0200)]
Remove Clean trait implementation for ty::Visibility

23 months agoremove an unnecessary line break
Takayuki Maeda [Thu, 28 Jul 2022 09:28:29 +0000 (18:28 +0900)]
remove an unnecessary line break

23 months agoUpdate custom.md
xtexChooser [Thu, 28 Jul 2022 09:21:04 +0000 (17:21 +0800)]
Update custom.md

23 months agochange the type of `note` field to `Option<String>`
Takayuki Maeda [Thu, 28 Jul 2022 09:17:55 +0000 (18:17 +0900)]
change the type of `note` field to `Option<String>`

23 months agoAuto merge of #9253 - Serial-ATA:fix-fmt-err, r=flip1995
bors [Thu, 28 Jul 2022 07:54:15 +0000 (07:54 +0000)]
Auto merge of #9253 - Serial-ATA:fix-fmt-err, r=flip1995

Tell the user how to revert `dev setup intellij`

changelog: none

23 months agoTell the user how to revert `dev setup intellij`
Serial [Thu, 28 Jul 2022 07:40:21 +0000 (03:40 -0400)]
Tell the user how to revert `dev setup intellij`

23 months agoUse more idiomatic rust, comment for lint logic
Preston From [Thu, 28 Jul 2022 06:10:19 +0000 (00:10 -0600)]
Use more idiomatic rust, comment for lint logic

23 months agoavoid `Symbol` to `String` conversions
Takayuki Maeda [Thu, 28 Jul 2022 01:20:55 +0000 (10:20 +0900)]
avoid `Symbol` to `String` conversions

23 months agoAuto merge of #99182 - RalfJung:mitigate-uninit, r=scottmcm
bors [Thu, 28 Jul 2022 01:11:10 +0000 (01:11 +0000)]
Auto merge of #99182 - RalfJung:mitigate-uninit, r=scottmcm

mem::uninitialized: mitigate many incorrect uses of this function

Alternative to https://github.com/rust-lang/rust/pull/98966: fill memory with `0x01` rather than leaving it uninit. This is definitely bitewise valid for all `bool` and nonnull types, and also those `Option<&T>` that we started putting `noundef` on. However it is still invalid for `char` and some enums, and on references the `dereferenceable` attribute is still violated, so the generated LLVM IR still has UB -- but in fewer cases, and `dereferenceable` is hopefully less likely to cause problems than clearly incorrect range annotations.

This can make using `mem::uninitialized` a lot slower, but that function has been deprecated for years and we keep telling everyone to move to `MaybeUninit` because it is basically impossible to use `mem::uninitialized` correctly. For the cases where that hasn't helped (and all the old code out there that nobody will ever update), we can at least mitigate the effect of using this API. Note that this is *not* in any way a stable guarantee -- it is still UB to call `mem::uninitialized::<bool>()`, and Miri will call it out as such.

This is somewhat similar to https://github.com/rust-lang/rust/pull/87032, which proposed to make `uninitialized` return a buffer filled with 0x00. However
- That PR also proposed to reduce the situations in which we panic, which I don't think we should do at this time.
- The 0x01 bit pattern means that nonnull requirements are satisfied, which (due to references) is the most common validity invariant.

`@5225225` I hope I am using `cfg(sanitize)` the right way; I was not sure for which ones to test here.
Cc https://github.com/rust-lang/rust/issues/66151
Fixes https://github.com/rust-lang/rust/issues/87675

23 months agoAuto merge of #9182 - Serial-ATA:new_lint-type-flag, r=xFrednet
bors [Wed, 27 Jul 2022 22:17:29 +0000 (22:17 +0000)]
Auto merge of #9182 - Serial-ATA:new_lint-type-flag, r=xFrednet

Add `--type` flag to `dev new_lint`

changelog: none

This only works with directories, `--type={copies, doc, ...}` won't work. Should they be counted?

23 months agoAuto merge of #99725 - lcnr:dedup-region_bound_pairs, r=compiler-errors
bors [Wed, 27 Jul 2022 22:02:14 +0000 (22:02 +0000)]
Auto merge of #99725 - lcnr:dedup-region_bound_pairs, r=compiler-errors

use `FxIndexSet` for `region_bound_pairs`

should help with #99217 and might generally be a perf improvement.

r? types