about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-06-22 09:51:08 +0100
committerGitHub <noreply@github.com>2016-06-22 09:51:08 +0100
commitc295a1c7c28e6ff0b83967c065cc00a13f373aa1 (patch)
treeec321c6bc148ce6d5e2c4d95d402ff81ce4bf0f3 /src/test
parent0c94e902334c8ad47c44dc725ad5109050a1470e (diff)
parent0de72bba3634efb9d7b637b274c8f2ec1a335bf4 (diff)
Rollup merge of #34394 - oli-obk:const_cast_false_positive, r=eddyb
don't warn on casting byte strs to slices

r? @durka
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/const-byte-str-cast.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/run-pass/const-byte-str-cast.rs b/src/test/run-pass/const-byte-str-cast.rs
new file mode 100644
index 00000000000..2f265b9112b
--- /dev/null
+++ b/src/test/run-pass/const-byte-str-cast.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 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.
+
+#[deny(warnings)]
+
+pub fn main() {
+    let _ = b"x" as &[u8];
+}