summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-block.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/consts/const-block.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/const-block.rs')
-rw-r--r--src/test/ui/consts/const-block.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/test/ui/consts/const-block.rs b/src/test/ui/consts/const-block.rs
deleted file mode 100644
index ec99c70f6..000000000
--- a/src/test/ui/consts/const-block.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// run-pass
-#![allow(unused_braces)]
-#![allow(dead_code)]
-#![allow(unused_unsafe)]
-
-use std::marker::Sync;
-
-struct Foo {
- a: usize,
- b: *const ()
-}
-
-unsafe impl Sync for Foo {}
-
-fn foo<T>(a: T) -> T {
- a
-}
-
-static BLOCK_INTEGRAL: usize = { 1 };
-static BLOCK_EXPLICIT_UNIT: () = { () };
-static BLOCK_IMPLICIT_UNIT: () = { };
-static BLOCK_FLOAT: f64 = { 1.0 };
-static BLOCK_ENUM: Option<usize> = { Some(100) };
-static BLOCK_STRUCT: Foo = { Foo { a: 12, b: std::ptr::null::<()>() } };
-static BLOCK_UNSAFE: usize = unsafe { 1000 };
-
-static BLOCK_FN_INFERRED: fn(usize) -> usize = { foo };
-
-static BLOCK_FN: fn(usize) -> usize = { foo::<usize> };
-
-static BLOCK_ENUM_CONSTRUCTOR: fn(usize) -> Option<usize> = { Some };
-
-pub fn main() {
- assert_eq!(BLOCK_INTEGRAL, 1);
- assert_eq!(BLOCK_EXPLICIT_UNIT, ());
- assert_eq!(BLOCK_IMPLICIT_UNIT, ());
- assert_eq!(BLOCK_FLOAT, 1.0_f64);
- assert_eq!(BLOCK_STRUCT.a, 12);
- assert_eq!(BLOCK_STRUCT.b, std::ptr::null::<()>());
- assert_eq!(BLOCK_ENUM, Some(100));
- assert_eq!(BLOCK_UNSAFE, 1000);
- assert_eq!(BLOCK_FN_INFERRED(300), 300);
- assert_eq!(BLOCK_FN(300), 300);
- assert_eq!(BLOCK_ENUM_CONSTRUCTOR(200), Some(200));
-}