Skip to content

Commit

Permalink
add 2 (4) ICES
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jun 25, 2022
1 parent 906e616 commit 98d7d79
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ices/97099-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub trait Trait<'a> {
type Assoc;
}

struct Struct;
impl<'a> Trait<'a> for Struct {
type Assoc = &'a u32;
}

fn blah() -> impl for<'a> Trait<'a, Assoc = impl Sized> {
Struct
}
17 changes: 17 additions & 0 deletions ices/97099-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trait Trait<E> {
type Assoc;
}

struct Foo;

impl<'a> Trait<&'a ()> for Foo {
type Assoc = ();
}

fn foo() -> impl for<'a> Trait<&'a ()> {
Foo
}

fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
foo()
}
25 changes: 25 additions & 0 deletions ices/98476-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

rustc --edition=2021 -Zdrop-tracking - <<'EOF'
fn main() {
let _ = foo();
}
async fn from_config(_: Config) {}
async fn foo() {
from_config(Config {
nickname: None,
..Default::default()
})
.await;
}
#[derive(Default)]
struct Config {
nickname: Option<Box<u8>>,
}
EOF

34 changes: 34 additions & 0 deletions ices/98476-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

rustc --edition=2021 -Zdrop-tracking - <<'EOF'
fn main() {
let _ = foo();
}
async fn from_config(x: Config) {
async {}.await;
drop(x);
}
async fn foo() {
from_config(Config {
nickname: NonCopy,
..Default::default()
})
.await;
}
#[derive(Default)]
struct NonCopy;
impl Drop for NonCopy {
fn drop(&mut self) {}
}
#[derive(Default)]
struct Config {
nickname: NonCopy,
}
EOF

0 comments on commit 98d7d79

Please sign in to comment.