about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-07-21 18:12:06 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-07-21 18:12:06 +0200
commit91493df7523c36ec10fe576f1944e0bad4c105a2 (patch)
tree0aaefa116d72a79242e0bff058d2073c5f2bfb1d
parent2afe47d1688726fd1e836deedaa0ad8c2ec891c7 (diff)
downloadrust-91493df7523c36ec10fe576f1944e0bad4c105a2.tar.gz
rust-91493df7523c36ec10fe576f1944e0bad4c105a2.zip
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),