Move iter_results to dyn FnMut rather than a generic
This means that we're no longer generating the iteration/locking code for each invocation site of iter_results, rather just once per query (roughly), which seems much better: this is a 15% win in instruction counts when compiling the rustc_query_impl crate. The code where this is used also is pretty cold, I suspect; the old solution didn't fully monomorphize either.
Update LLVM for more wasm simd updates
This fixes the temporary regression introduced in #84339 where the wasm
target uses `fpto{s,u}i` intrinsics but the codegen for those intrinsics
with the `+nontrapping-fptoint` LLVM feature wasn't very good (aka it
didn't use the wasm instruction). The fixes brought in here fix that and
also implement the second-to-last simd instruction in LLVM.
This fixes the temporary regression introduced in #84339 where the wasm
target uses `fpto{s,u}i` intrinsics but the codegen for those intrinsics
with the `+nontrapping-fptoint` LLVM feature wasn't very good (aka it
didn't use the wasm instruction). The fixes brought in here fix that and
also implement the second-to-last simd instruction in LLVM.
Add std::os::unix::fs::chroot to change the root directory of the current process
This is a straightforward wrapper that uses the existing helpers for C
string handling and errno handling.
Having this available is convenient for UNIX utility programs written in
Rust, and avoids having to call the unsafe `libc::chroot` directly and
handle errors manually, in a program that may otherwise be entirely safe
code.
Reuse `sys::unix::cmath` on other platforms
Reuse `sys::unix::cmath` on all non-`windows` platforms.
`unix` is chosen as the canonical location instead of `unsupported` or `common` because `unsupported` doesn't make sense semantically and `common` is reserved for code that is supported on all platforms. Also `unix` is already the home of some non-`windows` code that is technically not exclusive to `unix` like `unix::path`.
This is a straightforward wrapper that uses the existing helpers for C
string handling and errno handling.
Having this available is convenient for UNIX utility programs written in
Rust, and avoids having to call the unsafe `libc::chroot` directly and
handle errors manually, in a program that may otherwise be entirely safe
code.
Implement RFC 1260 with feature_name `imported_main`.
This is the second extraction part of #84062 plus additional adjustments.
This (mostly) implements RFC 1260.
However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure.
cc https://github.com/rust-lang/rust/issues/28937
r? `@petrochenkov`
Rollup of 10 pull requests
Successful merges:
- #84451 (Use flex more consistently)
- #84590 (Point out that behavior might be switched on 2015 and 2018 too one day)
- #84682 (Don't rebind in `transitive_bounds_that_define_assoc_type`)
- #84683 (Minor grammar tweaks for readability to btree internals)
- #84688 (Remove unnecessary CSS rules for search results)
- #84690 (Remove unneeded bottom margin on search results)
- #84692 (Link between std::env::{var, var_os} and std::env::{vars, vars_os})
- #84705 (make feature recommendations optional)
- #84706 (Drop alias `reduce` for `fold` - we have a `reduce` function)
- #84713 (Fix labels for regression issue template)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Fix labels for regression issue template
Each label needs to be separated by a comma (see the ICE issue template
for an example of correct usage).
As a result of this problem, the `regression-untriaged` label has not
been automatically added to issues opened with this template.
See c127530be7 for another example of this.
r? `````@Mark-Simulacrum`````
Drop alias `reduce` for `fold` - we have a `reduce` function
Searching for "reduce" currently puts the `reduce` alias for `fold`
above the actual `reduce` function. The `reduce` function already has a
cross-reference for `fold`, and vice versa.
Link between std::env::{var, var_os} and std::env::{vars, vars_os}
In #84551 I linked between `std::env::{args, args_os}` and this PR does the same but for `std::env::{var, var_os}` and `std::env::{vars, vars_os}`. Now all of `std::env::{var, var_os, vars, vars_os, args, args_os}` should each mention their `_os` or non-`_os` equivalent in the docs so that you can easily navigate between them.
Minor grammar tweaks for readability to btree internals
I was reading through the btree implementation and I noticed some grammar that could be improved in Node.rs so here is what I think would be a minor improvement.
Point out that behavior might be switched on 2015 and 2018 too one day
Reword documentation to make it clear that behaviour can be switched on older editions too, one day in the future. It doesn't *have* to be switched, but I think it's good to have it as an option and re-evaluate it a few months/years down the line when e.g. the crates that showed up in crater were broken by different changes in the language already.
cc #25725, #65819, #66145, #84147 , and https://github.com/rust-lang/rust/issues/84133#issuecomment-818005314
Use flex more consistently
Builds on #84376, related to #84354.
- Fully replaces `float: right` with `flex` on `.content .out-of-band`.
- Uses `flex` more consistently with existing usage (on `h3`, `h4`, etc.).
Tested on various widths to make sure the pages behave as before.
This means that we're no longer generating the iteration/locking code for each
invocation site of iter_results, rather just once per query.
This is a 15% win in instruction counts when compiling the rustc_query_impl crate.
Each label needs to be separated by a comma (see the ICE issue template
for an example of correct usage).
As a result of this problem, the `regression-untriaged` label has not
been automatically added to issues opened with this template.
See c127530be7 for another example of this.
Revert PR 77885 everywhere
Change to probe-stack=call (instead of inline-or-call) everywhere again, for now.
We had already reverted the change on stable back in PR #83412.
Since then, we've had some movement on issue #83139, but not a 100% fix.
But also since then, we had bug reported, issue #84667, that looks like outright codegen breakage, rather than problems confined to debuginfo issues. So we are reverting PR #77885 on stable and beta. We'll reland PR #77885 (or some variant) switching back to an LLVM-dependent selection of out-of-line call vs inline-asm, after these other issues have been resolved.
We had already reverted the change on stable back in PR #83412.
Since then, we've had some movement on issue #83139, but not a 100% fix.
But also since then, we had bug reported, issue #84667, that looks like outright
codegen breakage, rather than problems confined to debuginfo issues.
So we are reverting PR #77885 on stable and beta. We'll reland PR #77885 (or some
variant) switching back to an LLVM-dependent selection of out-of-line call vs
inline-asm, after these other issues have been resolved.
Searching for "reduce" currently puts the `reduce` alias for `fold`
above the actual `reduce` function. The `reduce` function already has a
cross-reference for `fold`, and vice versa.
use correct feature flag for impl-block-level trait bounds on const fn
I am not sure what that special hack was needed for, but it doesn't seem needed any more...
This removes the last use of the `const_fn` feature flag -- Cc https://github.com/rust-lang/rust/issues/84510
r? `@oli-obk`
Add TRACKED_NO_CRATE_HASH and use it for `--remap-path-prefix`
I verified locally that this fixes https://github.com/rust-lang/rust/issues/66955.
r? `@Aaron1011` (feel free to reassign)
Implement `x.py test src/tools/clippy --bless`
- Add clippy_dev to the rust workspace
Before, it would give an error that it wasn't either included or
excluded from the workspace:
```
error: current package believes it's in a workspace when it's not:
current: /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml
workspace: /home/joshua/rustc/Cargo.toml
this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
```
- Change clippy's copy of compiletest not to special-case
rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find
the test outputs. This is one of the reasons why `cargo dev bless` used
to silently do nothing (the others were that `CARGO_TARGET_DIR` and
`PROFILE` weren't set appropriately).
- Run clippy_dev on test failure
I tested this by removing a couple lines from a stderr file, and they
were correctly replaced.
- Fix clippy_dev warnings
Fix failed tests related to pointer printing when using GDB 10
As mentioned in #79009, there are four failed debuginfo test cases when using GDB 10. This PR fixes two of them, which fail because GDB 10 won't print pointers as string anymore. We can use `printf` as a workaround. It should work regardless of the version of GDB.
Refer this [comment] for more details.
[comment]: https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708
Rollup of 11 pull requests
Successful merges:
- #84484 (Don't rebuild rustdoc and clippy after checking bootstrap)
- #84530 (`test tidy` should ignore alternative `build` dir patterns)
- #84531 (Ignore commented out lines when finding features)
- #84540 (Build sanitizers for x86_64-unknown-linux-musl)
- #84555 (Set `backtrace-on-ice` by default for compiler and codegen profiles)
- #84585 (Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`)
- #84636 (rustdoc: change aliases attribute to data-aliases)
- #84646 (Add some regression tests related to #82494)
- #84661 (Remove extra word in `rustc_mir` docs)
- #84663 (Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead)
- #84668 (Update books)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Update books
## reference
5 commits in e1abb17cd94cd5a8a374b48e1bc8134a2208ed48..d23f9da8469617e6c81121d9fd123443df70595d
2021-04-07 08:09:48 -0700 to 2021-04-28 11:16:44 -0700
- Document or-patterns (rust-lang-nursery/reference#957)
- fixed a typo in traits.md (rust-lang-nursery/reference#1009)
- Improve clarity and style consistency of crate type list (rust-lang-nursery/reference#1005)
- added macro_rules to weak keywords (rust-lang-nursery/reference#1008)
- Move non-ascii-idents content from unstable book to reference. (rust-lang-nursery/reference#999)
## book
1 commits in b54090a99ec7c4b46a5203a9c927fdbc311bb1f5..50dd06cb71beb27fdc0eebade5509cdcc1f821ed
2021-03-24 11:21:46 -0500 to 2021-04-23 13:21:54 -0500
- Update link in COPYRIGHT (http to https) (rust-lang/book#2704)
## rust-by-example
3 commits in c80f0b09fc15b9251825343be910c08531938ab2..e0a721f5202e6d9bec0aff99f10e44480c0da9e7
2021-04-08 10:28:17 -0300 to 2021-04-27 09:32:15 -0300
- broken long comments in src/types/cast.md to several shortones (rust-lang/rust-by-example#1430)
- Fix link of formatting traits (rust-lang/rust-by-example#1410)
- chore: Fix the indention of Borrowed definition (rust-lang/rust-by-example#1436)
## rustc-dev-guide
8 commits in a9bd2bbf31e4f92b5d3d8e80b22839d0cc7a2022..e72b43a64925ce053dc7830e21c1a57ba00499bd
2021-04-09 18:12:21 -0400 to 2021-04-27 12:35:37 -0700
- Suggest using `git range-diff` (rust-lang/rustc-dev-guide#1092)
- Remove the possible unnecessary flag
- Replace some Travis-related things completely
- Trigger GHA only on the original repo
- Add sample nix shell
- more RA config suggestions (rust-lang/rustc-dev-guide#1114)
- Add Polymorphisation paper (rust-lang/rustc-dev-guide#1093)
- Mention unpretty=mir-cfg for debugging MIR
Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead
`StaticMutex` is a mutex that when locked provides a guard that unlocks the mutex again when dropped, thus provides the exact same functionality as `DropGuard`. `StaticMutex` is used in more places, and is thus preferred over an ad-hoc construct like `DropGuard`.
````@rustbot```` label: +T-libs-impl
rustdoc: change aliases attribute to data-aliases
The "aliases" attribute is not listed [on MDN], so it sounds like it's rustdoc-specific. We don't want to conflict with any attributes that are added to the spec in the future.
[on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
Set `backtrace-on-ice` by default for compiler and codegen profiles
If there's an ICE while bootstrapping, it's most likely because of a change to the compiler.