about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-06 15:17:13 +0000
committerbors <bors@rust-lang.org>2018-05-06 15:17:13 +0000
commitfb9e0588901dc2311f5e8f63f1c041e83041a596 (patch)
treeb9a3c4902618105f94df39d71087d2681ca9343d /src/test
parent2416032bb79ede22388b3be10a7a8b94dccd5109 (diff)
parent39df2231bb7d3de171b6a7117bb76bbee5a4597f (diff)
Auto merge of #50474 - sinkuu:fix_assert_ice, r=alexcrichton
Fix ICE in assertion macro

Fixes #50471. Needs beta-backport (stable-to-beta/nightly regression).

* `panic` with single argument does not need escaping `{` and `}`
* Instead of unescaping `\u{...}` manually, just use `escape_debug` in pprust
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-50471.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-50471.rs b/src/test/compile-fail/issue-50471.rs
new file mode 100644
index 00000000000..ce2947144af
--- /dev/null
+++ b/src/test/compile-fail/issue-50471.rs
@@ -0,0 +1,19 @@
+// Copyright 2018 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.
+
+// compile-pass
+
+fn main() {
+    assert!({false});
+
+    assert!(r"\u{41}" == "A");
+
+    assert!(r"\u{".is_empty());
+}