about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-12-18get_mut_span_in_struct_field uses span.betweenLucas Kent-9/+7
2021-12-17Improve suggestion to change struct field to &mutLucas Kent-35/+42
2021-12-16Auto merge of #92003 - matthiaskrgr:rollup-obgv0rt, r=matthiaskrgrbors-42/+250
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
2021-12-16Auto merge of #91616 - saethlin:sort_unchecked-sb-fix, r=Mark-Simulacrumbors-17/+20
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.
2021-12-16Rollup merge of #92001 - fee1-dead:dmbic-xcrate-fix, r=oli-obkMatthias Krüger-2/+24
Fix default_method_body_is_const when used across crates r? `@oli-obk` unblocks #91439.
2021-12-16Rollup merge of #91987 - jsha:docdocgoose, r=jyn514Matthias Krüger-0/+30
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`
2021-12-16Rollup merge of #91967 - lnicola:freebsd-devstat, r=kennytmMatthias Krüger-1/+1
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.
2021-12-16Rollup merge of #91947 - ibraheemdev:io-error-other, r=joshtriplettMatthias Krüger-0/+27
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 ```
2021-12-16Rollup merge of #91879 - bugadani:in_band_borrowck, r=wesleywiserMatthias Krüger-33/+32
Remove `in_band_lifetimes` from `rustc_borrowck` See #91867 for more information.
2021-12-16Rollup merge of #91796 - not-my-profile:fix-const_manually_drop-since, r=kennytmMatthias Krüger-2/+2
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
2021-12-16Rollup merge of #91172 - Ethiraric:ethiraric/fix90979, r=petrochenkovMatthias Krüger-4/+134
Warn when a `#[test]`-like built-in attribute macro is present multiple times. Fixes #90979.
2021-12-16Fix SB problems in slice sortingBen Kimock-17/+20
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.
2021-12-16Auto merge of #91833 - klensy:rd-minus-alloc, r=jyn514bors-11/+6
rustdoc: don't clone already owned `Path` and modify it inplace
2021-12-16Fix default_method_body_is_const when used across cratesDeadbeef-2/+24
2021-12-16Auto merge of #91996 - matthiaskrgr:rollup-8pdt8x7, r=matthiaskrgrbors-90/+109
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
2021-12-16Rollup merge of #91986 - ayrtonm:bump-builtins, r=AmanieuMatthias Krüger-3/+3
Bump compiler-builtins to 0.1.66 Adds intrinsics for truncdfsf2 and truncdfsf2vsp on ARM. r? `@Amanieu`
2021-12-16Rollup merge of #91972 - RalfJung:pref-align-of, r=Mark-SimulacrumMatthias Krüger-1/+2
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.)
2021-12-16Rollup merge of #91958 - jsha:rust-logo, r=GuillaumeGomezMatthias Krüger-18/+28
Apply rust-logo class only on default logo Fixes #91653. ![image](https://user-images.githubusercontent.com/220205/146138145-a7a62ea6-3205-4bc7-8460-e985284d93ea.png) Demo: https://rustdoc.crud.net/jsha/hashes/sha2/ r? ``@GuillaumeGomez``
2021-12-16Rollup merge of #91951 - SparrowLii:master, r=AmanieuMatthias Krüger-0/+0
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
2021-12-16Rollup merge of #91904 - ↵Matthias Krüger-54/+63
SylvanB:remove_in_band_lifetimes_rustc_trait_selection, r=petrochenkov Remove `in_band_lifetimes` from `rustc_trait_selection` Another one for #91867
2021-12-16Rollup merge of #91901 - ↵Matthias Krüger-14/+13
SylvanB:remove_in_band_lifetimes_rustc_symbol_mangling, r=jackh726 Remove `in_band_lifetimes` from `rustc_symbol_mangling` Helping out with #91867
2021-12-16Auto merge of #91527 - the8472:retain-opt, r=dtolnaybors-34/+46
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
2021-12-15Add module documentation for rustdoc passesJacob Hoffman-Andrews-0/+30
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
2021-12-16Auto merge of #89836 - pierwill:fix-85142-crate-hash, r=wesleywiserbors-205/+333
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.
2021-12-15Bump compiler-builtins to 0.1.66Ayrton-3/+3
Adds intrinsics for truncdfsf2 and truncdfsf2vsp on ARM.
2021-12-15Add a lint for duplicated attributes.Ethiraric-4/+134
2021-12-15Auto merge of #86986 - lcnr:simplify_type, r=nikomatsakis,oli-obkbors-80/+179
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:
2021-12-15Remove `in_band_lifetimes` from `rustc_symbol_mangling`Sylvan Bowdler-14/+13
2021-12-15Remove `in_band_lifetimes` from `rustc_trait_selection`Sylvan Bowdler-54/+63
2021-12-15Apply rust-logo class only on default logoJacob Hoffman-Andrews-18/+28
Also replace ' with " in rustdoc template
2021-12-15link to pref_align_of tracking issueRalf Jung-1/+2
2021-12-15Pull in libdevstat on FreeBSDLaurențiu Nicola-1/+1
2021-12-15Auto merge of #91962 - matthiaskrgr:rollup-2g082jw, r=matthiaskrgrbors-210/+283
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
2021-12-15Rollup merge of #91920 - Aaron1011:pred-stable-cmp, r=oli-obkMatthias Krüger-1/+1
Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp` This avoids a needless query invocation
2021-12-15Rollup merge of #91918 - ↵Matthias Krüger-2/+26
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.
2021-12-15Rollup merge of #91916 - steffahn:fix-typos, r=dtolnayMatthias Krüger-55/+55
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
2021-12-15Rollup merge of #91915 - jackh726:issue-91899, r=Mark-SimulacrumMatthias Krüger-0/+37
Add another regression test for unnormalized fn args with Self Closes #91899
2021-12-15Rollup merge of #91898 - compiler-errors:dont_suggest_closure_return_type, ↵Matthias Krüger-99/+112
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
2021-12-15Rollup merge of #91885 - LegionMammal978:less-inband-codegen_ssa, ↵Matthias Krüger-17/+16
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?
2021-12-15Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514Matthias Krüger-36/+36
fix clippy::single_char_pattern perf findings
2021-12-15Auto merge of #91959 - matthiaskrgr:rollup-rhajuvw, r=matthiaskrgrbors-424/+272
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
2021-12-15update testslcnr-4/+6
2021-12-15Remove in_band_lifetimes from borrowckDániel Buga-33/+32
2021-12-15Rollup merge of #91906 - ↵Matthias Krüger-11/+10
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.
2021-12-15Rollup merge of #91905 - GuillaumeGomez:source-code-page-sidebar, r=jshaMatthias Krüger-2/+42
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`
2021-12-15Rollup merge of #91888 - BoxyUwU:generic_arg_infer_aaaa, r=lcnrMatthias Krüger-21/+30
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```
2021-12-15Rollup merge of #91886 - euclio:option-doc, r=dtolnayMatthias Krüger-2/+2
core: minor `Option` doc correction
2021-12-15Rollup merge of #91584 - GuillaumeGomez:improve-rustdoc-gui-tester-code, r=jshaMatthias Krüger-5/+5
Improve code for rustdoc-gui tester Following advice given in #91391. It nicely improves the code readability. :) r? `@jsha`
2021-12-15Rollup merge of #91479 - scottmcm:slice-as-simd, r=workingjubileeMatthias Krüger-0/+119
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.
2021-12-15Rollup merge of #90521 - jhpratt:stabilize-destructuring_assignment, ↵Matthias Krüger-383/+64
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.