Repository: astral-sh/ruff
File: crates/ty_python_semantic/src/types/call/bind.rs (Rust)

Code before:
        let signatures = &callable.signatures(self.db).overloads;
        if signatures.is_empty() {
            return false;
        }

        let sub_arguments = if let Some(argument_index) = argument_index {
            self.arguments.start_from(argument_index)
        } else {
            CallArguments::none()
        };

        // Create Bindings with all overloads and perform full overload resolution
        let callable_binding =
            CallableBinding::from_overloads(self.signature_type, signatures.iter().cloned());
        let bindings = match Bindings::from(callable_binding)
            .match_parameters(self.db, &sub_arguments)
            .check_types(self.db, &sub_arguments, self.call_expression_tcx, &[])
        {
            Ok(bindings) => bindings,
            Err(CallError(_, bindings)) => *bindings,
        };

        // SAFETY: `bindings` was created from a single `CallableBinding` above.
        let Some(callable_binding) = bindings.single_element() else {
            unreachable!("ParamSpec sub-call should only contain a single CallableBinding");
        };

        match callable_binding.matching_overload_index() {
            MatchingOverloadIndex::None => {
                if let [binding] = callable_binding.overloads() {
                    // This is not an overloaded function, so we can propagate its errors to the
                    // outer bindings.
                    self.errors.extend(binding.errors.iter().cloned());
                } else {
                    let index = callable_binding
                        .matching_overload_before_type_checking
                        .unwrap_or(0);
                    // TODO: We should also update the specialization for the `ParamSpec` to reflect
                    // the matching overload here.
                    self.errors
                        .extend(callable_binding.overloads()[index].errors.iter().cloned());
                }
            }
            MatchingOverloadIndex::Single(index) => {
                // TODO: We should also update the specialization for the `ParamSpec` to reflect the
                // matching overload here.
                self.errors
                    .extend(callable_binding.overloads()[index].errors.iter().cloned());
            }
            MatchingOverloadIndex::Multiple(_) => {
                if !matches!(

Review comment (suggestion):
```suggestion
        let callable_binding = bindings
            .single_element()
            .expect("ParamSpec sub-call should only contain a single CallableBinding");
```

Code after:
        let signatures = &callable.signatures(self.db).overloads;
        if signatures.is_empty() {
            return false;
        }

        let sub_arguments = if let Some(argument_index) = argument_index {
            self.arguments.start_from(argument_index)
        } else {
            CallArguments::none()
        };

        // Create Bindings with all overloads and perform full overload resolution
        let callable_binding =
            CallableBinding::from_overloads(self.signature_type, signatures.iter().cloned());
        let bindings = match Bindings::from(callable_binding)
            .match_parameters(self.db, &sub_arguments)
            .check_types(self.db, &sub_arguments, self.call_expression_tcx, &[])
        {
            Ok(bindings) => bindings,
            Err(CallError(_, bindings)) => *bindings,
        };

        // SAFETY: `bindings` was created from a single `CallableBinding` above.
        let callable_binding = bindings
            .single_element()
            .expect("ParamSpec sub-call should only contain a single CallableBinding");

        match callable_binding.matching_overload_index() {
            MatchingOverloadIndex::None => {
                if let [binding] = callable_binding.overloads() {
                    // This is not an overloaded function, so we can propagate its errors to the
                    // outer bindings.
                    self.errors.extend(binding.errors.iter().cloned());
                } else {
                    let index = callable_binding
                        .matching_overload_before_type_checking
                        .unwrap_or(0);
                    // TODO: We should also update the specialization for the `ParamSpec` to reflect
                    // the matching overload here.
                    self.errors
                        .extend(callable_binding.overloads()[index].errors.iter().cloned());
                }
            }
            MatchingOverloadIndex::Single(index) => {
                // TODO: We should also update the specialization for the `ParamSpec` to reflect the
                // matching overload here.
                self.errors
                    .extend(callable_binding.overloads()[index].errors.iter().cloned());
            }
            MatchingOverloadIndex::Multiple(_) => {
                if !matches!(