Skip to content

Commit 1a4b46f

Browse files
committed
Add f16 and f128 to the AST
1 parent 10eeed4 commit 1a4b46f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/rustc_ast/src/ast.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1909,22 +1909,28 @@ pub struct FnSig {
19091909
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
19101910
#[derive(Encodable, Decodable, HashStable_Generic)]
19111911
pub enum FloatTy {
1912+
F16,
19121913
F32,
19131914
F64,
1915+
F128,
19141916
}
19151917

19161918
impl FloatTy {
19171919
pub fn name_str(self) -> &'static str {
19181920
match self {
1921+
FloatTy::F16 => "f16",
19191922
FloatTy::F32 => "f32",
19201923
FloatTy::F64 => "f64",
1924+
FloatTy::F128 => "f128",
19211925
}
19221926
}
19231927

19241928
pub fn name(self) -> Symbol {
19251929
match self {
1930+
FloatTy::F16 => sym::f16,
19261931
FloatTy::F32 => sym::f32,
19271932
FloatTy::F64 => sym::f64,
1933+
FloatTy::F128 => sym::f128,
19281934
}
19291935
}
19301936
}

compiler/rustc_middle/src/ty/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,10 @@ pub fn uint_ty(uty: ast::UintTy) -> UintTy {
19911991

19921992
pub fn float_ty(fty: ast::FloatTy) -> FloatTy {
19931993
match fty {
1994+
ast::FloatTy::F16 => FloatTy::F16,
19941995
ast::FloatTy::F32 => FloatTy::F32,
19951996
ast::FloatTy::F64 => FloatTy::F64,
1997+
ast::FloatTy::F128 => FloatTy::F128,
19961998
}
19971999
}
19982000

0 commit comments

Comments
 (0)