Re: [PATCH] Fix handling of discriminantless univariant enums in Rust

Tom Tromey
2016-10-31T03:29:37Z

>>>>> "Manish" == Manish Goregaokar <manish@mozilla.com> writes:

Manish> Updated. Not sure what the style issues are, could you point them out?

Sure. There's also the GNU coding standards document, plus some docs on
the gdb wiki somewhere.

Manish> }
Manish> + else if (TYPE_NFIELDS (type) == 1) {

Brace placement. Should line up with that "}" just above.

Manish> + /* Sometimes univariant enums are encoded without a
Manish> + discriminant. In that case, treating it as an encoded enum
Manish> + with the first field being the actual type works. */

Subsequent text in a multi-line comment should line up under the
"Sometimes".

Period followed by two spaces ends a sentence, so one more space before
"In".

Manish> + const char* field_name = TYPE_NAME (TYPE_FIELD_TYPE (type, 0));
Manish> + const char* last = rust_last_path_segment (field_name);

"char *"

Manish> + ret.name = concat (TYPE_NAME (type), "::", last, (char *) NULL);
Manish> + ret.field_no = RUST_ENCODED_ENUM_REAL;
Manish> + ret.is_encoded = 1;
Manish> + return ret;
Manish> + }

This brace and the whole block will be indented a bit more due to the
brace placement issue.

thanks,
Tom