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

Commit

Permalink
add 2 more ices
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Sep 24, 2022
1 parent 95f5628 commit 3562248
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ices/102209.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use std::marker::PhantomData;

pub struct NfaBuilder<'brand> {
brand: PhantomData<&'brand mut &'brand mut ()>,
}

impl NfaBuilder<'_> {
pub fn with<R, F: FnOnce(NfaBuilder<'_>) -> R>(f: F) -> R {
Brand::with(|brand| {
// This should be using NfaBuilder instead of Self becuase they have diffrent lifetime constraints
f(Self {
brand: brand.lt,
})
})
}
}

#[derive(Clone, Copy)]
pub struct Brand<'brand> {
lt: PhantomData<&'brand mut &'brand mut ()>,
}

impl Brand<'_> {
pub fn with<R, F: FnOnce(Brand<'_>) -> R>(f: F) -> R {
f(Self { lt: PhantomData })
}
}

pub fn main() {}
5 changes: 5 additions & 0 deletions ices/102219.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#![crate_type = "lib"]
#![feature(async_fn_in_trait)]
trait T {
async fn foo();
}

0 comments on commit 3562248

Please sign in to comment.