diff --git a/hhvm-patch.diff b/hhvm-patch.diff index 79b0cf26..7c777791 100644 --- a/hhvm-patch.diff +++ b/hhvm-patch.diff @@ -120,7 +120,7 @@ index a7681402058..e294b709695 100644 fn to_sql(&self) -> rusqlite::Result> { Ok(rusqlite::types::ToSqlOutput::from(*self as i64)) diff --git a/hphp/hack/src/naming/names_rust/Cargo.toml b/hphp/hack/src/naming/names_rust/Cargo.toml -index 565554d8203..db38316ce81 100644 +index 04a55a0818b..57fd1676124 100644 --- a/hphp/hack/src/naming/names_rust/Cargo.toml +++ b/hphp/hack/src/naming/names_rust/Cargo.toml @@ -16,6 +16,8 @@ oxidized = { version = "0.0.0", path = "../../oxidized" } @@ -161,7 +161,7 @@ index 91106097aa3..930dfa897c5 100644 fn to_sql(&self) -> rusqlite::Result> { Ok(rusqlite::types::ToSqlOutput::from(self.0.get() as i64)) diff --git a/hphp/hack/src/naming/names_rust/naming_sqlite.rs b/hphp/hack/src/naming/names_rust/naming_sqlite.rs -index e7f91b56e96..7be4f159ecf 100644 +index 16288300007..396d281c283 100644 --- a/hphp/hack/src/naming/names_rust/naming_sqlite.rs +++ b/hphp/hack/src/naming/names_rust/naming_sqlite.rs @@ -12,8 +12,11 @@ use hh24_types::ToplevelCanonSymbolHash; @@ -177,10 +177,10 @@ index e7f91b56e96..7be4f159ecf 100644 pub struct Names { diff --git a/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs b/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs -index cfc3b81042c..e3e7a5b8fc0 100644 +index 7d7a79b7c30..b336df0cb24 100644 --- a/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs +++ b/hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs -@@ -2247,7 +2247,6 @@ impl Node

for Typedef { +@@ -2249,7 +2249,6 @@ impl Node

for Typedef { self.file_attributes.accept(c, v)?; self.mode.accept(c, v)?; self.vis.accept(c, v)?; @@ -189,10 +189,10 @@ index cfc3b81042c..e3e7a5b8fc0 100644 self.emit_id.accept(c, v)?; self.is_ctx.accept(c, v)?; diff --git a/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs b/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs -index 2df37947608..1943892a3e3 100644 +index d6eece3d383..b7e42eaa7e4 100644 --- a/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs +++ b/hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs -@@ -2247,7 +2247,6 @@ impl NodeMut

for Typedef { +@@ -2249,7 +2249,6 @@ impl NodeMut

for Typedef { self.file_attributes.accept(c, v)?; self.mode.accept(c, v)?; self.vis.accept(c, v)?; @@ -488,10 +488,10 @@ index 8db2f3a3271..cadcc02dbbf 100644 } _ => { diff --git a/hphp/hack/src/parser/lowerer/lowerer.rs b/hphp/hack/src/parser/lowerer/lowerer.rs -index 978ee9dd0b7..1bf7e45930d 100644 +index c396766a467..c7c22b8bffe 100644 --- a/hphp/hack/src/parser/lowerer/lowerer.rs +++ b/hphp/hack/src/parser/lowerer/lowerer.rs -@@ -3491,12 +3491,12 @@ fn p_markup<'a>(node: S<'a>, env: &mut Env<'a>) -> Result { +@@ -3271,12 +3271,12 @@ fn p_markup<'a>(node: S<'a>, env: &mut Env<'a>) -> Result { let markup_hashbang = &c.hashbang; let markup_suffix = &c.suffix; let pos = p_pos(node, env); @@ -557,7 +557,7 @@ index 88c2e445a47..7aab53c3f1c 100644 acc.add_to_misuses(line, code, p); } else if self.disable_hh_ignore_error == 1 && t.kind() == IgnoreError { diff --git a/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml b/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml -index 9222ad8eac1..e332c3999be 100644 +index 5a0b574800f..154f2cdb3d5 100644 --- a/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml +++ b/hphp/hack/src/providers/hackrs_provider_backend/Cargo.toml @@ -23,7 +23,6 @@ names = { version = "0.0.0", path = "../../naming/names_rust" } diff --git a/src/analyzer/expression_analyzer.rs b/src/analyzer/expression_analyzer.rs index 1c44683e..73819780 100644 --- a/src/analyzer/expression_analyzer.rs +++ b/src/analyzer/expression_analyzer.rs @@ -343,7 +343,10 @@ pub(crate) fn analyze( if let Some(stmt_type) = analysis_data .expr_types - .get(&(boxed.pos().start_offset() as u32, boxed.pos().end_offset() as u32)) + .get(&( + boxed.pos().start_offset() as u32, + boxed.pos().end_offset() as u32, + )) .cloned() { analysis_data.expr_types.insert( @@ -459,9 +462,10 @@ pub(crate) fn analyze( .cloned() .unwrap_or(get_mixed_any()); - analysis_data - .expr_effects - .insert((expr.1.start_offset() as u32, expr.1.end_offset() as u32), EFFECT_IMPURE); + analysis_data.expr_effects.insert( + (expr.1.start_offset() as u32, expr.1.end_offset() as u32), + EFFECT_IMPURE, + ); let awaited_types = awaited_stmt_type.types.drain(..).collect::>(); @@ -613,6 +617,7 @@ pub(crate) fn analyze( | aast::Expr_::Pair(_) | aast::Expr_::ETSplice(_) | aast::Expr_::Hole(_) + | aast::Expr_::Nameof(_) | aast::Expr_::Invalid(_) => { analysis_data.maybe_add_issue( Issue::new( @@ -847,7 +852,10 @@ fn analyze_function_pointer( false, ); - if !codebase.functionlike_infos.contains_key(&(*name, STR_EMPTY)) { + if !codebase + .functionlike_infos + .contains_key(&(*name, STR_EMPTY)) + { analysis_data.maybe_add_issue( Issue::new( IssueKind::NonExistentFunction, @@ -945,10 +953,10 @@ pub(crate) fn add_decision_dataflow( statements_analyzer.get_hpos(expr_pos), ); - if let Some(lhs_type) = analysis_data - .expr_types - .get(&(lhs_expr.1.start_offset() as u32, lhs_expr.1.end_offset() as u32)) - { + if let Some(lhs_type) = analysis_data.expr_types.get(&( + lhs_expr.1.start_offset() as u32, + lhs_expr.1.end_offset() as u32, + )) { cond_type.parent_nodes.insert(decision_node.clone()); for old_parent_node in &lhs_type.parent_nodes { @@ -963,10 +971,10 @@ pub(crate) fn add_decision_dataflow( } if let Some(rhs_expr) = rhs_expr { - if let Some(rhs_type) = analysis_data - .expr_types - .get(&(rhs_expr.1.start_offset() as u32, rhs_expr.1.end_offset() as u32)) - { + if let Some(rhs_type) = analysis_data.expr_types.get(&( + rhs_expr.1.start_offset() as u32, + rhs_expr.1.end_offset() as u32, + )) { cond_type.parent_nodes.insert(decision_node.clone()); for old_parent_node in &rhs_type.parent_nodes { diff --git a/src/code_info_builder/typehint_resolver.rs b/src/code_info_builder/typehint_resolver.rs index 90ab915a..8ac12d73 100644 --- a/src/code_info_builder/typehint_resolver.rs +++ b/src/code_info_builder/typehint_resolver.rs @@ -615,6 +615,7 @@ pub fn get_type_from_hint( Hint_::HfunContext(_) => panic!(), Hint_::Hvar(_) => panic!(), Hint_::Hrefinement(_, _) => panic!(), + Hint_::HclassArgs(_) => panic!(), Hint_::Hwildcard => TAtomic::TPlaceholder, };