Matthias Krüger [Thu, 22 Dec 2022 18:36:12 +0000 (19:36 +0100)]
Rollup merge of #105567 - TimNN:kcfi16, r=nikic
KCFI test: Also support LLVM 16 output
With a regex we can support the LLVM 16 output now already (and there are some third-party build bots that test Rust with LLVM head, like https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds?branch=master).
Nikita Popov [Tue, 20 Dec 2022 16:07:04 +0000 (17:07 +0100)]
Use LLVM_CMAKE_DIR for lld build
LLVM_CONFIG_PATH is no longer supported as of LLVM 16, switch to
using the cmake module instead.
We separately return the llvm-config and cmake directory paths,
because llvm-config always refers to the host binary, while
the cmake directory is for the target triple.
bors [Thu, 22 Dec 2022 11:06:51 +0000 (11:06 +0000)]
Auto merge of #106034 - matthiaskrgr:rollup-2zpql33, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #104741 (Switch `#[track_caller]` back to a no-op unless feature gate is enabled)
- #105769 (add function to tell the identical errors for ambiguity_errors)
- #105843 (Suggest associated const on possible capitalization mistake)
- #105966 (Re-enable `Fn` trait call notation error for non-tuple argument)
- #106002 (codegen tests: adapt patterns to also work with v0 symbol mangling)
- #106010 (Give opaque types a better coherence error)
- #106016 (rustdoc: simplify link anchor to section expand JS)
- #106024 (Fix ICE due to `todo!()` in `rustdoc` for `Term`s)
Matthias Krüger [Thu, 22 Dec 2022 10:03:51 +0000 (11:03 +0100)]
Rollup merge of #106002 - krasimirgg:v0sym, r=tmiasko
codegen tests: adapt patterns to also work with v0 symbol mangling
No functional changes intended.
These tests were failing under `new-symbol-mangling = true`, cf. https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/a.20few.20panic-abort.20tests.20fail.20under.20.60new-symbol-mangling.60.
This adapts the patterns to work in this case.
Matthias Krüger [Thu, 22 Dec 2022 10:03:50 +0000 (11:03 +0100)]
Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholk
add function to tell the identical errors for ambiguity_errors
if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical
prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
Matthias Krüger [Thu, 22 Dec 2022 10:03:49 +0000 (11:03 +0100)]
Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, r=compiler-errors
Switch `#[track_caller]` back to a no-op unless feature gate is enabled
This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate.
Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not.
bors [Thu, 22 Dec 2022 08:37:58 +0000 (08:37 +0000)]
Auto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddle
Fix impl block in const expr
Fixes #83026.
The problem was that we didn't visit block expressions. Considering how big the [walk_expr](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/intravisit.rs.html#678) function is, I decided to instead implement the `hir` visitor on the struct. It also answers the question which was in a comment for `RustdocVisitor`: we should have used a visitor instead of our ad-hoc implementation.
Adding this visitor also added some extra checks that weren't present before (check changes in `rustdoc-ui` tests).
bors [Thu, 22 Dec 2022 05:30:00 +0000 (05:30 +0000)]
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
Rollup of 6 pull requests
Successful merges:
- #105837 (Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity)
- #105932 (Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15)
- #105960 (Various cleanups)
- #105985 (Method chain nitpicks)
- #105996 (Test that async blocks are `UnwindSafe`)
- #106012 (Clarify that raw retags are not permitted in Mir)
bors [Thu, 22 Dec 2022 02:16:59 +0000 (02:16 +0000)]
Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
Rollup of 8 pull requests
Successful merges:
- #105584 (add assert messages if chunks/windows are length 0)
- #105602 (interpret: add read_machine_[ui]size convenience methods)
- #105824 (str.lines() docstring: clarify that line endings are not returned)
- #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment)
- #105986 (Fix typo in reading_half_a_pointer.rs)
- #105995 (Add regression test for #96530)
- #106008 (Sort lint_groups in no_lint_suggestion)
- #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about)
Matthias Krüger [Thu, 22 Dec 2022 00:01:13 +0000 (01:01 +0100)]
Rollup merge of #105932 - MasterAwesome:aarch64-bti-llvm-15, r=nikic
Correct branch-protection 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.
Yuki Okushi [Wed, 21 Dec 2022 23:32:12 +0000 (08:32 +0900)]
Rollup merge of #106008 - uweigand:s390x-lintgroup-order, r=Nilstrieb
Sort lint_groups in no_lint_suggestion
The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name. That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name.
However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x.
To fix this, always sort the lint groups before using their names as input to find_best_match_for_name. In doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order.
Yuki Okushi [Wed, 21 Dec 2022 23:32:10 +0000 (08:32 +0900)]
Rollup merge of #105824 - zacchiro:patch-1, r=JohnTitor
str.lines() docstring: clarify that line endings are not returned
Previously, the str.lines() docstring stated that lines are split at line endings, but not whether those were returned or not. This new version of the docstring states this explicitly, avoiding the need of getting to doctests to get an answer to this FAQ.
bors [Wed, 21 Dec 2022 23:20:04 +0000 (23:20 +0000)]
Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJung
Rename `assert_uninit_valid` intrinsic
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager.
bors [Wed, 21 Dec 2022 20:19:22 +0000 (20:19 +0000)]
Auto merge of #105979 - matthiaskrgr:rollup-2luw3mx, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #105791 (docs: add long error explanation for error E0472)
- #105897 (Fix an opaque type ICE)
- #105904 (Fix arch flag on i686-apple-darwin)
- #105949 (Bump `cfg-if` to `1.0` in rustc crates)
- #105964 (rustdoc: prevent CSS layout of line numbers shrinking into nothing)
- #105972 (rustdoc: simplify section anchor CSS)
- #105973 (Avoid going through the happy path in case of non-fn builtin calls)
- #105976 (Remove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu` make rule)
Ulrich Weigand [Wed, 21 Dec 2022 16:27:45 +0000 (17:27 +0100)]
Sort lint_groups in no_lint_suggestion
The no_lint_suggestion routine passes a vector of lint group names
to find_best_match_for_name. That routine depends on the sort
order of its input vector, which matters in case multiple inputs
are at the same Levenshtein distance to the target name.
However, no_lint_suggestion currently just passes lint_groups.keys()
as input vector - this is sorted in hash value order, which is not
guaranteed to be stable, and in fact differs between big- and
little-endian host platforms, causing test failures on s390x.
To fix this, always sort the lint groups before using their names
as input to find_best_match_for_name. In addition, deprecated
lint groups should never be suggested, so filter those out.
bors [Wed, 21 Dec 2022 14:27:57 +0000 (14:27 +0000)]
Auto merge of #100390 - jhpratt:float-from-bool, r=dtolnay
Implement `From<bool>` for f32, f64
As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version.
Bryan Garza [Thu, 24 Nov 2022 03:39:47 +0000 (03:39 +0000)]
Update code based on PR comments
This patch does the following:
- Refactor some repeated lines into a single one
- Split the `ungated_async_fn_caller` lint into multiple lines, and make
one of those lines only print out on nightly
- Use test revisions instead of copying an existing test
Bryan Garza [Tue, 22 Nov 2022 21:15:27 +0000 (21:15 +0000)]
Switch `#[track_caller]` back to a no-op unless feature gate is enabled
This patch fixes a regression, in which `#[track_caller]`, which was
previously a no-op, was changed to actually turn on the behavior. This
should instead only happen behind the `closure_track_caller` feature
gate.
Also, add a warning for the user to understand how their code will
compile depending on the feature gate being turned on or not.
Matthias Krüger [Tue, 20 Dec 2022 22:35:17 +0000 (23:35 +0100)]
Rollup merge of #105976 - jyn514:unused-make-targets, r=Mark-Simulacrum
Remove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu` make rule
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.
Matthias Krüger [Tue, 20 Dec 2022 22:35:17 +0000 (23:35 +0100)]
Rollup merge of #105973 - oli-obk:simplify_callee_checks, r=jackh726
Avoid going through the happy path in case of non-fn builtin calls
No functional change, just doing an early return. The removed comment is not applicable anymore, not every node needs type bindings in the error case. At best this would have been needed to avoid ICEs, but afaict this can't happen anymore today, as we do fallible checks.
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
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`)