about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-29 02:33:24 +0200
committerGitHub <noreply@github.com>2020-05-29 02:33:24 +0200
commit71512e425fe8644cdc17c47571909ab32e4e9c47 (patch)
treedecb22f23dd973494bd392b15ada722b6c61bf57
parentfeaceb2063688c401a41d4d7aafc8f5735afa30a (diff)
parente069524c4848e6d4b24866d6725509fdf67f371d (diff)
downloadrust-71512e425fe8644cdc17c47571909ab32e4e9c47.tar.gz
rust-71512e425fe8644cdc17c47571909ab32e4e9c47.zip
Rollup merge of #72682 - JohnTitor:mir-tests, r=RalfJung
Add test for #66930

Closes #66930
Closes #67558

They're fixed by #72424.
I skipped adding `--emit=mir` flag to src/test/ui/issues/issue-25145.rs as a regression test since the root cause seems the same and it should be run with `check-pass`, not `run-pass` so we should duplicate that test.

r? @RalfJung
-rw-r--r--src/test/ui/mir/issue-66930.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/mir/issue-66930.rs b/src/test/ui/mir/issue-66930.rs
new file mode 100644
index 00000000000..5f9eb2bf437
--- /dev/null
+++ b/src/test/ui/mir/issue-66930.rs
@@ -0,0 +1,11 @@
+// check-pass
+// compile-flags: --emit=mir,link
+// Regression test for #66930, this ICE requires `--emit=mir` flag.
+
+static UTF8_CHAR_WIDTH: [u8; 0] = [];
+
+pub fn utf8_char_width(b: u8) -> usize {
+    UTF8_CHAR_WIDTH[b as usize] as usize
+}
+
+fn main() {}