Unnamed repository; edit this file 'description' to name the repository.
Merge ref '7fb284d9037f' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@7fb284d9037fa54f6a9b24261c82b394472cbfd7 Filtered ref: rust-lang/rust-analyzer@a5454c1cd90c24a48670f429816f6c703a1c0e62 Upstream diff: https://github.com/rust-lang/rust/compare/942ac9ce4116d4ea784c9882659372b34978b1f8...7fb284d9037fa54f6a9b24261c82b394472cbfd7 This merge was created using https://github.com/rust-lang/josh-sync.
The rustc-josh-sync Cronjob Bot 2 weeks ago
parent 34244f4 · parent a5454c1 · commit 21f1cff
-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)
})
}