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

Commit

Permalink
Merge pull request #1468 from JohnTitor/add-ices-20221220
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor authored Dec 20, 2022
2 parents da31d7d + 8914a4d commit b4fbd67
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 48 deletions.
1 change: 0 additions & 1 deletion fixed/99647.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ async fn bar() {}
fn main() {}
EOF

1 change: 0 additions & 1 deletion ices/100612.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ fn main() {
}
EOF

31 changes: 31 additions & 0 deletions ices/101198.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#![no_std]
#![feature(lang_items, start)]
#![crate_type="lib"]

#[lang = "owned_box"]
struct Box<T>(*mut T);

#[lang = "exchange_malloc"]
unsafe fn alloc() -> *mut u8 {
core::ptr::null_mut()
}

#[lang = "box_free"]
unsafe fn free<T: ?Sized>(ptr: *mut T) { }

impl<T> Box<T> {
pub fn new(val: T) -> Box<T> {
Box::new(val)
}
}

#[start]
fn main(i: isize, args: *const *const u8) -> isize {
let x = Box::new(3);
0
}

#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
loop {}
}
3 changes: 1 addition & 2 deletions ices/101518-1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
#[derive(PartialEq, Eq)]
struct Id<'a> {
Expand Down
2 changes: 1 addition & 1 deletion ices/101518-2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF'
#[derive(Eq, PartialEq)]
struct Id(&'static str);
Expand Down
3 changes: 1 addition & 2 deletions ices/101852.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ pub fn ice(
Vec::new()
}

fn main() {
}
fn main() {}
2 changes: 1 addition & 1 deletion ices/101962.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pub fn wrapping<T: Copy>(a: T, b: T) {
let _z = core::intrinsics::wrapping_mul(a, b);
}

pub fn main() {
fn main() {
wrapping(1,2);
}
1 change: 0 additions & 1 deletion ices/101964.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#![crate_type = "lib"]
#![feature(lang_items)]
#![no_std]
Expand Down
25 changes: 25 additions & 0 deletions ices/103899.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
trait BaseWithAssoc {
type Assoc;
}

trait WrapperWithAssoc {
type BaseAssoc: BaseWithAssoc;
}

struct Wrapper<B> {
inner: B,
}

struct ProjectToBase<T: BaseWithAssoc> {
data_type_h: T::Assoc,
}

struct DoubleProject<L: WrapperWithAssoc> {
buffer: Wrapper<ProjectToBase<L::BaseAssoc>>,
}

fn trigger<L: WrapperWithAssoc<BaseAssoc = ()>>() -> DoubleProject<L> {
loop {}
}

fn main() {}
36 changes: 36 additions & 0 deletions ices/104196.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use core::future::Future;

pub struct Struct<C, Fu, F>
where
F: Fn(&C) -> Fu,
Fu: Future,
{
handler: F,
context: C,
}

impl<C, Fu, R, F> Struct<C, Fu, F>
where
F: Fn(&C) -> Fu,
Fu: Future<Output = R>,
{
pub const fn new(handler: F, context: C) -> Self {
Self { handler, context }
}
}

type TestC = &'static usize;
type TestFu = impl Future;
type TestF = impl Fn(&TestC) -> TestFu;
type TestStruct = Struct<TestC, TestFu, TestF>;

async fn test_handler(context: &TestC) -> () {
()
}

fn get_test_struct() -> &'static TestStruct {
static test_actor: TestStruct = TestStruct::new(test_handler, &0);
&test_actor
}

fn main() {}
18 changes: 18 additions & 0 deletions ices/104779.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
struct Inv<'a>(&'a mut &'a ());
enum Foo<T> {
Bar,
Var(T),
}
type Subtype = Foo<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>;
type Supertype = Foo<for<'a> fn(Inv<'a>, Inv<'a>)>;

fn foo() -> impl Sized {
loop {
match foo() {
Subtype::Bar => (),
Supertype::Var(x) => {}
}
}
}

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

#[cfg_eval]
fn main() {
#[cfg_eval]
let _ = #[cfg(FALSE)] 0;
//~^ ERROR removing an expression is not supported in this position
}
6 changes: 6 additions & 0 deletions ices/105231.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
struct A<T>(B<T>);
struct B<T>(A<A<T>>);
trait Foo {}
impl<T> Foo for T where T: Send {}
impl Foo for B<u8> {}
fn main() {}
7 changes: 7 additions & 0 deletions ices/105273.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rustc "-Zunpretty=ast-tree" - <<'EOF'
#![c = ({(while ""))();
EOF
12 changes: 12 additions & 0 deletions ices/105305.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct S<T>(T);

impl<T, 'a> S<T> { // Also repros with any other lifetimes such as '_ ,switching order to 'a, T also repros.
type P = T;
}

fn main() {
type A = S<()>::P;
}
11 changes: 11 additions & 0 deletions ices/105321.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn hof<F>(_: F)
where
F: FnMut() -> (),
{
}

fn f() -> _ {
hof(f);
}

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

cat > out.rs <<'EOF'
impl Vec< br##"*.."## > {}
fn main() {}
EOF

rustdoc out.rs
36 changes: 0 additions & 36 deletions ices/98171.sh

This file was deleted.

3 changes: 1 addition & 2 deletions ices/98250.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ fn foo() -> Foo {
fn main() {}
EOF

rustdoc out.rs
rustdoc out.rs
1 change: 0 additions & 1 deletion ices/99363.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ fn main() {
}
EOF

0 comments on commit b4fbd67

Please sign in to comment.