about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libsyntax_ext/deriving/debug.rs2
-rw-r--r--src/test/run-pass/issue-42453.rs17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs
index 82fc09fca69..7b23de582a7 100644
--- a/src/libsyntax_ext/deriving/debug.rs
+++ b/src/libsyntax_ext/deriving/debug.rs
@@ -70,7 +70,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<E
     // We want to make sure we have the ctxt set so that we can use unstable methods
     let span = span.with_ctxt(cx.backtrace());
     let name = cx.expr_lit(span, ast::LitKind::Str(ident.name, ast::StrStyle::Cooked));
-    let builder = Ident::from_str("builder");
+    let builder = Ident::from_str("__debug_trait_builder");
     let builder_expr = cx.expr_ident(span, builder.clone());
 
     let fmt = substr.nonself_args[0].clone();
diff --git a/src/test/run-pass/issue-42453.rs b/src/test/run-pass/issue-42453.rs
new file mode 100644
index 00000000000..dfe3a21961e
--- /dev/null
+++ b/src/test/run-pass/issue-42453.rs
@@ -0,0 +1,17 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[derive(Debug)]
+struct builder;
+
+fn main() {
+
+}
+