pub enum WarningCode {
Show 55 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,
UndefinedFunction,
UndefinedIdentifier,
UndefinedMethod,
UndefinedProperty,
TooFewArguments,
TooManyArguments,
}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.
UndefinedFunction
A bare-name call that resolves to nothing anywhere (a typo like usseState(0)).
UndefinedIdentifier
A bare identifier that resolves to nothing anywhere.
UndefinedMethod
A method call on a BUILT-IN receiver (Callable, String, Vector2, …) whose method does
not exist. Builtin member tables are closed and bundled, so — unlike Object receivers,
where a script can attach methods at runtime — this needs NO workspace-completeness claim:
Godot itself reports it as a compile error. 4.7 prints BOTH Cannot find member "casll" in base "Callable". and Function "casll()" not found in base Callable. for one miss (its
member- and call-checks each fire); the analyzer emits the latter, one diagnostic per site.
UndefinedProperty
A property/constant access on a BUILT-IN receiver that does not exist (v.zzz on a
Vector2). Same closed-table reasoning as Self::UndefinedMethod.
TooFewArguments
A call passing fewer arguments than the callee’s required (default-less) parameters —
a compile error in Godot (Too few arguments for "f()" call. Expected at least N but received M.). Only fires on a statically-resolved own/engine/utility/builtin signature;
Callable values and cross-file seams stay silent.
TooManyArguments
A call passing more arguments than the callee accepts — a compile error in Godot
(Too many arguments for "f()" call. Expected at most N but received M.). A variadic
callee (print, vararg engine methods) never fires it.
Implementations§
Source§impl WarningCode
impl WarningCode
Sourcepub const ALL: &'static [WarningCode]
pub const ALL: &'static [WarningCode]
Every code, for reverse lookup (from_setting_name) and
the W5 docgen. Must list every variant.
Sourcepub fn as_str(self) -> &'static str
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).
Sourcepub fn setting_name(self) -> String
pub fn setting_name(self) -> String
The project.godot debug/gdscript/warnings/<tail> key tail — the lowercased [as_str].
The LSP rendering tags this code’s diagnostics carry: Unnecessary (editors dim the
range) for the unused/unreachable family, matching VS Code’s built-in convention.
No catalog code is Deprecated-tagged today; the arm exists for when one is.
Sourcepub fn description(self) -> &'static str
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.
Sourcepub fn default_level(self) -> WarnLevel
pub fn default_level(self) -> WarnLevel
Godot’s default_warning_levels[] entry for this code.
Sourcepub fn is_opt_in(self) -> bool
pub fn is_opt_in(self) -> bool
Whether this code is in the opt-in type-strictness group (the IGNORE-default set).
Sourcepub fn promoted_by_strict(self) -> bool
pub fn promoted_by_strict(self) -> bool
Whether a strict / standalone run (strict_opt_in) auto-promotes this IGNORE-default code to
WARN. True for the UNSAFE_* safety group; false for the stylistic UNTYPED_DECLARATION
/ INFERRED_DECLARATION — those fire on essentially every untyped / inferred declaration, so
they require an explicit per-code project setting to enable (never the blanket strict umbrella),
matching Godot’s “most users never enable them” reality. Keeps the standalone default clean.
Sourcepub fn since(self) -> Since
pub fn since(self) -> Since
The lowest engine version this code exists in (for version-gating master-only codes).
Sourcepub fn from_setting_name(name: &str) -> Option<WarningCode>
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
impl Clone for WarningCode
Source§fn clone(&self) -> WarningCode
fn clone(&self) -> WarningCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WarningCode
Source§impl Debug for WarningCode
impl Debug for WarningCode
impl Eq for WarningCode
Source§impl Hash for WarningCode
impl Hash for WarningCode
Source§impl PartialEq for WarningCode
impl PartialEq for WarningCode
impl StructuralPartialEq for WarningCode
Auto Trait Implementations§
impl Freeze for WarningCode
impl RefUnwindSafe for WarningCode
impl Send for WarningCode
impl Sync for WarningCode
impl Unpin for WarningCode
impl UnsafeUnpin for WarningCode
impl UnwindSafe for WarningCode
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.