This repository was archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1468 from JohnTitor/add-ices-20221220
- Loading branch information
Showing
20 changed files
with
171 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ async fn bar() {} | |
fn main() {} | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ fn main() { | |
} | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ pub fn ice( | |
Vec::new() | ||
} | ||
|
||
fn main() { | ||
} | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
#![crate_type = "lib"] | ||
#![feature(lang_items)] | ||
#![no_std] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
rustc "-Zunpretty=ast-tree" - <<'EOF' | ||
#![c = ({(while ""))(); | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ fn foo() -> Foo { | |
fn main() {} | ||
EOF | ||
|
||
rustdoc out.rs | ||
rustdoc out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,3 @@ fn main() { | |
} | ||
EOF | ||
|