about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-22 23:37:37 +0000
committerbors <bors@rust-lang.org>2015-07-22 23:37:37 +0000
commitcb4f102e38ef306e7e8e4ac747f25799b4cf7415 (patch)
treeaca5ea0c474ab1a3bd1ed3944cee7414e1da05ba
parent4234c4487afb892b077bdfb7a002ad4fc2f2a0bd (diff)
parent91493df7523c36ec10fe576f1944e0bad4c105a2 (diff)
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`.)
-rw-r--r--src/librustc_trans/save/dump_csv.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs
index 680999717ea..f291413cedc 100644
--- a/src/librustc_trans/save/dump_csv.rs
+++ b/src/librustc_trans/save/dump_csv.rs
@@ -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),