Skip to content

Commit

Permalink
add 5 ices
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Aug 21, 2022
1 parent e9eb072 commit 1dc3cb0
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ices/100771.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

rustc -Zextra-const-ub-checks - <<'EOF'
#[derive(PartialEq, Eq, Copy, Clone)]
#[repr(packed)]
struct Foo {
field: (i64, u32, u32, u32),
}
const FOO: Foo = Foo {
field: (5, 6, 7, 8),
};
fn main() {
match FOO {
Foo { field: (5, 6, 7, 8) } => {},
FOO => unreachable!(), //~ WARNING unreachable pattern
_ => unreachable!(),
}
}
EOF

12 changes: 12 additions & 0 deletions ices/100772.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

rustc -Clto -Zsanitizer=cfi - <<'EOF'
#![feature(allocator_api)]
fn main() {
Box::new_in(&[0, 1], &std::alloc::Global);
}
EOF

24 changes: 24 additions & 0 deletions ices/100778.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

rustc -Clto -Zsanitizer=cfi - <<'EOF'
#![feature(adt_const_params, generic_const_exprs)]
#![allow(incomplete_features)]
pub type Matrix = [usize; 1];
const EMPTY_MATRIX: Matrix = [0; 1];
pub struct Walk<const REMAINING: Matrix> { }
impl Walk<EMPTY_MATRIX> {
pub const fn new() -> Self {
Self {}
}
}
fn main() {
let _ = Walk::new();
}
EOF

19 changes: 19 additions & 0 deletions ices/100783.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

rustc -Cdebuginfo=2 -Zsanitizer=cfi -Clto - <<'EOF'
// run-pass
trait Stream { type Item; }
impl<'a> Stream for &'a str { type Item = u8; }
fn f<'s>(s: &'s str) -> (&'s str, <&'s str as Stream>::Item) {
(s, 42)
}
fn main() {
let fx = f as for<'t> fn(&'t str) -> (&'t str, <&'t str as Stream>::Item);
assert_eq!(fx("hi"), ("hi", 42));
}
EOF

9 changes: 9 additions & 0 deletions ices/100818.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(type_alias_impl_trait)]
use std::future::Future;

fn main() {
type SomeFuture<'t> = impl 't + Future<Output = ()>;
type SomeClosure = impl for<'t> FnOnce(&'t str) -> SomeFuture<'t>;
fn coerce_closure(f: SomeClosure) {}
coerce_closure(|x: &str| async move {});
}

0 comments on commit 1dc3cb0

Please sign in to comment.