Skip to main content

WarningCode

Enum WarningCode 

Source
pub enum WarningCode {
Show 49 variants UnassignedVariable, UnassignedVariableOpAssign, UnusedVariable, UnusedLocalConstant, UnusedPrivateClassVariable, UnusedParameter, UnusedSignal, ShadowedVariable, ShadowedVariableBaseClass, ShadowedGlobalIdentifier, UnreachableCode, UnreachablePattern, StandaloneExpression, StandaloneTernary, IncompatibleTernary, UnsafeVoidReturn, StaticCalledOnInstance, MissingTool, RedundantStaticUnload, RedundantAwait, AssertAlwaysTrue, AssertAlwaysFalse, IntegerDivision, NarrowingConversion, IntAsEnumWithoutCast, IntAsEnumWithoutMatch, EnumVariableWithoutDefault, EmptyFile, DeprecatedKeyword, ConfusableIdentifier, ConfusableLocalDeclaration, ConfusableLocalUsage, ConfusableCaptureReassignment, ConfusableTemporaryModification, PropertyUsedAsFunction, ConstantUsedAsFunction, FunctionUsedAsProperty, UntypedDeclaration, InferredDeclaration, UnsafePropertyAccess, UnsafeMethodAccess, UnsafeCast, UnsafeCallArgument, ReturnValueDiscarded, MissingAwait, InferenceOnVariant, NativeMethodOverride, GetNodeDefaultWithoutOnready, OnreadyWithExport,
}
Expand description

A gateable Godot GDScript warning code (research/04 §2.2). Internal to gdscript-hir; the public Diagnostic.code carries its as_str form, so the serialized identity stays a stable string. Adding a variant is a compile error until every table below (as_str, default_level, and ALL) covers it.

Variants§

§

UnassignedVariable

A typed local read before it is assigned.

§

UnassignedVariableOpAssign

A compound-assign (x += …) on a still-unassigned local.

§

UnusedVariable

A local var that is never read.

§

UnusedLocalConstant

A local const that is never read.

§

UnusedPrivateClassVariable

A _-prefixed class member that is never read in-class.

§

UnusedParameter

A parameter that is never read (excluding _-prefixed).

§

UnusedSignal

A signal that is never emitted or connected in-file.

§

ShadowedVariable

A local that shadows an outer local / parameter.

§

ShadowedVariableBaseClass

A member that shadows a base-class member.

§

ShadowedGlobalIdentifier

A class_name / member / local that shadows a global identifier.

§

UnreachableCode

Statements after an unconditional return/break/continue / an exhaustive match.

§

UnreachablePattern

A match arm after a wildcard/bind arm.

§

StandaloneExpression

An expression statement whose value is unused and side-effect-free.

§

StandaloneTernary

A ternary used as a statement.

§

IncompatibleTernary

A ternary whose two arms have incompatible types.

§

UnsafeVoidReturn

return f() where f is Variant into a -> void.

§

StaticCalledOnInstance

A static method called through an instance.

§

MissingTool

A base @tool class without a local @tool.

§

RedundantStaticUnload

@static_unload on a class with no static variables.

§

RedundantAwait

await on a non-coroutine / non-signal value.

§

AssertAlwaysTrue

assert(true) / an always-true constant condition.

§

AssertAlwaysFalse

assert(false) / an always-false constant condition.

§

IntegerDivision

int / int (the decimal part is discarded).

§

NarrowingConversion

A float stored into an int slot.

§

IntAsEnumWithoutCast

An int assigned to an enum without a cast.

§

IntAsEnumWithoutMatch

An int compared to an enum in a match.

§

EnumVariableWithoutDefault

var e: SomeEnum with no initializer.

§

EmptyFile

A file with no members.

§

DeprecatedKeyword

A deprecated keyword (yield).

§

ConfusableIdentifier

A mixed-script / homoglyph identifier.

§

ConfusableLocalDeclaration

A local declared after a same-name outer use.

§

ConfusableLocalUsage

A use-before-declaration of a local shadowing a member.

§

ConfusableCaptureReassignment

Reassigning a lambda capture.

§

ConfusableTemporaryModification

Modifying a temporary (master-only).

§

PropertyUsedAsFunction

obj.prop() where prop is a property.

§

ConstantUsedAsFunction

obj.CONST() where CONST is a constant.

§

FunctionUsedAsProperty

obj.method used as a property.

§

UntypedDeclaration

var x = … without a : T annotation.

§

InferredDeclaration

A := inferred declaration.

§

UnsafePropertyAccess

A property missing on a statically-known base.

§

UnsafeMethodAccess

A method missing on a statically-known base.

§

UnsafeCast

An as T through a Variant.

§

UnsafeCallArgument

An argument needing an unsafe implicit cast into the parameter type.

§

ReturnValueDiscarded

A non-void call result dropped.

§

MissingAwait

A await-able call whose result is not awaited (master-only).

§

InferenceOnVariant

A := / inferred binding from a statically-Variant value.

§

NativeMethodOverride

Overriding a native virtual with an incompatible signature.

§

GetNodeDefaultWithoutOnready

A get_node(...) default-value init that should be @onready.

§

OnreadyWithExport

@onready together with @export on one member.

Implementations§

Source§

impl WarningCode

Source

pub const ALL: &'static [WarningCode]

Every code, for reverse lookup (from_setting_name) and the W5 docgen. Must list every variant.

Source

pub fn as_str(self) -> &'static str

The stable serialized identity — what Diagnostic.code carries (e.g. INTEGER_DIVISION). These strings are the frozen consumer-facing identifiers (Workstream 6).

Source

pub fn setting_name(self) -> String

The project.godot debug/gdscript/warnings/<tail> key tail — the lowercased [as_str].

Source

pub fn description(self) -> &'static str

A one-line human description — the source of truth for the generated Warning Reference (Workstream 5). Kept terse and stable; an exhaustive match so a new code must add one.

Source

pub fn default_level(self) -> WarnLevel

Godot’s default_warning_levels[] entry for this code.

Source

pub fn is_opt_in(self) -> bool

Whether this code is in the opt-in type-strictness group (the codes a standalone/--strict run promotes from IGNORE to WARN). Currently exactly the IGNORE-default set.

Source

pub fn since(self) -> Since

The lowest engine version this code exists in (for version-gating master-only codes).

Source

pub fn from_setting_name(name: &str) -> Option<WarningCode>

The code whose setting_name (case-insensitively) is name, for parsing project.godot keys and @warning_ignore("name") arguments.

Trait Implementations§

Source§

impl Clone for WarningCode

Source§

fn clone(&self) -> WarningCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WarningCode

Source§

impl Debug for WarningCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WarningCode

Source§

impl Hash for WarningCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WarningCode

Source§

fn eq(&self, other: &WarningCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WarningCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HashEqLike<&T> for T
where T: Hash + Eq,

Source§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

Source§

fn eq(&self, data: &&T) -> bool

Source§

impl<T> HashEqLike<Cow<'_, T>> for T
where T: Hash + Eq + Clone,

Source§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

Source§

fn eq(&self, data: &Cow<'_, T>) -> bool

Source§

impl<T> HashEqLike<T> for T
where T: Hash + Eq,

Source§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

Source§

fn eq(&self, data: &T) -> bool

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> Lookup<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more