]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/cast_alignment.rs
iterate List by value
[rust.git] / tests / ui / cast_alignment.rs
index efc56ea2bbc131d9ffda9b59c973ab6a252b14e3..4c08935639f1f3a5ae5fd847de7c3398ae71b31e 100644 (file)
@@ -1,16 +1,6 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// 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.
-
 //! Test casts for alignment issues
 
-#![feature(libc)]
-
+#![feature(rustc_private)]
 extern crate libc;
 
 #[warn(clippy::cast_ptr_alignment)]
@@ -22,7 +12,7 @@ fn main() {
     (&1u8 as *const u8) as *const u16;
     (&mut 1u8 as *mut u8) as *mut u16;
 
-    /* These should be okay */
+    /* These should be ok */
 
     // not a pointer type
     1u8 as u16;
@@ -32,4 +22,6 @@ fn main() {
     // For c_void, we should trust the user. See #2677
     (&1u32 as *const u32 as *const std::os::raw::c_void) as *const u32;
     (&1u32 as *const u32 as *const libc::c_void) as *const u32;
+    // For ZST, we should trust the user. See #4256
+    (&1u32 as *const u32 as *const ()) as *const u32;
 }