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

Commit

Permalink
Add some ICEs
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <[email protected]>
  • Loading branch information
JohnTitor committed Jan 8, 2023
1 parent f158f02 commit 6d82448
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ices/102363.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

cat > out.rs << EOF
#![feature(no_core)]
#![no_core]
#[doc(primitive = "usize")]
/// This is the built-in type `usize`.
mod usize {
}
EOF

rustdoc --document-private-items -Zunstable-options --output-format=json out.rs
12 changes: 12 additions & 0 deletions ices/102446.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(inline_const)]
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

use std::mem;

pub union AsBytes<T> {
pub value: mem::ManuallyDrop<T>,
pub as_bytes: [u8; const { mem::size_of::<T>() }],
}

fn main() {}
7 changes: 7 additions & 0 deletions ices/103666.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![feature(type_alias_impl_trait)]

type Tait<'b> = impl Sized;

fn foo(f: &dyn Fn(Tait)) {}

fn main() {}
15 changes: 15 additions & 0 deletions ices/104817.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#![feature(type_alias_impl_trait)]
#![feature(specialization)]
#![allow(incomplete_features, dead_code)]

trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
type OpaqueType = impl OpaqueTrait;
fn mk_opaque() -> OpaqueType {
|| 0
}
trait AnotherTrait {}
impl<T: Send> AnotherTrait for T {}
impl AnotherTrait for OpaqueType {}

fn main() {}
7 changes: 7 additions & 0 deletions ices/106077.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![feature(associated_type_bounds)]

struct Bug<T: ?Sized>(T);

impl Bug<dyn Iterator<Item: Copy>> {}

fn main() {}
17 changes: 17 additions & 0 deletions ices/106079.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

cat > out.rs << EOF
trait X {
type Y<'a>;
}
const _: () = {
fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
//~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
//~| ERROR this associated type takes 0 generic arguments but 1 generic argument
};
fn main() {}
EOF

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

rustc -Zmir-opt-level=3 --crate-type=lib - <<'EOF'
pub trait A {
type B;
}
pub struct S<T: A>(T::B);
pub fn foo<T: A>(p: *mut S<T>) {
unsafe { core::ptr::drop_in_place(p) };
}
EOF
14 changes: 14 additions & 0 deletions ices/106473.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

const DEFAULT: u32 = 1;

struct V<const U: usize = DEFAULT>
where
[(); U]:;

trait Tr {}

impl Tr for V {}

fn main() {}

0 comments on commit 6d82448

Please sign in to comment.