Skip to content

remove redundant tycat line from the binop table #9111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4266,8 +4266,7 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
static tycat_char: int = 2;
static tycat_int: int = 3;
static tycat_float: int = 4;
static tycat_struct: int = 5;
static tycat_bot: int = 6;
static tycat_bot: int = 5;

static opcat_add: int = 0;
static opcat_sub: int = 1;
Expand Down Expand Up @@ -4310,7 +4309,6 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
ty_bool => tycat_bool,
ty_int(_) | ty_uint(_) | ty_infer(IntVar(_)) => tycat_int,
ty_float(_) | ty_infer(FloatVar(_)) => tycat_float,
ty_tup(_) | ty_enum(_, _) => tycat_struct,
ty_bot => tycat_bot,
_ => tycat_other
}
Expand All @@ -4326,8 +4324,7 @@ pub fn is_binopable(cx: ctxt, ty: t, op: ast::BinOp) -> bool {
/*char*/ [f, f, f, f, t, t, f, f],
/*int*/ [t, t, t, t, t, t, t, f],
/*float*/ [t, t, t, f, t, t, f, f],
/*bot*/ [f, f, f, f, f, f, f, f],
/*struct*/ [t, t, t, t, f, f, t, t]];
/*bot*/ [t, t, t, t, f, f, t, t]];

return tbl[tycat(cx, ty)][opcat(op)];
}
Expand Down