use super::DiagnosticMessage;
impl PartialEq for DiagnosticMessage {
fn eq(&self, other: &Self) -> bool {
if let Some(lhs) = self.as_fraction_after_numeric() {
if let Some(rhs) = other.as_fraction_after_numeric() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_no_digits_after_dot() {
if let Some(rhs) = other.as_no_digits_after_dot() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unknown_type_of_percent_string() {
if let Some(rhs) = other.as_unknown_type_of_percent_string() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_numeric_literal_without_digits() {
if let Some(rhs) = other.as_numeric_literal_without_digits() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_list() {
if let Some(rhs) = other.as_unterminated_list() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_regexp() {
if let Some(rhs) = other.as_unterminated_regexp() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_string() {
if let Some(rhs) = other.as_unterminated_string() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_quoted_string() {
if let Some(rhs) = other.as_unterminated_quoted_string() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_unicode_escape() {
if let Some(rhs) = other.as_invalid_unicode_escape() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_too_large_unicode_codepoint() {
if let Some(rhs) = other.as_too_large_unicode_codepoint() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_unicode_codepoint() {
if let Some(rhs) = other.as_invalid_unicode_codepoint() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_multiple_codepoint_at_single_char() {
if let Some(rhs) = other.as_multiple_codepoint_at_single_char() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_escape_character() {
if let Some(rhs) = other.as_invalid_escape_character() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_hex_escape() {
if let Some(rhs) = other.as_invalid_hex_escape() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_heredoc() {
if let Some(rhs) = other.as_unterminated_heredoc() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_heredoc_id() {
if let Some(rhs) = other.as_unterminated_heredoc_id() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_slash_r_at_middle_of_line() {
if let Some(rhs) = other.as_slash_r_at_middle_of_line() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_d_star_interpreted_as_arg_prefix() {
if let Some(rhs) = other.as_d_star_interpreted_as_arg_prefix() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_star_interpreted_as_arg_prefix() {
if let Some(rhs) = other.as_star_interpreted_as_arg_prefix() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ampersand_interpreted_as_arg_prefix() {
if let Some(rhs) = other.as_ampersand_interpreted_as_arg_prefix() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_triple_dot_at_eol() {
if let Some(rhs) = other.as_triple_dot_at_eol() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_parentheses_iterpreted_as_arglist() {
if let Some(rhs) = other.as_parentheses_iterpreted_as_arglist() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ambiguous_first_argument() {
if let Some(rhs) = other.as_ambiguous_first_argument() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ambiguous_operator() {
if let Some(rhs) = other.as_ambiguous_operator() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_character_syntax() {
if let Some(rhs) = other.as_invalid_character_syntax() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_octal_digit() {
if let Some(rhs) = other.as_invalid_octal_digit() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_trailing_char_in_number() {
if let Some(rhs) = other.as_trailing_char_in_number() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_embedded_document_meets_eof() {
if let Some(rhs) = other.as_embedded_document_meets_eof() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_char() {
if let Some(rhs) = other.as_invalid_char() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_incomplete_character_syntax() {
if let Some(rhs) = other.as_incomplete_character_syntax() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_gvar_without_id() {
if let Some(rhs) = other.as_gvar_without_id() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_gvar_name() {
if let Some(rhs) = other.as_invalid_gvar_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ivar_without_id() {
if let Some(rhs) = other.as_ivar_without_id() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_ivar_name() {
if let Some(rhs) = other.as_invalid_ivar_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cvar_without_id() {
if let Some(rhs) = other.as_cvar_without_id() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_cvar_name() {
if let Some(rhs) = other.as_invalid_cvar_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unknown_regex_options() {
if let Some(rhs) = other.as_unknown_regex_options() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unterminated_unicode_escape() {
if let Some(rhs) = other.as_unterminated_unicode_escape() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_encoding_error() {
if let Some(rhs) = other.as_encoding_error() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_multibyte_char() {
if let Some(rhs) = other.as_invalid_multibyte_char() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ambiguous_ternary_operator() {
if let Some(rhs) = other.as_ambiguous_ternary_operator() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ambiguous_regexp() {
if let Some(rhs) = other.as_ambiguous_regexp() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_else_without_rescue() {
if let Some(rhs) = other.as_else_without_rescue() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_begin_not_at_top_level() {
if let Some(rhs) = other.as_begin_not_at_top_level() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_alias_nth_ref() {
if let Some(rhs) = other.as_alias_nth_ref() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_csend_inside_masgn() {
if let Some(rhs) = other.as_csend_inside_masgn() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_class_or_module_name_must_be_constant() {
if let Some(rhs) = other.as_class_or_module_name_must_be_constant() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_endless_setter_definition() {
if let Some(rhs) = other.as_endless_setter_definition() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_unexpected_token() {
if let Some(rhs) = other.as_unexpected_token() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_class_definition_in_method_body() {
if let Some(rhs) = other.as_class_definition_in_method_body() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_module_definition_in_method_body() {
if let Some(rhs) = other.as_module_definition_in_method_body() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_return_in_class_or_module_body() {
if let Some(rhs) = other.as_invalid_return_in_class_or_module_body() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_const_argument() {
if let Some(rhs) = other.as_const_argument() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ivar_argument() {
if let Some(rhs) = other.as_ivar_argument() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_gvar_argument() {
if let Some(rhs) = other.as_gvar_argument() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cvar_argument() {
if let Some(rhs) = other.as_cvar_argument() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_no_such_local_variable() {
if let Some(rhs) = other.as_no_such_local_variable() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_ordinary_param_defined() {
if let Some(rhs) = other.as_ordinary_param_defined() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_numparam_used() {
if let Some(rhs) = other.as_numparam_used() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_tok_at_eol_without_expression() {
if let Some(rhs) = other.as_tok_at_eol_without_expression() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_end_in_method() {
if let Some(rhs) = other.as_end_in_method() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_comparison_after_comparison() {
if let Some(rhs) = other.as_comparison_after_comparison() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_circular_argument_reference() {
if let Some(rhs) = other.as_circular_argument_reference() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_dynamic_constant_assignment() {
if let Some(rhs) = other.as_dynamic_constant_assignment() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_self() {
if let Some(rhs) = other.as_cant_assign_to_self() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_nil() {
if let Some(rhs) = other.as_cant_assign_to_nil() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_true() {
if let Some(rhs) = other.as_cant_assign_to_true() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_false() {
if let Some(rhs) = other.as_cant_assign_to_false() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_file() {
if let Some(rhs) = other.as_cant_assign_to_file() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_line() {
if let Some(rhs) = other.as_cant_assign_to_line() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_encoding() {
if let Some(rhs) = other.as_cant_assign_to_encoding() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_assign_to_numparam() {
if let Some(rhs) = other.as_cant_assign_to_numparam() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_cant_set_variable() {
if let Some(rhs) = other.as_cant_set_variable() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_block_given_to_yield() {
if let Some(rhs) = other.as_block_given_to_yield() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_block_and_block_arg_given() {
if let Some(rhs) = other.as_block_and_block_arg_given() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_symbol_literal_with_interpolation() {
if let Some(rhs) = other.as_symbol_literal_with_interpolation() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_reserved_for_numparam() {
if let Some(rhs) = other.as_reserved_for_numparam() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_key_must_be_valid_as_local_variable() {
if let Some(rhs) = other.as_key_must_be_valid_as_local_variable() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_duplicate_variable_name() {
if let Some(rhs) = other.as_duplicate_variable_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_duplicate_key_name() {
if let Some(rhs) = other.as_duplicate_key_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_singleton_literal() {
if let Some(rhs) = other.as_singleton_literal() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_nth_ref_is_too_big() {
if let Some(rhs) = other.as_nth_ref_is_too_big() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_duplicated_argument_name() {
if let Some(rhs) = other.as_duplicated_argument_name() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_regex_error() {
if let Some(rhs) = other.as_regex_error() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_invalid_symbol() {
if let Some(rhs) = other.as_invalid_symbol() {
return lhs == rhs;
} else {
return false;
}
}
if let Some(lhs) = self.as_void_value_expression() {
if let Some(rhs) = other.as_void_value_expression() {
return lhs == rhs;
} else {
return false;
}
}
panic!("unrecognized diagnostic message type")
}
}