From 3562248367ecb4a8bd4f0210587c7122090c36a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 24 Sep 2022 07:29:41 +0200 Subject: [PATCH] add 2 more ices https://github.com/rust-lang/rust/issues/102209 https://github.com/rust-lang/rust/issues/102219 --- ices/102209.rs | 29 +++++++++++++++++++++++++++++ ices/102219.rs | 5 +++++ 2 files changed, 34 insertions(+) create mode 100644 ices/102209.rs create mode 100644 ices/102219.rs diff --git a/ices/102209.rs b/ices/102209.rs new file mode 100644 index 00000000..675a0869 --- /dev/null +++ b/ices/102209.rs @@ -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: 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: F) -> R { + f(Self { lt: PhantomData }) + } +} + +pub fn main() {} diff --git a/ices/102219.rs b/ices/102219.rs new file mode 100644 index 00000000..6c77d2a1 --- /dev/null +++ b/ices/102219.rs @@ -0,0 +1,5 @@ +#![crate_type = "lib"] +#![feature(async_fn_in_trait)] +trait T { + async fn foo(); +}