We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8d4883 commit 7f3e18cCopy full SHA for 7f3e18c
src/test/ui/consts/rfc-2203-const-array-repeat-exprs/const-repeat.rs
@@ -1,4 +1,4 @@
1
-// check-pass
+// run-pass
2
3
// Repeating a *constant* of non-Copy type (not just a constant expression) is already stable.
4
@@ -8,6 +8,20 @@ pub fn bar() -> [Vec<i32>; 2] {
8
[EMPTY; 2]
9
}
10
11
+struct Bomb;
12
+
13
+impl Drop for Bomb {
14
+ fn drop(&mut self) {
15
+ panic!("BOOM!");
16
+ }
17
+}
18
19
+const BOOM: Bomb = Bomb;
20
21
fn main() {
- let x = bar();
22
+ let _x = bar();
23
24
+ // Make sure the destructor does not get called for empty arrays. `[CONST; N]` should
25
+ // instantiate (and then later drop) the const exactly `N` times.
26
+ let _x = [BOOM; 0];
27
0 commit comments