pub enum InferredType {
Show 26 variants
IntLiteral,
UIntLiteral,
FloatLiteral,
CharLiteral,
StringLiteral,
SymbolLookup {
name: InternedStr,
resolved_type: Box<TypeRepr>,
},
ThxDefault,
BinaryOp {
op: BinOp,
result_type: Box<TypeRepr>,
},
UnaryArithmetic {
inner_type: Box<TypeRepr>,
},
LogicalNot,
AddressOf {
inner_type: Box<TypeRepr>,
},
Dereference {
pointer_type: Box<TypeRepr>,
},
IncDec {
inner_type: Box<TypeRepr>,
},
MemberAccess {
base_type: String,
member: InternedStr,
field_type: Option<Box<TypeRepr>>,
},
PtrMemberAccess {
base_type: String,
member: InternedStr,
field_type: Option<Box<TypeRepr>>,
used_consistent_type: bool,
},
ArraySubscript {
base_type: Box<TypeRepr>,
element_type: Box<TypeRepr>,
},
Conditional {
then_type: Box<TypeRepr>,
else_type: Box<TypeRepr>,
result_type: Box<TypeRepr>,
},
Comma {
rhs_type: Box<TypeRepr>,
},
Assignment {
lhs_type: Box<TypeRepr>,
},
Cast {
target_type: Box<TypeRepr>,
},
Sizeof,
Alignof,
CompoundLiteral {
type_name: Box<TypeRepr>,
},
StmtExpr {
last_expr_type: Option<Box<TypeRepr>>,
},
Assert,
FunctionReturn {
func_name: InternedStr,
},
}Expand description
推論で導出された型
Variants§
IntLiteral
整数リテラル (42, 0x1F, etc.)
UIntLiteral
符号なし整数リテラル (42u, etc.)
FloatLiteral
浮動小数点リテラル (3.14, etc.)
CharLiteral
文字リテラル (‘a’)
StringLiteral
文字列リテラル (“hello”)
SymbolLookup
シンボルテーブルからの参照
ThxDefault
THX (my_perl) のデフォルト型
BinaryOp
二項演算の結果
UnaryArithmetic
単項演算 (+, -, ~)
LogicalNot
論理否定 (!) - 常に int
AddressOf
アドレス取得 (&x)
Dereference
間接参照 (*p)
IncDec
インクリメント/デクリメント (++, –)
MemberAccess
直接メンバーアクセス (expr.member)
PtrMemberAccess
ポインタメンバーアクセス (expr->member)
Fields
§
member: InternedStrArraySubscript
配列添字 (arr[i])
Conditional
条件演算子 (cond ? then : else)
Comma
コンマ式 (a, b)
Assignment
代入式 (a = b)
Cast
キャスト式 ((type)expr)
Sizeof
sizeof 式/型 - 常に unsigned long
Alignof
alignof - 常に unsigned long
CompoundLiteral
複合リテラル ((type){…})
StmtExpr
文式 ({ … })
Assert
アサーション - 常に void
FunctionReturn
関数呼び出しの戻り値(RustBindings/Apidoc から取得できなかった場合)
Fields
§
func_name: InternedStrImplementations§
Source§impl InferredType
impl InferredType
Sourcepub fn resolved_type(&self) -> Option<&TypeRepr>
pub fn resolved_type(&self) -> Option<&TypeRepr>
Inferred ラッパーを解決して内側の TypeRepr を返す
各 InferredType バリアントが保持する「結果の型」を取得する。
pointee_name() / type_name() から再帰的に呼ばれる。
Source§impl InferredType
impl InferredType
Sourcepub fn to_display_string(&self, interner: &StringInterner) -> String
pub fn to_display_string(&self, interner: &StringInterner) -> String
表示用文字列に変換
Sourcepub fn to_rust_string(&self, interner: &StringInterner) -> String
pub fn to_rust_string(&self, interner: &StringInterner) -> String
Rust コード生成用の型文字列に変換
Trait Implementations§
Source§impl Clone for InferredType
impl Clone for InferredType
Source§fn clone(&self) -> InferredType
fn clone(&self) -> InferredType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InferredType
impl RefUnwindSafe for InferredType
impl Send for InferredType
impl Sync for InferredType
impl Unpin for InferredType
impl UnsafeUnpin for InferredType
impl UnwindSafe for InferredType
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