Fix the f16
/f128
feature gate on integer literals
This commit is contained in:
parent
d5b4c2e4f1
commit
62fcb9d585
7 changed files with 66 additions and 22 deletions
|
@ -332,17 +332,19 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||
ast::ExprKind::TryBlock(_) => {
|
||||
gate!(&self, try_blocks, e.span, "`try` expression is experimental");
|
||||
}
|
||||
ast::ExprKind::Lit(token::Lit { kind: token::LitKind::Float, suffix, .. }) => {
|
||||
match suffix {
|
||||
Some(sym::f16) => {
|
||||
gate!(&self, f16, e.span, "the type `f16` is unstable")
|
||||
}
|
||||
Some(sym::f128) => {
|
||||
gate!(&self, f128, e.span, "the type `f128` is unstable")
|
||||
}
|
||||
_ => (),
|
||||
ast::ExprKind::Lit(token::Lit {
|
||||
kind: token::LitKind::Float | token::LitKind::Integer,
|
||||
suffix,
|
||||
..
|
||||
}) => match suffix {
|
||||
Some(sym::f16) => {
|
||||
gate!(&self, f16, e.span, "the type `f16` is unstable")
|
||||
}
|
||||
}
|
||||
Some(sym::f128) => {
|
||||
gate!(&self, f128, e.span, "the type `f128` is unstable")
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
visit::walk_expr(self, e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue