Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #158455 - JonathanBrouwer:rollup-3fPbHms, r=JonathanBrouwer
Rollup of 15 pull requests Successful merges: - rust-lang/rust#153697 (Add arg splat experiment initial tuple impl) - rust-lang/rust#158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - rust-lang/rust#158438 (Use rigidness marker in fast_reject) - rust-lang/rust#157127 (cg_LLVM: Stop needing an alloca for volatile loads) - rust-lang/rust#158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - rust-lang/rust#158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - rust-lang/rust#158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - rust-lang/rust#158355 (Fixup the refactoring errors in rust-lang/rust#156246) - rust-lang/rust#158361 (Move `check_ffi_pure` into the attribute parser) - rust-lang/rust#158382 (Add safety section for SliceIndex::get_unchecked(mut)) - rust-lang/rust#158399 (std: truncate thread names on NetBSD) - rust-lang/rust#158418 (Eliminate double length check in `Vec::into_array`) - rust-lang/rust#158430 (Guard clone suggestion against empty obligation errors) - rust-lang/rust#158446 (Update Enzyme submodule) - rust-lang/rust#158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
bors 3 weeks ago
parent 256413f · parent 50fdd69 · commit ba04457
-rw-r--r--crates/hir-ty/src/infer/callee.rs2
-rw-r--r--crates/hir-ty/src/lib.rs1
-rw-r--r--crates/hir-ty/src/lower.rs1
-rw-r--r--crates/hir-ty/src/next_solver/interner.rs1
-rw-r--r--crates/hir-ty/src/next_solver/ty.rs1
5 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer/callee.rs b/crates/hir-ty/src/infer/callee.rs
index 057ba7fa86..a661731e60 100644
--- a/crates/hir-ty/src/infer/callee.rs
+++ b/crates/hir-ty/src/infer/callee.rs
@@ -173,6 +173,8 @@ impl<'db> InferenceContext<'_, 'db> {
// impl forces the closure kind to `FnOnce` i.e. `u8`.
let kind_ty = autoderef.ctx().table.next_ty_var(call_expr.into());
let interner = autoderef.ctx().interner();
+
+ // Ignore splatting, it is unsupported on closures.
let call_sig = interner.mk_fn_sig(
[coroutine_closure_sig.tupled_inputs_ty],
coroutine_closure_sig.to_coroutine(
diff --git a/crates/hir-ty/src/lib.rs b/crates/hir-ty/src/lib.rs
index cc48ba06db..1fddfc09c6 100644
--- a/crates/hir-ty/src/lib.rs
+++ b/crates/hir-ty/src/lib.rs
@@ -464,6 +464,7 @@ pub fn callable_sig_from_fn_trait<'db>(
args.tuple_fields(),
ret,
false,
+ // FIXME(splat): handle splatted arguments
Safety::Safe,
ExternAbi::Rust,
));
diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs
index fae63ddc2d..d63ac7f7a0 100644
--- a/crates/hir-ty/src/lower.rs
+++ b/crates/hir-ty/src/lower.rs
@@ -637,6 +637,7 @@ impl<'db, 'a> TyLoweringContext<'db, 'a> {
fn_.abi,
if fn_.is_unsafe { Safety::Unsafe } else { Safety::Safe },
fn_.is_varargs,
+ // FIXME(splat): handle splatted arguments
),
inputs_and_output: Tys::new_from_slice(&args),
}),
diff --git a/crates/hir-ty/src/next_solver/interner.rs b/crates/hir-ty/src/next_solver/interner.rs
index ef626fc0c8..3c2976eccd 100644
--- a/crates/hir-ty/src/next_solver/interner.rs
+++ b/crates/hir-ty/src/next_solver/interner.rs
@@ -2238,6 +2238,7 @@ impl<'db> DbInterner<'db> {
self.replace_escaping_bound_vars_uncached(value.skip_binder(), delegate)
}
+ // FIXME: add splat support when the experiment is complete
pub fn mk_fn_sig<I>(
self,
inputs: I,
diff --git a/crates/hir-ty/src/next_solver/ty.rs b/crates/hir-ty/src/next_solver/ty.rs
index fe31d44207..d57d824e32 100644
--- a/crates/hir-ty/src/next_solver/ty.rs
+++ b/crates/hir-ty/src/next_solver/ty.rs
@@ -1514,6 +1514,7 @@ impl<'db> DbInterner<'db> {
TyKind::Tuple(params) => params,
_ => panic!(),
};
+ // Ignore splatting, it is unsupported on closures.
self.mk_fn_sig(params, s.output(), s.c_variadic(), safety, ExternAbi::Rust)
})
}