pub enum Hoist {
Scope,
AfterDecl,
Module,
}Expand description
When an item’s name becomes visible in its scope.
§Examples
use resolve_lang::{Hoist, ItemClass, Policy};
// PHP: a function declared anywhere is visible in its whole namespace.
assert_eq!(Policy::php().hoisting(ItemClass::Fn), Hoist::Module);Variants§
Scope
Visible throughout the scope that declares it, before and after the declaration (Rust and Kraken items, Python’s per-scope binding rule).
AfterDecl
Visible from the declaration to the end of its scope, including inside itself, so a function can recurse (C-style declare-before-use).
Module
Visible throughout the nearest enclosing module, wherever it is declared, even inside a function body or a conditional block (PHP functions and classes).
Trait Implementations§
impl Copy for Hoist
impl Eq for Hoist
impl StructuralPartialEq for Hoist
Auto Trait Implementations§
impl Freeze for Hoist
impl RefUnwindSafe for Hoist
impl Send for Hoist
impl Sync for Hoist
impl Unpin for Hoist
impl UnsafeUnpin for Hoist
impl UnwindSafe for Hoist
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more