Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

add 5 ices #1394

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {});
}