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

Commit 5609b9b

Browse files
authored
Merge pull request #1271 from matthiaskrgr/may25
add 2-3 ices
2 parents c52b15e + 2541ff8 commit 5609b9b

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

ices/97378-1.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
rustc --edition=2021 - << EOF
4+
5+
pub enum Request {
6+
Resolve {
7+
url: String,
8+
},
9+
}
10+
11+
pub async fn handle_event(
12+
event: Request,
13+
) {
14+
async move {
15+
let Request::Resolve { url } = event;
16+
}.await;
17+
}
18+
19+
pub fn main() {}
20+
21+
EOF

ices/97378-2.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
rustc --edition=2021 - << EOF
4+
5+
pub enum Request {
6+
Resolve { url: String },
7+
}
8+
9+
pub fn handle_event(event: Request) {
10+
(move || {
11+
let Request::Resolve { url: _url } = event;
12+
})();
13+
}
14+
15+
pub fn main() {}
16+
17+
EOF

ices/97381.rs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
use std::ops::Deref;
2+
3+
trait MyTrait: Deref<Target = u32> {}
4+
5+
struct MyStruct(u32);
6+
7+
impl MyTrait for MyStruct {}
8+
9+
impl Deref for MyStruct {
10+
type Target = u32;
11+
12+
fn deref(&self) -> &Self::Target {
13+
&self.0
14+
}
15+
}
16+
17+
fn get_concrete_value(i: u32) -> MyStruct {
18+
MyStruct(i)
19+
}
20+
21+
fn get_boxed_value(i: u32) -> Box<dyn MyTrait> {
22+
Box::new(get_concrete_value(i))
23+
}
24+
25+
fn main() {
26+
let v = [1, 2, 3]
27+
.iter()
28+
.map(|i| get_boxed_value(*i))
29+
.collect::<Vec<_>>();
30+
31+
let el = &v[0];
32+
33+
for _ in v {
34+
// this triggers bug
35+
println!("{}", ***el > 0);
36+
}
37+
}

0 commit comments

Comments
 (0)