| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #91172 (Warn when a `#[test]`-like built-in attribute macro is present multiple times.)
- #91796 (Fix since attribute for const_manually_drop feature)
- #91879 (Remove `in_band_lifetimes` from `rustc_borrowck`)
- #91947 (Add `io::Error::other`)
- #91967 (Pull in libdevstat on FreeBSD)
- #91987 (Add module documentation for rustdoc passes)
- #92001 (Fix default_method_body_is_const when used across crates)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix #91306 by deriving all access from a single *mut T
Fixes #91306.
The previous code is invalid because the first argument to `copy_nonoverlapping` is invalidated by the mutable borrow taken out to construct the second argument.
I believe this patch fixes that, and this code should now pass Miri with `-Ztag-raw-pointers`, ~~but I'm currently stuck trying to run my reproducer with a this patched version of the standard library (alternatively, running Miri on the standard library tests itself would suffice).~~ Ralf walked me through this on Zulip.
I've also added fixes for 7 more problems other than those I reported. Most of them are easy to hit by calling sort_unstable on random arrays. I don't have reproducers for every change, but they seem pretty clear-cut to me. But I did only start learning stacked borrows 2 days ago so that might be a large dash of Dunning-Kruger.
|
|
Fix default_method_body_is_const when used across crates
r? `@oli-obk`
unblocks #91439.
|
|
Add module documentation for rustdoc passes
These are currently documented at https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#hot-potato but can easily go out of date. We'd like to document them in place and link to https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/passes/index.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/moving.20pass.20docs/near/265058351).
r? `@camelid`
|
|
Pull in libdevstat on FreeBSD
Similar to https://github.com/rust-lang/rust/pull/90495, spotted in https://github.com/rust-lang/rust/pull/91909.
|
|
Add `io::Error::other`
This PR adds a small utility constructor, `io::Error::other`, a shorthand for `io::Error::new(io::ErrorKind::Other, err)`, something I find myself writing often.
For some concrete stats, a quick search on [grep.app](https://grep.app) shows that more than half of the uses of `io::Error::new` use `ErrorKind::Other`:
```
Error::new\((?:std::)?(?:io::)?ErrorKind:: => 3,898 results
Error::new\((?:std::)?(?:io::)?ErrorKind::Other => 2,186 results
```
|
|
Remove `in_band_lifetimes` from `rustc_borrowck`
See #91867 for more information.
|
|
Fix since attribute for const_manually_drop feature
const_manually_drop was stabilized in 1.32 as mentioned in
https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1320-2019-01-17
|
|
Warn when a `#[test]`-like built-in attribute macro is present multiple times.
Fixes #90979.
|
|
Most of these problems originate in use of get_unchecked_mut.
When calling ptr::copy_nonoverlapping, using get_unchecked_mut for both
arguments causes the borrow created to make the second pointer to invalid the
first.
The pairs of identical MaybeUninit::slice_as_mut_ptr calls similarly
invalidate each other.
There was also a similar borrow invalidation problem with the use of
slice::get_unchecked_mut to derive the pointer for the CopyOnDrop.
|
|
rustdoc: don't clone already owned `Path` and modify it inplace
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #91901 (Remove `in_band_lifetimes` from `rustc_symbol_mangling`)
- #91904 (Remove `in_band_lifetimes` from `rustc_trait_selection`)
- #91951 (update stdarch)
- #91958 (Apply rust-logo class only on default logo)
- #91972 (link to pref_align_of tracking issue)
- #91986 (Bump compiler-builtins to 0.1.66)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Bump compiler-builtins to 0.1.66
Adds intrinsics for truncdfsf2 and truncdfsf2vsp on ARM.
r? `@Amanieu`
|
|
link to pref_align_of tracking issue
If we are not going to remove this intrinsic (https://github.com/rust-lang/rust/pull/90877), I think we should at least have a place to centralize discussion around it, so here we go. Intrinsics don't have their own separate features and usually we instead use the public method for tracking it, but this one does not have such a method... so the tracking issue is just a regular link. (And then we sue it for the const part as well.)
|
|
Apply rust-logo class only on default logo
Fixes #91653.

Demo: https://rustdoc.crud.net/jsha/hashes/sha2/
r? ``@GuillaumeGomez``
|
|
update stdarch
2 commits in d219ad63c5075098fc224a57deb4852b9734327d..0716b22e902207efabe46879cbf28d0189ab7924
2021-12-9 23:50:37 +0000 to 2021-12-14 16:17:57 +0100
* Fix a bunch of typos ([Fix a bunch of typos stdarch#1267](https://github.com/rust-lang/stdarch/pull/1267))
* Stabilize armv8 neon instruction set on aarch64 ([Stabilize armv8 neon instruction set on aarch64 stdarch#1266](https://github.com/rust-lang/stdarch/pull/1266))
The update stabilizes armv8 neon instructions on aarch64. #90972
|
|
SylvanB:remove_in_band_lifetimes_rustc_trait_selection, r=petrochenkov
Remove `in_band_lifetimes` from `rustc_trait_selection`
Another one for #91867
|
|
SylvanB:remove_in_band_lifetimes_rustc_symbol_mangling, r=jackh726
Remove `in_band_lifetimes` from `rustc_symbol_mangling`
Helping out with #91867
|
|
Optimize `vec::retain` performance
This simply moves the loops into the inner function which leads to better results.
```
old:
test vec::bench_retain_100000 ... bench: 203,828 ns/iter (+/- 2,101)
test vec::bench_retain_iter_100000 ... bench: 63,324 ns/iter (+/- 12,305)
test vec::bench_retain_whole_100000 ... bench: 42,989 ns/iter (+/- 291)
new:
test vec::bench_retain_100000 ... bench: 42,180 ns/iter (+/- 451)
test vec::bench_retain_iter_100000 ... bench: 65,167 ns/iter (+/- 11,971)
test vec::bench_retain_whole_100000 ... bench: 33,736 ns/iter (+/- 12,404)
```
Measured on x86_64-unknown-linux-gnu, Zen2
Fixes #91497
|
|
These are currently documented at
https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#hot-potato
but can easily go out of date. We'd like to document them in place and
link to
https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/passes/index.html
|
|
Include rustc version in `rustc_span::StableCrateId`
`rustc_span::def_id::StableCrateId` is a hash of various data about a crate during compilation. This PR includes the version of `rustc` in the input when computing this hash. From a cursory reading of [RFC 2603](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html), this appears to be acceptable within that design.
In order to pass the `mir-opt` and `ui` test suites, this adds new [normalization for hashes and symbol names in `compiletest`](https://github.com/rust-lang/rust/pull/89836/files#diff-03a0567fa80ca04ed5a55f9ac5c711b4f84659be2d0ac4a984196d581c04f76b). These are enabled by default, but we might prefer it to be configurable.
In the UI tests, I had to truncate a significant amount of error annotations in v0 symbols (and maybe some legacy) in order to get the normalization to work correctly. (See https://github.com/rust-lang/rust/issues/90116.)
Closes #85142.
|
|
Adds intrinsics for truncdfsf2 and truncdfsf2vsp on ARM.
|
|
|
|
extend `simplify_type`
might cause a slight perf inprovement and imo more accurately represents what types there are.
considering that I was going to use this in #85048 it seems like we might need this in the future anyways :shrug:
|
|
|
|
|
|
Also replace ' with " in rustdoc template
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #91880 (fix clippy::single_char_pattern perf findings)
- #91885 (Remove `in_band_lifetimes` from `rustc_codegen_ssa`)
- #91898 (Make `TyS::is_suggestable` check for non-suggestable types structually)
- #91915 (Add another regression test for unnormalized fn args with Self)
- #91916 (Fix a bunch of typos)
- #91918 (Constify `bool::then{,_some}`)
- #91920 (Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`
This avoids a needless query invocation
|
|
fee1-dead:constification0-the-great-constification-begins, r=oli-obk
Constify `bool::then{,_some}`
Note on `~const Drop`: it has no effect when called from runtime functions, when called from const contexts, the trait system ensures that the type can be dropped in const contexts.
|
|
Fix a bunch of typos
I hope that none of these files is not supposed to be modified.
FYI, I opened separate PRs for typos in submodules, in the respective repositories
* https://github.com/rust-lang/stdarch/pull/1267
* https://github.com/rust-lang/backtrace-rs/pull/455
|
|
Add another regression test for unnormalized fn args with Self
Closes #91899
|
|
r=lcnr
Make `TyS::is_suggestable` check for non-suggestable types structually
Not sure if I went overboard checking substs in dyn types, etc. Let me know if I should simplify this function.
Fixes #91832
|
|
r=workingjubilee
Remove `in_band_lifetimes` from `rustc_codegen_ssa`
See #91867 for more information.
In `compiler/rustc_codegen_ssa/src/coverageinfo/map.rs`, there are several functions with an explicit `'a` lifetime but only a single `&'a self` parameter. These lifetimes should be redundant given lifetime elision, unless the existential `impl Iterator` has weird issues regarding that. Should the redundant lifetimes be removed?
|
|
fix clippy::single_char_pattern perf findings
|
|
Rollup of 7 pull requests
Successful merges:
- #90521 (Stabilize `destructuring_assignment`)
- #91479 (Add `[T]::as_simd(_mut)`)
- #91584 (Improve code for rustdoc-gui tester)
- #91886 (core: minor `Option` doc correction)
- #91888 (Handle unordered const/ty generics for object lifetime defaults)
- #91905 (Fix source code page sidebar on mobile)
- #91906 (Removed `in_band_lifetimes` from `library\proc_macro`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
anuvratsingh:remove_in_band_lifetimes_library_proc_macro, r=petrochenkov
Removed `in_band_lifetimes` from `library\proc_macro`
Issue [#91867](https://github.com/rust-lang/rust/issues/91867)
This is my first try, I followed the instructions given. Fixed all the errors that were thrown while compiling.
Compiled with stage 0,1, and 2 all of them compiled successfully.
|
|
Fix source code page sidebar on mobile
Current broken behaviour:
https://user-images.githubusercontent.com/3050060/145984316-35c82353-5bab-4dc6-9ac6-63ea7e5c27d8.mp4
Fixed:
https://user-images.githubusercontent.com/3050060/145984329-8be1127b-d707-424d-ac3c-c1fb3c48a093.mp4
r? `@jsha`
|
|
Handle unordered const/ty generics for object lifetime defaults
*feel like I should have a PR description but cant think of what to put here*
r? ```@lcnr```
|
|
core: minor `Option` doc correction
|
|
Improve code for rustdoc-gui tester
Following advice given in #91391.
It nicely improves the code readability. :)
r? `@jsha`
|
|
Add `[T]::as_simd(_mut)`
SIMD-style optimizations are the most common use for `[T]::align_to(_mut)`, but that's `unsafe`. So these are *safe* wrappers around it, now that we have the `Simd` type available, to make it easier to use.
```rust
impl [T] {
pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T]);
pub fn as_simd_mut<const LANES: usize>(&mut self) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T]);
}
```
They're `cfg`'d out for miri because the `simd` module as a whole is unavailable there.
|
|
r=jackh726,pnkfelix
Stabilize `destructuring_assignment`
Closes #71126
- [Stabilization report](https://github.com/rust-lang/rust/issues/71126#issuecomment-941148058)
- [Completed FCP](https://github.com/rust-lang/rust/issues/71126#issuecomment-954914819)
`@rustbot` label +F-destructuring-assignment +T-lang
Also needs +relnotes but I don't have permission to add that tag.
|