Auto merge of #27191 - pnkfelix:sidestep-unary-negate-warning, r=alexcrichton

Work around unary negation to-be-feature-gated warning by replacing references to `-1` as a `ast::NodeId` with `ast::DUMMY_NODE_ID`, which seems like a better notation to use (it is currently also `-1`.

(AFAICT the code is not *relying* on the value `-1` anywhere, it really just needed a dummy value for when the input is `None`.)
This commit is contained in:
bors 2015-07-22 23:37:37 +00:00
commit cb4f102e38

View File

@ -478,7 +478,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
let ctor_id = match def.ctor_id {
Some(node_id) => node_id,
None => -1,
None => ast::DUMMY_NODE_ID,
};
let val = self.span.snippet(item.span);
let sub_span = self.span.sub_span_after_keyword(item.span, keywords::Struct);
@ -536,7 +536,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
ast::StructVariantKind(ref struct_def) => {
let ctor_id = match struct_def.ctor_id {
Some(node_id) => node_id,
None => -1,
None => ast::DUMMY_NODE_ID,
};
self.fmt.struct_variant_str(variant.span,
self.span.span_for_first_ident(variant.span),