Skip to content

Commit 7a7dea1

Browse files
Fix rustfmt formatting after merge
1 parent 850f500 commit 7a7dea1

4 files changed

Lines changed: 40 additions & 40 deletions

File tree

‎pyrefly/lib/alt/callable.rs‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -947,15 +947,16 @@ fn guarded_param_subject(
947947
argmap: &ArgMap,
948948
keywords: &[CallKeyword],
949949
) -> Option<GuardSubject> {
950-
let designated = params
951-
.items()
952-
.get(usize::from(has_self_arg))
953-
.and_then(|param| match param {
954-
Param::Pos(name, _, _) | Param::PosOnly(Some(name), _, _) => Some(name),
955-
// Positional-only parameters without a name can't be looked up, and a
956-
// `TypeGuard`/`TypeIs` designation never lands on other parameter kinds.
957-
_ => None,
958-
})?;
950+
let designated =
951+
params
952+
.items()
953+
.get(usize::from(has_self_arg))
954+
.and_then(|param| match param {
955+
Param::Pos(name, _, _) | Param::PosOnly(Some(name), _, _) => Some(name),
956+
// Positional-only parameters without a name can't be looked up, and a
957+
// `TypeGuard`/`TypeIs` designation never lands on other parameter kinds.
958+
_ => None,
959+
})?;
959960
let (argument, _) = argmap
960961
.arg_to_param
961962
.iter()
@@ -2699,8 +2700,7 @@ impl<'ctx, 'answer, Ans: LookupAnswer> AnswersSolver<'ctx, 'answer, Ans> {
26992700
context,
27002701
&call_context,
27012702
);
2702-
let guard_subject =
2703-
guarded_param_subject(&params, has_self_arg, &argmap, keywords);
2703+
let guard_subject = guarded_param_subject(&params, has_self_arg, &argmap, keywords);
27042704
(argmap, guard_subject)
27052705
}
27062706
Params::Ellipsis | Params::Materialization => {

‎pyrefly/lib/alt/narrow.rs‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,12 +729,7 @@ impl<'ctx, 'answer, Ans: LookupAnswer> AnswersSolver<'ctx, 'answer, Ans> {
729729
/// the callee's `TypeGuard`/`TypeIs` result. The call is resolved with the ordinary
730730
/// call machinery (argument matching included, errors swallowed), and the guarded
731731
/// argument comes from the same resolution as the result.
732-
fn keyword_is_guard_subject(
733-
&self,
734-
func_ty: &Type,
735-
call: &NarrowingCall,
736-
kws: &[Name],
737-
) -> bool {
732+
fn keyword_is_guard_subject(&self, func_ty: &Type, call: &NarrowingCall, kws: &[Name]) -> bool {
738733
let CallTargetLookup::Ok(call_target) = self.as_call_target(func_ty.clone()) else {
739734
return false;
740735
};

‎pyrefly/lib/alt/overload.rs‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,25 +1196,32 @@ impl<'ctx, 'answer, Ans: LookupAnswer> AnswersSolver<'ctx, 'answer, Ans> {
11961196

11971197
let arg_errors = self.error_collector();
11981198
let call_errors = self.error_collector();
1199-
let (res, specialization_errors, return_type_errors, argmap, defaults_used, table, guard_subject) =
1200-
self.callable_infer(
1201-
callable.1.signature.clone(),
1202-
Some(&metadata.kind),
1203-
tparams,
1204-
self_obj.cloned(),
1205-
args,
1206-
keywords,
1207-
arguments_range,
1208-
&arg_errors,
1209-
&call_errors,
1210-
// We intentionally drop the context here, as arg errors don't need it,
1211-
// and if there are any call errors, we'll log a "No matching overloads"
1212-
// error with the necessary context.
1213-
None,
1214-
hint,
1215-
contextually_opaque_defaults,
1216-
overload_ctor_targs.as_mut(),
1217-
);
1199+
let (
1200+
res,
1201+
specialization_errors,
1202+
return_type_errors,
1203+
argmap,
1204+
defaults_used,
1205+
table,
1206+
guard_subject,
1207+
) = self.callable_infer(
1208+
callable.1.signature.clone(),
1209+
Some(&metadata.kind),
1210+
tparams,
1211+
self_obj.cloned(),
1212+
args,
1213+
keywords,
1214+
arguments_range,
1215+
&arg_errors,
1216+
&call_errors,
1217+
// We intentionally drop the context here, as arg errors don't need it,
1218+
// and if there are any call errors, we'll log a "No matching overloads"
1219+
// error with the necessary context.
1220+
None,
1221+
hint,
1222+
contextually_opaque_defaults,
1223+
overload_ctor_targs.as_mut(),
1224+
);
12181225
CalledOverload {
12191226
func: callable,
12201227
res,

‎pyrefly/lib/binding/narrow.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,8 @@ impl NarrowOps {
987987
match self.0.entry(name) {
988988
Entry::Occupied(mut entry) => {
989989
let (op, _) = entry.get_mut();
990-
if let NarrowOp::Atomic(
991-
existing_prop,
992-
AtomicNarrowOp::Call(existing_call, kws),
993-
) = op
990+
if let NarrowOp::Atomic(existing_prop, AtomicNarrowOp::Call(existing_call, kws)) =
991+
op
994992
&& Arc::ptr_eq(existing_call, call)
995993
&& Self::same_facet_subject(existing_prop.as_ref(), prop.as_ref())
996994
{

0 commit comments

Comments
 (0)