Skip to content

Commit

Permalink
add 2-3 ices
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed May 26, 2022
1 parent c52b15e commit 2541ff8
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ices/97378-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

rustc --edition=2021 - << EOF
pub enum Request {
Resolve {
url: String,
},
}
pub async fn handle_event(
event: Request,
) {
async move {
let Request::Resolve { url } = event;
}.await;
}
pub fn main() {}
EOF
17 changes: 17 additions & 0 deletions ices/97378-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

rustc --edition=2021 - << EOF
pub enum Request {
Resolve { url: String },
}
pub fn handle_event(event: Request) {
(move || {
let Request::Resolve { url: _url } = event;
})();
}
pub fn main() {}
EOF
37 changes: 37 additions & 0 deletions ices/97381.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use std::ops::Deref;

trait MyTrait: Deref<Target = u32> {}

struct MyStruct(u32);

impl MyTrait for MyStruct {}

impl Deref for MyStruct {
type Target = u32;

fn deref(&self) -> &Self::Target {
&self.0
}
}

fn get_concrete_value(i: u32) -> MyStruct {
MyStruct(i)
}

fn get_boxed_value(i: u32) -> Box<dyn MyTrait> {
Box::new(get_concrete_value(i))
}

fn main() {
let v = [1, 2, 3]
.iter()
.map(|i| get_boxed_value(*i))
.collect::<Vec<_>>();

let el = &v[0];

for _ in v {
// this triggers bug
println!("{}", ***el > 0);
}
}

0 comments on commit 2541ff8

Please sign in to comment.