diff --git a/hphp/hack/src/hackrs/ty/decl/folded.rs b/hphp/hack/src/hackrs/ty/decl/folded.rs index daf28cc3a7d119..2d3f88fcf64790 100644 --- a/hphp/hack/src/hackrs/ty/decl/folded.rs +++ b/hphp/hack/src/hackrs/ty/decl/folded.rs @@ -64,7 +64,7 @@ pub struct FoldedElement { /// class B extends A {} /// class C extends B {} /// ``` - +/// /// The method `A::test()` has the type `(function(Ta1, Ta2): void)` in the /// context of class `A`. However in the context of class `B`, it will have type /// `(function(Tb, int): void)`. diff --git a/hphp/hack/src/parser/core/declaration_parser.rs b/hphp/hack/src/parser/core/declaration_parser.rs index 2a6136573301de..1c1124ddf7a51e 100644 --- a/hphp/hack/src/parser/core/declaration_parser.rs +++ b/hphp/hack/src/parser/core/declaration_parser.rs @@ -1571,10 +1571,10 @@ where let token_kind = self.peek_token_kind(); if token_kind == TokenKind::Readonly { let token = self.next_token(); - return self.sc_mut().make_token(token); + self.sc_mut().make_token(token) } else { let pos = self.pos(); - return self.sc_mut().make_missing(pos); + self.sc_mut().make_missing(pos) } } diff --git a/hphp/hack/src/parser/lowerer/lowerer.rs b/hphp/hack/src/parser/lowerer/lowerer.rs index 0fd8643c136d2c..90aa188bf80173 100644 --- a/hphp/hack/src/parser/lowerer/lowerer.rs +++ b/hphp/hack/src/parser/lowerer/lowerer.rs @@ -3756,9 +3756,9 @@ fn is_polymorphic_context<'a>(env: &mut Env<'a>, hint: &ast::Hint, ignore_this: fn has_polymorphic_context<'a>(env: &mut Env<'a>, contexts: Option<&ast::Contexts>) -> bool { if let Some(ast::Contexts(_, ref context_hints)) = contexts { - return context_hints + context_hints .iter() - .any(|c| is_polymorphic_context(env, c, false)); + .any(|c| is_polymorphic_context(env, c, false)) } else { false } @@ -3766,10 +3766,10 @@ fn has_polymorphic_context<'a>(env: &mut Env<'a>, contexts: Option<&ast::Context fn has_any_policied_context(contexts: Option<&ast::Contexts>) -> bool { if let Some(ast::Contexts(_, ref context_hints)) = contexts { - return context_hints.iter().any(|hint| match &*hint.1 { + context_hints.iter().any(|hint| match &*hint.1 { ast::Hint_::Happly(ast::Id(_, id), _) => sn::coeffects::is_any_zoned(id), _ => false, - }); + }) } else { false } @@ -3777,10 +3777,10 @@ fn has_any_policied_context(contexts: Option<&ast::Contexts>) -> bool { fn has_any_policied_or_defaults_context(contexts: Option<&ast::Contexts>) -> bool { if let Some(ast::Contexts(_, ref context_hints)) = contexts { - return context_hints.iter().any(|hint| match &*hint.1 { + context_hints.iter().any(|hint| match &*hint.1 { ast::Hint_::Happly(ast::Id(_, id), _) => sn::coeffects::is_any_zoned_or_defaults(id), _ => false, - }); + }) } else { true } @@ -3788,10 +3788,10 @@ fn has_any_policied_or_defaults_context(contexts: Option<&ast::Contexts>) -> boo fn has_any_context(haystack: Option<&ast::Contexts>, needles: Vec<&str>) -> bool { if let Some(ast::Contexts(_, ref context_hints)) = haystack { - return context_hints.iter().any(|hint| match &*hint.1 { + context_hints.iter().any(|hint| match &*hint.1 { ast::Hint_::Happly(ast::Id(_, id), _) => needles.iter().any(|&context| id == context), _ => false, - }); + }) } else { true } @@ -3799,12 +3799,12 @@ fn has_any_context(haystack: Option<&ast::Contexts>, needles: Vec<&str>) -> bool fn contexts_cannot_access_ic(haystack: Option<&ast::Contexts>) -> bool { if let Some(ast::Contexts(_, ref context_hints)) = haystack { - return context_hints.iter().all(|hint| match &*hint.1 { + context_hints.iter().all(|hint| match &*hint.1 { ast::Hint_::Happly(ast::Id(_, id), _) => { sn::coeffects::is_any_without_implicit_policy_or_unsafe(id) } _ => false, - }); + }) } else { false // no context list -> implicit [defaults] }