Fix splat ICEs and ban it in closures#158645
Conversation
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| Extern::Explicit(abi_str, span) | ||
| if abi_str.symbol_unescaped.as_str() == "rust-call" => | ||
| { | ||
| SplatSemantic::NoRustCall(span) | ||
| } | ||
| Extern::Explicit(_abi_str, _span) => SplatSemantic::Yes, |
There was a problem hiding this comment.
| Extern::Explicit(abi_str, span) | |
| if abi_str.symbol_unescaped.as_str() == "rust-call" => | |
| { | |
| SplatSemantic::NoRustCall(span) | |
| } | |
| Extern::Explicit(_abi_str, _span) => SplatSemantic::Yes, | |
| Extern::Explicit(abi_str, span) => match abi_str.symbol_unescaped { | |
| sym::rust_dash_call => SplatSemantic::NoRustCall(span), | |
| _ => SplatSemantic::Yes, | |
| }, |
There was a problem hiding this comment.
and add a comment on why here too perhaps?
There was a problem hiding this comment.
I think the rust_dash_call symbol only exists in rust-analyzer, not in the compiler, but I did add the comment.
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
A first pass. Overall this PR seems kind of large, it would be easier to review if split up into smaller chunks.
Yeah I wondered about that, I'll split it up today, now I know which parts actually fail in CI.
@rustbot label +F-splat +I-ICE +T-compiler +C-bug
|
I split the extra tests into PR #158677, most of them didn't need any compiler changes to work, so they are fine to merge separately. |
This comment has been minimized.
This comment has been minimized.
|
Error: Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
@rustbot ready |
…eywiser Add extra splat tests This PR is part of the splat lang experiment rust-lang#153629. It adds a bunch of tests for existing splat functionality, but doesn't make any compiler code changes. Edit: split off from PR rust-lang#158645 @rustbot label +F-splat +T-compiler
| TyKind::FnPtr(bfty) => { | ||
| self.check_fn_ptr_safety(bfty.decl_span, bfty.safety); | ||
| self.check_fn_decl(&bfty.decl, SelfSemantic::No); | ||
| self.check_fn_decl(&bfty.decl, SelfSemantic::No, SplatSemantic::Yes); |
There was a problem hiding this comment.
This is wrong because FnPtrs can be rust-call, I'll add a test
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=511e43db9905a3a38acb86b175535fe2
@rustbot author
…uwer Rollup of 18 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - #158902 (add codegen test for range length bound propagation) - #158913 (Update `browser-ui-test` version to `0.24.1`) - #158935 (std: support real fd methods on Emscripten) - #158951 (Merge three `MaxUniverse`s into one)
…uwer Rollup of 18 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - #158902 (add codegen test for range length bound propagation) - #158913 (Update `browser-ui-test` version to `0.24.1`) - #158935 (std: support real fd methods on Emscripten) - #158951 (Merge three `MaxUniverse`s into one)
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
…uwer Rollup of 25 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #158968 (stdarch subtree update) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158912 (Introduce new bootstrap config section for PGO configuration) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #158307 (CI job for parallel frontend ui tests) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158741 (Simplify `Option::into_flat_iter` signature) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158883 (tests: fix enum-match.rs to handle LLVM 23)
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
Rollup of 25 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #158968 (stdarch subtree update) - #157690 (codegen_ssa: pack small const aggregates into immediate stores) - #158541 (Move `std::io::Write` to `core::io`) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158870 (std: merge the unix-like io::error modules into one file) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156144 (Better docs for PartialEq (includes macro rename)) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #158307 (CI job for parallel frontend ui tests) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158741 (Simplify `Option::into_flat_iter` signature)
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
…uwer Rollup of 17 pull requests Successful merges: - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #155429 (Support `u128`/`i128` c-variadic arguments) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158535 (Support `#[track_caller]` on EII declarations) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places")
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment #153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close #158482 Improves the message and error handling in another ICE (but doesn't fix it): cc #158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close #158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc #158644~~
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
…uwer Rollup of 21 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #155429 (Support `u128`/`i128` c-variadic arguments) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159005 (Use `as_lang_item` instead of repeatedly matching)
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
…uwer Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes)
Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment rust-lang#153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close rust-lang#158482 Improves the message and error handling in another ICE (but doesn't fix it): cc rust-lang#158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close rust-lang#158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc rust-lang#158644~~
Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158541 (Move `std::io::Write` to `core::io`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158960 (Fix bootstrap submodule path prefix matching) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159036 (bootstrap: expand '@argfile' arguments to rustc shim)
Rollup merge of #158645 - teor2345:splat-fn-fixes, r=folkertdev Fix splat ICEs and ban it in closures This PR is part of the splat lang experiment #153629. It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs: Close #158482 Improves the message and error handling in another ICE (but doesn't fix it): cc #158603 And bans splat on closures and rust-call, because they already de-tuple arguments: Close #158605 ~~In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet): cc #158644~~
View all comments
This PR is part of the splat lang experiment #153629.
It fixes one ICE, and cleans up the surrounding error handling to avoid future ICEs:
Close #158482
Improves the message and error handling in another ICE (but doesn't fix it):
cc #158603
And bans splat on closures and rust-call, because they already de-tuple arguments:
Close #158605
In the process I discovered another symbol mangling bug with splatting, which I added a test for (but didn't fix yet):cc #158644