We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d03fe84 commit af0d099Copy full SHA for af0d099
src/test/ui/mir/ssa-analysis-regression-50041.rs
@@ -0,0 +1,34 @@
1
+// build-pass
2
+// compile-flags: -Z mir-opt-level=3
3
+
4
+#![crate_type="lib"]
5
+#![feature(lang_items)]
6
+#![no_std]
7
8
+#[lang = "owned_box"]
9
+pub struct Box<T: ?Sized>(*mut T);
10
11
+impl<T: ?Sized> Drop for Box<T> {
12
+ fn drop(&mut self) {
13
+ }
14
+}
15
16
+#[lang = "box_free"]
17
+#[inline(always)]
18
+unsafe fn box_free<T: ?Sized>(ptr: *mut T) {
19
+ dealloc(ptr)
20
21
22
+#[inline(never)]
23
+fn dealloc<T: ?Sized>(_: *mut T) {
24
25
26
+pub struct Foo<T>(T);
27
28
+pub fn foo(a: Option<Box<Foo<usize>>>) -> usize {
29
+ let f = match a {
30
+ None => Foo(0),
31
+ Some(vec) => *vec,
32
+ };
33
+ f.0
34
0 commit comments