Matthias Krüger [Tue, 20 Dec 2022 22:35:15 +0000 (23:35 +0100)]
Rollup merge of #105897 - oli-obk:tait_patterns, r=TaKO8Ki
Fix an opaque type ICE
fixes #104551
The issue is that if you have
```rust
type T = impl Sized;
let (_a, _b): T = ..
```
we have only the type annotation `T`, but want to use that ascription for `_a` and `_b`, so what we generate is a type ascription plus a field projection saying `_a`'s type is `T::0`. Of course `T` has no fields. Of course we could also not generate type annotations for projections into opaque types at all, but that's more fragile, as we now have to make sure that https://github.com/rust-lang/rust/blob/12bbdbdb440119a0b86d2ee742ec1460cdb2c5b9/compiler/rustc_mir_build/src/build/matches/mod.rs#L709 doesn't have any arm that introduces a user type annotation except for `PatKind::Binding`.
It's not used anywhere in CI, and it seems of questionable use.
It was first added in 0e272de69f4a9c889e5f1a024a88b3e1f60cb6c5, which looks like it's just intended for CI, not as a user-facing feature.
bors [Tue, 20 Dec 2022 17:09:11 +0000 (17:09 +0000)]
Auto merge of #105381 - uweigand:s390x-ffi-vaarg, r=nikic
Implement va_list and va_arg for s390x FFI
Following the s390x ELF ABI and based on the clang implementation, provide appropriate definitions of va_list in library/core/src/ffi/mod.rs and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs.
Fixes the following test cases on s390x:
src/test/run-make-fulldeps/c-link-to-rust-va-list-fn src/test/ui/abi/variadic-ffi.rs
`packed_simd_2` is only used as a dependency `bytecount`. The bigger jump is `getrandom@0.2.0`, but it's still semver compatible and there doesn't seem to be any worrying changes (see the [changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)). Note that this doesn't affect `getrandom@0.1.16`, which is already using the latest version of `cfg-if` (besides, there are already plans to remove that entirely).
bors [Tue, 20 Dec 2022 13:58:08 +0000 (13:58 +0000)]
Auto merge of #105951 - matthiaskrgr:rollup-aqxz888, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #105835 (Refactor post borrowck cleanup passes)
- #105930 (Disable `NormalizeArrayLen`)
- #105938 (Update coerce_unsized tracking issue from #27732 to #18598)
- #105939 (Improve description of struct-fields GUI test)
- #105943 (Add regression test for #102206)
- #105944 (Add regression test for #80816)
- #105945 (Add regression test for #57404)
bors [Tue, 20 Dec 2022 10:20:27 +0000 (10:20 +0000)]
Auto merge of #105940 - matthiaskrgr:rollup-ho4po1t, r=matthiaskrgr
Rollup of 5 pull requests
Successful merges:
- #105901 (Don't panic on stable since miri is not available there)
- #105912 (rustdoc: force pre tags to have the default line height)
- #105914 (rustdoc: Simplify CSS for scraped code examples code blocks)
- #105933 (Add readable rustdoc display for tvOS and watchOS)
- #105935 (docs/test: add UI test and long-form error docs for `E0377`)
Arvind Mukund [Tue, 20 Dec 2022 03:06:30 +0000 (19:06 -0800)]
Correct ModFlagBehavior for Aarch64 on LLVM-15
When building with Fat LTO and BTI enabled on aarch64, the BTI is set to
`Module::Min` for alloc shim but is set to `Module::Error` for the
crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's
behaviour to support for compiling with different `mbranch-protection`
flags.
bors [Tue, 20 Dec 2022 01:06:52 +0000 (01:06 +0000)]
Auto merge of #105918 - matthiaskrgr:rollup-mmazd62, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #105801 (Realistic `Path::as_mut_os_str` doctest)
- #105860 (Add long error docs for `E0460` and `E0457`)
- #105895 (Test that we don't add a new kind of breaking change with TAITs)
- #105902 (docs: improve pin docs)
- #105910 (Update books)
- #105913 (rustdoc: remove width-limiter from source pages, stop overriding CSS)
- #105915 (Revert "Replace usage of `ResumeTy` in async lowering with `Context`")
bors [Mon, 19 Dec 2022 22:37:12 +0000 (22:37 +0000)]
Auto merge of #105905 - lqd:revert-103880, r=jackh726
Revert #103880 "Use non-ascribed type as field's type in mir"
This PR prepares a revert for #103880 to fix #105809, #105881, #105886 and others (like the duplicates of the first one), in case an actual fix can't get done today.
I've also added the MCVE from #105809. There is no MCVE for the #105881 and #105886 ICEs yet however, so there are no tests for them here, although we'll need one before relanding the original changes.
Were this PR to land, it would also reopen #96514 as it was fixed by the original PR.
Opening as draft to allow time for a possible fix.
Ulrich Weigand [Tue, 6 Dec 2022 16:36:09 +0000 (17:36 +0100)]
Implement va_list and va_arg for s390x FFI
Following the s390x ELF ABI and based on the clang implementation,
provide appropriate definitions of va_list in library/core/src/ffi/mod.rs
and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs.
Fixes the following test cases on s390x:
src/test/run-make-fulldeps/c-link-to-rust-va-list-fn
src/test/ui/abi/variadic-ffi.rs
Matthias Krüger [Mon, 19 Dec 2022 19:55:00 +0000 (20:55 +0100)]
Rollup merge of #105915 - andrewpollack:revert-105250-async-rm-resumety, r=tmandry
Revert "Replace usage of `ResumeTy` in async lowering with `Context`"
Reverts rust-lang/rust#105250 Fixes: #105501
Following instructions from [forge](https://forge.rust-lang.org/compiler/reviews.html#reverts).
This change introduced a breaking change that is not actionable nor relevant, and is blocking updates to our toolchain. Along with other comments on the CL marking issues that are fixed by reverts, reverting is best until these issues can be resolved
- Add -Ztrack-diagnostics information (rust-lang/rustc-dev-guide#1506)
- Add documentation for LLVM KCFI support (rust-lang/rustc-dev-guide#1529)
- Replace references to NoLandingPads in MIR pass documents (rust-lang/rustc-dev-guide#1531)
- share same link (rust-lang/rustc-dev-guide#1530)
- chore: Update `actions/github-script` to v6 (rust-lang/rustc-dev-guide#1521)
- fix: Fix broken links (rust-lang/rustc-dev-guide#1522)
- Remove TyS (rust-lang/rustc-dev-guide#1526)
- Fix small inaccuracy in monomorph page (rust-lang/rustc-dev-guide#1525)
Matthias Krüger [Mon, 19 Dec 2022 19:54:57 +0000 (20:54 +0100)]
Rollup merge of #105801 - zertosh:path_mut_os_str_doc_test, r=dtolnay
Realistic `Path::as_mut_os_str` doctest
With "Implement DerefMut for PathBuf" (#105018) now merged, it's
possible to exercise `Path::as_mut_os_str` (#105002) without going
through `into_boxed_path`.
bors [Mon, 19 Dec 2022 16:46:57 +0000 (16:46 +0000)]
Auto merge of #105698 - joboet:unsupported_threads_once, r=thomcc
Use a more efficient `Once` on platforms without threads
The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.
Yiming Lei [Fri, 16 Dec 2022 06:25:11 +0000 (22:25 -0800)]
add function to tell if the current ambiguity error matches a previous one in ambiguity_errors
if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same
then these 2 ambiguity errors matched
prevent identical ambiguity error from pushing into vector of ambiguity_errors
this will fix #105177
Dylan DPC [Mon, 19 Dec 2022 09:11:35 +0000 (14:41 +0530)]
Rollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnr
Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators
Right now, we suggest a `T: Sync` bound for both `&T` and `&mut T` upvars. A user on URLO [found this confusing](https://users.rust-lang.org/t/error-complains-about-missing-sync-but-send-is-whats-missing/86021), so I wrote this quick fix to look at the mutability before making the suggestion.
Dylan DPC [Mon, 19 Dec 2022 09:11:34 +0000 (14:41 +0530)]
Rollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung
Use `expose_addr()` in `fmt::Pointer`
Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided).
bors [Mon, 19 Dec 2022 06:25:22 +0000 (06:25 +0000)]
Auto merge of #105845 - lqd:revert-thinlto-revert, r=Mark-Simulacrum
Re-enable ThinLTO for rustc on `x86_64-apple-darwin`
ThinLTO was disabled on x64 mac in https://github.com/rust-lang/rust/pull/105646 because of the https://github.com/rust-lang/rust/issues/105637 regression.
It was later discovered that the issue was present on other targets as well, as the mac revert was already landing. The linux/win reverts, however, did not land before the root cause was identified.
https://github.com/rust-lang/rust/pull/105800 fixed the underlying issue in `-Zdylib-lto` handling, and the x64 msvc and linux targets are now fixed, ICEs are using the correct `rustc_driver` panic hook.
This PR re-enables ThinLTO on mac for improved perf now that the issue should be fixed everywhere.
bors [Mon, 19 Dec 2022 03:36:34 +0000 (03:36 +0000)]
Auto merge of #105884 - weihanglo:update-cargo, r=weihanglo
Update cargo
11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415 2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)
bors [Mon, 19 Dec 2022 01:13:58 +0000 (01:13 +0000)]
Auto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #105419 (Add tests for #41731)
- #105447 (Add a test for #103095)
- #105842 (print argument name in arg mismatch if possible)
- #105863 (Update browser-ui-test version to reduce GUI tests flakyness)
- #105867 (remove redundant fn params that were only "used" in recursion)
- #105869 (don't clone Copy types)
- #105873 (use &str / String literals instead of format!())
- #105879 (Revert "Introduce lowering_arena to avoid creating AST nodes on the fly")
Weihang Lo [Sun, 18 Dec 2022 23:39:39 +0000 (23:39 +0000)]
Update cargo
11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415
2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)