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

Commit

Permalink
add 4 ices (#1316)
Browse files Browse the repository at this point in the history
* add 4 ices

rust-lang/rust#98432
rust-lang/rust#98250
rust-lang/rust#98171
rust-lang/rust#98016

* Update ices/98432.rs

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
matthiaskrgr and JohnTitor committed Jun 24, 2022
1 parent c048d45 commit 906e616
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ices/98016.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

rustc --edition=2021 -Zmir-opt-level=3 -Zvalidate-mir - <<EOF
#![crate_type = "lib"]
#![feature(portable_simd)]
use std::simd::Simd;
const N: usize = 8;
#[no_mangle]
// CHECK-LABEL: @wider_reduce_into_iter
pub fn wider_reduce_into_iter(x: Simd<u8, N>) -> u16 {
// CHECK: zext <8 x i8>
// CHECK-SAME: to <8 x i16>
// CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16>
x.to_array().into_iter().map(u16::from).sum()
}
EOF
36 changes: 36 additions & 0 deletions ices/98171.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

cat > out.rs <<'EOF'
// Issue 22443: Reject code using non-regular types that would
// otherwise cause dropck to loop infinitely.
use std::marker::PhantomData;
struct Digit<T> {
elem: T
}
struct Node<T:'static> { m: PhantomData<&'static T> }
enum FingerTree<T:'static> {
Single(T),
// Bug report said Digit after Box would stack overflow (versus
// Digit before Box; see dropck_no_diverge_on_nonregular_2).
Deep(
Box<FingerTree<Node<T>>>,
Digit<T>,
)
}
fn main() {
let ft = //~ ERROR overflow while adding drop-check rules for FingerTree
FingerTree::Single(1);
//~^ ERROR overflow while adding drop-check rules for FingerTree
}
EOF

rustdoc out.rs
27 changes: 27 additions & 0 deletions ices/98250.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

cat > out.rs <<'EOF'
#![feature(type_alias_impl_trait)]
type Foo = impl PartialEq<(Foo, i32)>;
struct Bar;
impl PartialEq<(Foo, i32)> for Bar {
//~^ ERROR cannot implement trait on type alias impl trait
fn eq(&self, _other: &(Foo, i32)) -> bool {
true
}
}
fn foo() -> Foo {
Bar
}
fn main() {}
EOF

rustdoc out.rs
12 changes: 12 additions & 0 deletions ices/98432.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
struct Struct<T>(T);

impl<T> Struct<T> {
const CONST: fn() = || {
struct _Obligation
where
T:;
};
}

fn main() {}

0 comments on commit 906e616

Please sign in to comment.