Skip to content

Commit 0fa3de5

Browse files
zertoshfacebook-github-bot
authored andcommitted
Update to rustfmt 1.6.0-nightly (839e9a6 2023-07-02)
Summary: Update to rustfmt 1.6.0-nightly (839e9a6 2023-07-02) The big ticket item here is that let-else is now supported! In fact, the suppport just landed two days ago (see [rust-lang/rustfmt#4914]) The unfortunate thing here though is that rustfmt is not statically linked anymore (see discussion in [rust-lang/rust#107297]). So we need all of librustc_driver and libstd - which makes our use case pretty big (~4-5MB to 50MB-100MB). We should explore building from source and statically linking, or using rustfmt from the toolchain. Both things that I don't want to deal with right now. [rust-lang/rustfmt#4914]: rust-lang/rustfmt#4914 [rust-lang/rust#107297]: rust-lang/rust#107297 Note to future updaters: To find out more-or-less what libs you need, you can use `objdump -p bin/rustfmt | grep NEEDED` on Linux for ELF bins, and `otool -L bin/rustfmt` on macOS for Mach-O bins. No idea what you do for Windows. Ran `tools/arcanist/lint/codemods/rustfmt-fbsource` to format the repo. Reviewed By: shayne-fletcher Differential Revision: D47203254 fbshipit-source-id: 6ffd3ce66c7f2b006d09505b93fed515ebc76902
1 parent db5771c commit 0fa3de5

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

hphp/hack/src/elab/passes/elab_dynamic_class_name.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ mod tests {
192192
expr_,
193193
Expr_::FunctionPointer(box (
194194
FunctionPtrId::FPClassConst(ClassId(_, _, ClassId_::CIself), _),
195-
_
195+
_,
196196
))
197197
));
198198
}
@@ -234,11 +234,7 @@ mod tests {
234234
assert!(env.into_errors().is_empty());
235235
assert!(matches!(
236236
elem,
237-
Expr(
238-
_,
239-
_,
240-
Expr_::ClassConst(box (ClassId(_, _, ClassId_::CIself), _))
241-
)
237+
Expr(_, _, Expr_::ClassConst(box (ClassId(_, _, ClassId_::CIself), _)))
242238
))
243239
}
244240

@@ -263,8 +259,8 @@ mod tests {
263259
Expr_::Invalid(box Some(Expr(
264260
_,
265261
_,
266-
Expr_::ClassConst(box (ClassId(_, _, ClassId_::CIexpr(..)), _))
267-
)))
262+
Expr_::ClassConst(box (ClassId(_, _, ClassId_::CIexpr(..)), _)),
263+
))),
268264
)
269265
))
270266
}
@@ -289,11 +285,7 @@ mod tests {
289285
assert!(env.into_errors().is_empty());
290286
assert!(matches!(
291287
elem,
292-
Expr(
293-
_,
294-
_,
295-
Expr_::ClassGet(box (ClassId(_, _, ClassId_::CIself), _, _))
296-
)
288+
Expr(_, _, Expr_::ClassGet(box (ClassId(_, _, ClassId_::CIself), _, _)))
297289
))
298290
}
299291

hphp/hack/src/elab/passes/elab_hint_haccess.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,7 @@ mod tests {
329329
let Contexts(_, mut hints) = elem;
330330
assert!(matches!(
331331
hints.pop(),
332-
Some(Hint(
333-
_,
334-
box Hint_::Haccess(Hint(_, box Hint_::Habstr(..)), _)
335-
))
332+
Some(Hint(_, box Hint_::Haccess(Hint(_, box Hint_::Habstr(..)), _)))
336333
))
337334
}
338335

hphp/hack/src/elab/passes/elab_hint_happly.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ mod tests {
378378
assert!(matches!(
379379
elem,
380380
ClassTypeconst::TCConcrete(ClassConcreteTypeconst {
381-
c_tc_type: Hint(_, box Hint_::Hprim(Tprim::Tint))
381+
c_tc_type: Hint(_, box Hint_::Hprim(Tprim::Tint)),
382382
})
383383
))
384384
}

hphp/hack/src/hackc/ir/conversions/textual/textual.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ impl<'a> TextualFile<'a> {
361361
let curry_ty = curry.ty_name();
362362
let mut fields = Vec::new();
363363
if curry.virtual_call {
364-
let FunctionName::Method(captured_this_ty, _) = &curry.name else { unreachable!(); };
364+
let FunctionName::Method(captured_this_ty, _) = &curry.name else {
365+
unreachable!();
366+
};
365367
fields.push(Field {
366368
name: "this".into(),
367369
ty: Ty::named_type_ptr(captured_this_ty.clone()).into(),
@@ -589,7 +591,9 @@ impl Ty {
589591
}
590592

591593
pub(crate) fn deref(&self) -> Ty {
592-
let Some(ty) = self.try_deref() else { panic!("Unable to deref {self:?}"); };
594+
let Some(ty) = self.try_deref() else {
595+
panic!("Unable to deref {self:?}");
596+
};
593597
ty
594598
}
595599

@@ -1125,7 +1129,9 @@ impl FuncBuilder<'_, '_> {
11251129
let obj = self.write_expr_stmt(Expr::Alloc(ty.clone()))?;
11261130

11271131
if let Some(this) = this {
1128-
let FunctionName::Method(captured_this_ty, _) = &name else { unreachable!(); };
1132+
let FunctionName::Method(captured_this_ty, _) = &name else {
1133+
unreachable!();
1134+
};
11291135
self.store(
11301136
Expr::Field(Box::new(obj.into()), ty.clone(), "this".to_string()),
11311137
this,

0 commit comments

Comments
 (0)