pub enum ParamKind {
Explicit(Option<ParamMode>),
At,
Pound,
Colon,
Loc,
Error,
}
Expand description
How a parameter was declared in the surface syntax.
Variants§
Explicit(Option<ParamMode>)
A parameter declared in an explicit scope, e.g., fn foo[hdl n: int](x: i32[n])
At
An implicitly scoped parameter declared with @a
syntax
Pound
An implicitly scoped parameter declared with #a
syntax
Colon
An implicitly scoped parameter declared with x: T
syntax.
Loc
A location declared with x: &strg T
syntax.
Error
A parameter introduced with x: T
syntax that we know syntactically is always and error
to use inside a refinement. For example, consider the following:
fn(x: {v. i32[v] | v > 0}) -> i32[x]
In this definition, we know syntactically that x
binds to a non-base type so it’s an error
to use x
as an index in the return type.
These parameters should not appear in a desugared item and we only track them during name resolution to report errors at the use site.
Implementations§
Trait Implementations§
impl Copy for ParamKind
impl Eq for ParamKind
impl StructuralPartialEq for ParamKind
Auto Trait Implementations§
impl Freeze for ParamKind
impl RefUnwindSafe for ParamKind
impl Send for ParamKind
impl Sync for ParamKind
impl Unpin for ParamKind
impl UnwindSafe for ParamKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more