pub enum Shadowing {
Allow,
DenySameScope,
DenyLocals,
}Expand description
Whether a binder may reuse a name that is already visible.
§Examples
use resolve_lang::{Policy, Shadowing};
let p = Policy::new().with_shadowing(Shadowing::DenySameScope);
assert_eq!(p.shadowing(), Shadowing::DenySameScope);Variants§
Allow
Any binder may shadow any visible name (Rust let, Python, PHP).
DenySameScope
A binder may not reuse a name bound earlier in the same scope
(JavaScript let, a parameter list with a repeated name).
DenyLocals
A binder may not reuse the name of any local binder visible from the same frame (C#, Zig).
Trait Implementations§
impl Copy for Shadowing
impl Eq for Shadowing
impl StructuralPartialEq for Shadowing
Auto Trait Implementations§
impl Freeze for Shadowing
impl RefUnwindSafe for Shadowing
impl Send for Shadowing
impl Sync for Shadowing
impl Unpin for Shadowing
impl UnsafeUnpin for Shadowing
impl UnwindSafe for Shadowing
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