From 91493df7523c36ec10fe576f1944e0bad4c105a2 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 21 Jul 2015 18:12:06 +0200 Subject: [PATCH] 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`.) --- src/librustc_trans/save/dump_csv.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs index 680999717eae..f291413cedc7 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),